From 2fef08b80288d72d571f4439380676acbf5bc8b7 Mon Sep 17 00:00:00 2001 From: Hernan Ponce de Leon Date: Sat, 18 Nov 2023 16:59:26 +0100 Subject: [PATCH 01/21] Add support for several intrinsics (#574) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ignore inline assembly, but generate nondeterministic return values * Add intrinsics for void* calloc(size_t,size_t), int pthread_mutex_trylock(void*) * Add intrinsics for pthread_cond* * Add empty intrinsics for pthread_mutexattr* * Add intrinsics for pthread_rwlock* * Add intrinsics for strcpy * Intrinsics error message now contains all missing intrinsics * Add intrinsics pthread_getspecific * Add pthread_setspecific * Add pthread_key_create * Add pthread_key_destroy --------- Co-authored-by: René Pascal Maseli --- .../parsers/program/visitors/VisitorLlvm.java | 41 +- .../dartagnan/program/event/lang/Alloc.java | 4 +- .../program/processing/Inlining.java | 12 +- .../program/processing/Intrinsics.java | 401 +++++++++++++++++- 4 files changed, 430 insertions(+), 28 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java index 26b9583332..bd95702585 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java @@ -100,7 +100,7 @@ public Expression visitCompilationUnit(CompilationUnitContext ctx) { // Parse global definitions after declarations. for (final TopLevelEntityContext entity : ctx.topLevelEntity()) { if (entity.globalDef() != null) { - entity.accept(this); + visitGlobalDef(entity.globalDef()); } } @@ -364,16 +364,7 @@ public Expression visitSwitchTerm(SwitchTermContext ctx) { @Override public Expression visitCallInst(CallInstContext ctx) { - if (ctx.inlineAsm() != null) { - // FIXME: We ignore all inline assembly. - return null; - } - final Expression callTarget = checkPointerExpression(ctx.value()); - if (callTarget == null) { - //FIXME ignores metadata functions, but also undeclared functions - return null; - } - //checkSupport(callTarget instanceof Function, "Indirect call in %s.", ctx); + // see https://llvm.org/docs/LangRef.html#call-instruction final Type type = parseType(ctx.type()); // Calls can either list the full function type or just the return type. final Type returnType = type instanceof FunctionType funcType ? funcType.getReturnType() : type; @@ -389,16 +380,28 @@ public Expression visitCallInst(CallInstContext ctx) { arguments.add(checkExpression(argumentType, argument.value())); } - final FunctionType funcType; - if (type instanceof FunctionType) { - funcType = (FunctionType) type; - } else { - // Build FunctionType from return type and argument types - funcType = types.getFunctionType(returnType, Lists.transform(arguments, Expression::getType)); - } - final Register resultRegister = currentRegisterName == null ? null : getOrNewRegister(currentRegisterName, returnType); + + if (ctx.inlineAsm() != null) { + // see https://llvm.org/docs/LangRef.html#inline-assembler-expressions + //FIXME ignore side effects of inline assembly + if (resultRegister != null) { + block.events.add(newLocal(resultRegister, makeNonDetOfType(returnType))); + } + return resultRegister; + } + + final Expression callTarget = checkPointerExpression(ctx.value()); + if (callTarget == null) { + //FIXME ignores metadata functions, but also undeclared functions + return null; + } + + // Build FunctionType from return type and argument types + final FunctionType funcType = type instanceof FunctionType t ? t : + types.getFunctionType(returnType, Lists.transform(arguments, Expression::getType)); + final Event call = currentRegisterName == null ? newVoidFunctionCall(funcType, callTarget, arguments) : newValueFunctionCall(resultRegister, funcType, callTarget, arguments); diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/lang/Alloc.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/lang/Alloc.java index a502647f4b..a13f6f580a 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/lang/Alloc.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/lang/Alloc.java @@ -72,7 +72,9 @@ public Expression getAllocationSize() { ); } else { allocationSize = expressions.makeMUL( - expressions.makeValue(BigInteger.valueOf(types.getMemorySizeInBytes(allocationType)), types.getArchType()), + expressions.makeValue( + BigInteger.valueOf(types.getMemorySizeInBytes(allocationType)), + (IntegerType) arraySize.getType()), arraySize ); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java index b76058bc8a..b775876e27 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java @@ -31,6 +31,7 @@ import static com.dat3m.dartagnan.configuration.OptionNames.RECURSION_BOUND; import static com.dat3m.dartagnan.program.event.EventFactory.*; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Verify.verify; @Options public class Inlining implements ProgramProcessor { @@ -56,7 +57,8 @@ public void run(Program program) { function.getName(), function.getParameterRegisters(), function.getEvents(), - List.copyOf(function.getRegisters()))); + List.copyOf(function.getRegisters()), + function.getFunctionType().isVarArgs())); } for (final Function function : program.getFunctions()) { inlineAllCalls(function, snapshots); @@ -66,7 +68,8 @@ public void run(Program program) { } } - private record Snapshot(String name, List parameters, List events, List registers) {} + private record Snapshot(String name, List parameters, List events, List registers, + boolean isVarArgs) {} private boolean canInline(FunctionCall call) { return call.isDirectCall() && call.getCalledFunction().hasBody(); @@ -126,7 +129,8 @@ private static Event inlineBody(FunctionCall call, Snapshot callTarget, int scop var replacementMap = new HashMap(); var registerMap = new HashMap(); final List arguments = call.getArguments(); - assert arguments.size() == callTarget.parameters.size(); + verify(callTarget.isVarArgs ? arguments.size() >= callTarget.parameters.size() : + arguments.size() == callTarget.parameters.size(), "Parameter mismatch at %s", call); // All registers have to be replaced for (final Register register : callTarget.registers) { final String newName = scope + ":" + register.getName(); @@ -134,7 +138,7 @@ private static Event inlineBody(FunctionCall call, Snapshot callTarget, int scop } var parameterAssignments = new ArrayList(); var returnEvents = new HashSet(); - for (int j = 0; j < arguments.size(); j++) { + for (int j = 0; j < callTarget.parameters.size(); j++) { Register register = registerMap.get(callTarget.parameters.get(j)); parameterAssignments.add(newLocal(register, arguments.get(j))); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 6354720f5f..ba95f1419c 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -15,6 +15,7 @@ import com.dat3m.dartagnan.program.event.functions.FunctionCall; import com.dat3m.dartagnan.program.event.functions.ValueFunctionCall; import com.dat3m.dartagnan.program.event.lang.svcomp.BeginAtomic; +import com.dat3m.dartagnan.program.memory.MemoryObject; import com.google.common.collect.ImmutableList; import com.google.common.primitives.UnsignedInteger; import com.google.common.primitives.UnsignedLong; @@ -26,7 +27,9 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.TreeSet; import java.util.function.BiPredicate; +import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; @@ -92,11 +95,52 @@ public enum Info { P_THREAD_JOIN(List.of("pthread_join", "__pthread_join", "\"\\01_pthread_join\""), false, true, false, false, null), P_THREAD_BARRIER_WAIT("pthread_barrier_wait", false, false, true, true, Intrinsics::inlineAsZero), P_THREAD_SELF(List.of("pthread_self", "__VERIFIER_tid"), false, false, true, false, null), + // --------------------------- pthread condition variable --------------------------- + P_THREAD_COND_INIT("pthread_cond_init", true, true, true, true, Intrinsics::inlinePthreadCondInit), + P_THREAD_COND_DESTROY("pthread_cond_destroy", true, false, true, true, Intrinsics::inlinePthreadCondDestroy), + P_THREAD_COND_SIGNAL("pthread_cond_signal", true, false, true, true, Intrinsics::inlinePthreadCondSignal), + P_THREAD_COND_BROADCAST("pthread_cond_broadcast", true, false, true, true, Intrinsics::inlinePthreadCondBroadcast), + P_THREAD_COND_WAIT("pthread_cond_wait", false, true, false, true, Intrinsics::inlinePthreadCondWait), + P_THREAD_COND_TIMEDWAIT("pthread_cond_timedwait", false, false, true, true, Intrinsics::inlinePthreadCondTimedwait), + P_THREAD_CONDATTR_INIT("pthread_condattr_init", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_CONDATTR_DESTROY("pthread_condattr_destroy", true, false, true, true, Intrinsics::inlineAsZero), + // --------------------------- pthread key --------------------------- + P_THREAD_KEY_CREATE("pthread_key_create", false, false, true, false, Intrinsics::inlinePthreadKeyCreate), + P_THREAD_KEY_DELETE("pthread_key_delete", false, false, true, false, Intrinsics::inlinePthreadKeyDelete), + P_THREAD_GET_SPECIFIC("pthread_getspecific", false, true, true, false, Intrinsics::inlinePthreadGetSpecific), + P_THREAD_SET_SPECIFIC("pthread_setspecific", true, false, true, false, Intrinsics::inlinePthreadSetSpecific), // --------------------------- pthread mutex --------------------------- P_THREAD_MUTEX_INIT("pthread_mutex_init", true, false, true, true, Intrinsics::inlinePthreadMutexInit), + P_THREAD_MUTEX_DESTROY("pthread_mutex_destroy", true, false, true, true, Intrinsics::inlinePthreadMutexDestroy), P_THREAD_MUTEX_LOCK("pthread_mutex_lock", true, true, false, true, Intrinsics::inlinePthreadMutexLock), + P_THREAD_MUTEX_TRYLOCK("pthread_mutex_trylock", true, true, true, true, Intrinsics::inlinePthreadMutexTryLock), P_THREAD_MUTEX_UNLOCK("pthread_mutex_unlock", true, false, true, true, Intrinsics::inlinePthreadMutexUnlock), - P_THREAD_MUTEX_DESTROY("pthread_mutex_destroy", true, false, true, true, Intrinsics::inlinePthreadMutexDestroy), + P_THREAD_MUTEXATTR_INIT("pthread_mutexattr_init", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_MUTEXATTR_DESTROY("pthread_mutexattr_destroy", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_MUTEXATTR_SET(List.of( + "pthread_mutexattr_setprioceiling", + "pthread_mutexattr_setprotocol", + "pthread_mutexattr_settype", + "pthread_mutexattr_setpolicy_np"), + true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_MUTEXATTR_GET(List.of( + "pthread_mutexattr_getprioceiling", + "pthread_mutexattr_getprotocol", + "pthread_mutexattr_gettype", + "pthread_mutexattr_getpolicy_np"), + false, true, true, true, Intrinsics::inlineAsZero), + // --------------------------- pthread read/write lock --------------------------- + P_THREAD_RWLOCK_INIT("pthread_rwlock_init", true, false, true, true, Intrinsics::inlinePthreadRwlockInit), + P_THREAD_RWLOCK_DESTROY("pthread_rwlock_destroy", true, true, true, true, Intrinsics::inlinePthreadRwlockDestroy), + P_THREAD_RWLOCK_WRLOCK("pthread_rwlock_wrlock", true, true, false, true, Intrinsics::inlinePthreadRwlockWrlock), + P_THREAD_RWLOCK_TRYWRLOCK("pthread_rwlock_trywrlock", true, true, true, true, Intrinsics::inlinePthreadRwlockTryWrlock), + P_THREAD_RWLOCK_RDLOCK("pthread_rwlock_rdlock", true, true, false, true, Intrinsics::inlinePthreadRwlockRdlock), + P_THREAD_RWLOCK_TRYRDLOCK("pthread_rwlock_tryrdlock", true, true, true, true, Intrinsics::inlinePthreadRwlockTryRdlock), + P_THREAD_RWLOCK_UNLOCK("pthread_rwlock_unlock", true, false, true, true, Intrinsics::inlinePthreadRwlockUnlock), + P_THREAD_RWLOCKATTR_INIT("pthread_rwlockattr_init", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_RWLOCKATTR_DESTROY("pthread_rwlockattr_destroy", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_RWLOCKATTR_SET("pthread_rwlockattr_setpshared", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_RWLOCKATTR_GET("pthread_rwlockattr_getpshared", true, false, true, true, Intrinsics::inlineAsZero), // --------------------------- SVCOMP --------------------------- VERIFIER_ATOMIC_BEGIN("__VERIFIER_atomic_begin", false, false, true, true, Intrinsics::inlineAtomicBegin), VERIFIER_ATOMIC_END("__VERIFIER_atomic_end", false, false, true, true, Intrinsics::inlineAtomicEnd), @@ -139,7 +183,12 @@ public enum Info { STD_MEMCPY("memcpy", true, true, true, false, Intrinsics::inlineMemCpy), STD_MEMSET(List.of("memset", "__memset_chk"), true, false, true, false, Intrinsics::inlineMemSet), STD_MEMCMP("memcmp", false, true, true, false, Intrinsics::inlineMemCmp), + STD_STRCPY("strcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, false)), + STD_STPCPY("stpcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, false)), + STD_STRNCPY("strncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, true)), + STD_STPNCPY("stpncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, true)), STD_MALLOC("malloc", false, false, true, true, Intrinsics::inlineMalloc), + STD_CALLOC("calloc", false, false, true, true, Intrinsics::inlineCalloc), STD_FREE("free", true, false, true, true, Intrinsics::inlineAsZero),//TODO support free STD_ASSERT(List.of("__assert_fail", "__assert_rtn"), false, false, false, true, Intrinsics::inlineAssert), STD_EXIT("exit", false, false, false, true, Intrinsics::inlineExit), @@ -208,16 +257,20 @@ private interface Replacer { private void markIntrinsics(Program program) { declareNondetBool(program); + final var missingSymbols = new TreeSet(); for (Function func : program.getFunctions()) { if (!func.hasBody()) { final String funcName = func.getName(); - final Info intrinsicsInfo = Arrays.stream(Info.values()) + Arrays.stream(Info.values()) .filter(info -> info.matches(funcName)) .findFirst() - .orElseThrow(() -> new UnsupportedOperationException("Unknown intrinsic function " + funcName)); - func.setIntrinsicInfo(intrinsicsInfo); + .ifPresentOrElse(func::setIntrinsicInfo, () -> missingSymbols.add(funcName)); } } + if (!missingSymbols.isEmpty()) { + throw new UnsupportedOperationException( + missingSymbols.stream().collect(Collectors.joining(", ", "Unknown intrinsics ", ""))); + } } private void declareNondetBool(Program program) { @@ -318,6 +371,155 @@ private List inlineAtomicEnd(FunctionCall ignored) { return List.of(EventFactory.Svcomp.newEndAtomic(checkNotNull(currentAtomicBegin))); } + private List inlinePthreadCondInit(FunctionCall call) { + checkValueAndArguments(2, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression address = call.getArguments().get(0); + //final Expression attributes = call.getArguments().get(1); + final Expression initializedState = expressions.makeZero(types.getArchType()); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.newStore(address, initializedState)); + } + + private List inlinePthreadCondDestroy(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression address = call.getArguments().get(0); + final Expression finalizedState = expressions.makeZero(types.getArchType()); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.newStore(address, finalizedState)); + } + + private List inlinePthreadCondSignal(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression address = call.getArguments().get(0); + final Expression one = expressions.makeOne(types.getArchType()); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + // Relaxed, since this operation is to be guarded by a mutex. + EventFactory.Atomic.newStore(address, one, Tag.C11.MO_RELAXED)); + } + + private List inlinePthreadCondBroadcast(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression address = call.getArguments().get(0); + final var threadCount = new INonDet(constantId++, types.getArchType(), true); + threadCount.setMin(BigInteger.ZERO); + call.getFunction().getProgram().addConstant(threadCount); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + // Relaxed, since this operation is to be guarded by a mutex. + EventFactory.Atomic.newStore(address, threadCount, Tag.C11.MO_RELAXED)); + } + + private List inlinePthreadCondWait(FunctionCall call) { + checkValueAndArguments(2, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression address = call.getArguments().get(0); + final Expression lock = call.getArguments().get(1); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Expression zero = expressions.makeZero(types.getArchType()); + final Expression minusOne = expressions.makeValue(BigInteger.ONE.negate(), types.getArchType()); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + // Allow other threads to access the condition variable. + EventFactory.Pthread.newUnlock(lock.toString(), lock), + // Wait for signal or broadcast. + EventFactory.Atomic.newFADD(dummy, address, minusOne, Tag.C11.MO_RELAXED), + EventFactory.newAbortIf(expressions.makeGT(dummy, zero, true)), + // Wait for all waiters to be notified of a broadcast. If signal, wait for itself. + // Subsequent waits cannot be notified by the same broadcast event. + EventFactory.Atomic.newLoad(dummy, address, Tag.C11.MO_RELAXED), + EventFactory.newAbortIf(expressions.makeEQ(dummy, zero)), + // Re-lock. + EventFactory.Pthread.newLock(lock.toString(), lock)); + } + + private List inlinePthreadCondTimedwait(FunctionCall call) { + checkValueAndArguments(3, call); + final Expression address = call.getArguments().get(0); + final Expression lock = call.getArguments().get(1); + //final Expression timespec = call.getArguments().get(2); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Label label = EventFactory.newLabel("__VERIFIER_pthread_cond_timedwait_end"); + final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); + call.getFunction().getProgram().addConstant(error); + final Expression zero = expressions.makeGeneralZero(result.getType()); + final Expression minusOne = expressions.makeValue(BigInteger.ONE.negate(), types.getArchType()); + return List.of( + // Allow other threads to access the condition variable. + EventFactory.Pthread.newUnlock(lock.toString(), lock), + // Decide success + //TODO proper error code: ETIMEDOUT + EventFactory.newLocal(result, error), + EventFactory.newJump(expressions.makeNEQ(error, zero), label), + // Wait for signal or broadcast. + EventFactory.Atomic.newFADD(dummy, address, minusOne, Tag.C11.MO_RELAXED), + EventFactory.newAbortIf(expressions.makeGT(dummy, zero, true)), + // Wait for all waiters to be notified of a broadcast. If signal, wait for itself. + // Subsequent waits cannot be notified by the same broadcast event. + EventFactory.Atomic.newLoad(dummy, address, Tag.C11.MO_RELAXED), + EventFactory.newAbortIf(expressions.makeEQ(dummy, zero)), + // Join branches + label, + // Re-lock. + EventFactory.Pthread.newLock(lock.toString(), lock)); + } + + private List inlinePthreadKeyCreate(FunctionCall call) { + checkValueAndArguments(2, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression key = call.getArguments().get(0); + final Expression destructor = call.getArguments().get(1); + final Program program = call.getFunction().getProgram(); + final int threadCount = program.getThreads().size(); + final int pointerBytes = types.getMemorySizeInBytes(types.getPointerType()); + final MemoryObject object = program.getMemory().allocate((threadCount + 1) * pointerBytes, false); + final BigInteger destructorOffsetValue = BigInteger.valueOf((long) threadCount * pointerBytes); + final Expression destructorOffset = expressions.makeValue(destructorOffsetValue, types.getArchType()); + //TODO call destructor at each thread's normal exit + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.newStore(key, object), + EventFactory.newStore(expressions.makeADD(object, destructorOffset), destructor)); + } + + private List inlinePthreadKeyDelete(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + //final Expression key = call.getArguments().get(0); + //final int threadID = call.getThread().getId(); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + } + + private List inlinePthreadGetSpecific(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression key = call.getArguments().get(0); + final int threadID = call.getThread().getId(); + final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); + return List.of( + EventFactory.newLoad(result, expressions.makeADD(key, offset))); + } + + private List inlinePthreadSetSpecific(FunctionCall call) { + checkValueAndArguments(2, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression key = call.getArguments().get(0); + final Expression value = call.getArguments().get(1); + final int threadID = call.getThread().getId(); + final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.newStore(expressions.makeADD(key, offset), value)); + } + private List inlinePthreadMutexInit(FunctionCall call) { checkArgument(call.getArguments().size() == 2); final Expression lockAddress = call.getArguments().get(0); @@ -339,6 +541,23 @@ private List inlinePthreadMutexLock(FunctionCall call) { return List.of(EventFactory.Pthread.newLock(lockName, lockAddress)); } + private List inlinePthreadMutexTryLock(FunctionCall call) { + checkArgument(call.getArguments().size() == 1, "Wrong parameter list for \"%s\"", call); + checkArgument(call instanceof ValueFunctionCall, "No support for discarding \"%s\"", call); + final Register register = ((ValueFunctionCall) call).getResultRegister(); + checkArgument(register.getType() instanceof IntegerType, "Wrong return type for \"%s\"", call); + final var error = new INonDet(constantId++, (IntegerType) register.getType(), true); + call.getFunction().getProgram().addConstant(error); + final Label label = EventFactory.newLabel("__VERIFIER_trylock_join"); + final Expression lockAddress = call.getArguments().get(0); + final String lockName = lockAddress.toString(); + return List.of( + EventFactory.newLocal(register, error), + EventFactory.newJump(expressions.makeBooleanCast(error), label), + EventFactory.Pthread.newLock(lockName, lockAddress), + label); + } + private List inlinePthreadMutexUnlock(FunctionCall call) { checkArgument(call.getArguments().size() == 1); final Expression lockAddress = call.getArguments().get(0); @@ -346,6 +565,134 @@ private List inlinePthreadMutexUnlock(FunctionCall call) { return List.of(EventFactory.Pthread.newUnlock(lockName, lockAddress)); } + private List inlinePthreadRwlockInit(FunctionCall call) { + checkValueAndArguments(2, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression lock = call.getArguments().get(0); + //final Expression attributes = call.getArguments().get(1); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.newStore(lock, expressions.makeZero(types.getArchType())) + ); + } + + private List inlinePthreadRwlockDestroy(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + return List.of(EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + } + + private List inlinePthreadRwlockWrlock(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression lock = call.getArguments().get(0); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Expression zero = expressions.makeZero(types.getArchType()); + final Expression one = expressions.makeOne(types.getArchType()); + final var replacement = new INonDet(constantId++, types.getArchType(), true); + call.getFunction().getProgram().addConstant(replacement); + final Expression locked = expressions.makeNEQ(dummy, zero); + final Expression properReplacement = expressions.makeConditional(locked, dummy, one); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + // Try to lock + EventFactory.Atomic.newExchange(dummy, lock, replacement, Tag.C11.MO_ACQUIRE), + // Store one (write-locked) only if successful, else leave unchanged + EventFactory.newAssume(expressions.makeEQ(replacement, properReplacement)), + // Deadlock if violation occurs in another thread + EventFactory.newAbortIf(locked)); + } + + private List inlinePthreadRwlockTryWrlock(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Expression lock = call.getArguments().get(0); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); + call.getFunction().getProgram().addConstant(error); + final Expression zero = expressions.makeZero(types.getArchType()); + final Expression one = expressions.makeOne(types.getArchType()); + //TODO this implementation can fail spontaneously + final Label label = EventFactory.newLabel("__VERIFIER_pthread_rwlock_trywrlock_end"); + return List.of( + EventFactory.newLocal(result, error), + // Decide whether this operation succeeds + EventFactory.newJump(expressions.makeNEQ(error, expressions.makeGeneralZero(result.getType())), label), + // Lock + EventFactory.Atomic.newExchange(dummy, lock, one, Tag.C11.MO_ACQUIRE), + // Guaranteed success in this branch + EventFactory.newAssume(expressions.makeEQ(dummy, zero)), + // Join paths + label); + } + + private List inlinePthreadRwlockRdlock(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Expression lock = call.getArguments().get(0); + final var increment = new INonDet(constantId++, types.getArchType(), true); + call.getFunction().getProgram().addConstant(increment); + final Expression zero = expressions.makeZero(types.getArchType()); + final Expression one = expressions.makeOne(types.getArchType()); + final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); + final Expression firstReader = expressions.makeEQ(dummy, zero); + final Expression properIncrement = expressions.makeConditional(firstReader, two, one); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + // Increment shared counter only if not locked by writer. + EventFactory.Atomic.newFADD(dummy, lock, increment, Tag.C11.MO_ACQUIRE), + // Deadlock if a violation occurred in another thread. In this case, lock value was not changed + EventFactory.newAbortIf(expressions.makeEQ(increment, zero)), + // On success, lock cannot have been write-locked. + EventFactory.newAssume(expressions.makeNEQ(dummy, one)), + // On success, incremented by two, if first reader, else one. + EventFactory.newAssume(expressions.makeEQ(increment, properIncrement))); + } + + private List inlinePthreadRwlockTryRdlock(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Expression lock = call.getArguments().get(0); + final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); + call.getFunction().getProgram().addConstant(error); + final var increment = new INonDet(constantId++, types.getArchType(), true); + call.getFunction().getProgram().addConstant(increment); + final Expression zero = expressions.makeZero(types.getArchType()); + final Expression one = expressions.makeOne(types.getArchType()); + final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); + final Expression writeLocked = expressions.makeEQ(dummy, one); + final Expression firstReader = expressions.makeEQ(dummy, zero); + final Expression properIncrement = expressions.makeConditional(writeLocked, zero, + expressions.makeConditional(firstReader, two, one)); + final Expression success = expressions.makeGeneralZero(result.getType()); + return List.of( + EventFactory.newLocal(result, error), + // increment shared counter only if not locked by writer. + EventFactory.Atomic.newFADD(dummy, lock, increment, Tag.C11.MO_ACQUIRE), + EventFactory.newAssume(expressions.makeNEQ(writeLocked, expressions.makeEQ(error, success))), + EventFactory.newAssume(expressions.makeEQ(increment, properIncrement))); + } + + private List inlinePthreadRwlockUnlock(FunctionCall call) { + checkValueAndArguments(1, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Expression lock = call.getArguments().get(0); + final var decrement = new INonDet(constantId++, types.getArchType(), true); + call.getFunction().getProgram().addConstant(decrement); + final Expression minusTwo = expressions.makeValue(BigInteger.valueOf(-2), types.getArchType()); + final Expression minusOne = expressions.makeValue(BigInteger.valueOf(-1), types.getArchType()); + final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); + final Expression lastReader = expressions.makeEQ(dummy, two); + final Expression properDecrement = expressions.makeConditional(lastReader, minusTwo, minusOne); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.Atomic.newFADD(dummy, lock, decrement, Tag.C11.MO_RELEASE), + EventFactory.newAssume(expressions.makeEQ(decrement, properDecrement))); + } + private List inlineMalloc(FunctionCall call) { if (call.getArguments().size() != 1) { throw new UnsupportedOperationException(String.format("Unsupported signature for %s.", call)); @@ -359,6 +706,18 @@ private List inlineMalloc(FunctionCall call) { )); } + private List inlineCalloc(FunctionCall call) { + checkArgument(call.getArguments().size() == 2, "Unsupported signature for %s", call); + checkArgument(call instanceof ValueFunctionCall, "No support for discarded result of %s", call); + final ValueFunctionCall valueCall = (ValueFunctionCall) call; + return List.of(EventFactory.newAlloc( + valueCall.getResultRegister(), + TypeFactory.getInstance().getByteType(), + expressions.makeMUL(valueCall.getArguments().get(0), valueCall.getArguments().get(1)), + true + )); + } + private List inlineAssert(FunctionCall call) { ExpressionFactory expressions = ExpressionFactory.getInstance(); final Expression condition = expressions.makeFalse(); @@ -812,4 +1171,38 @@ private List inlineMemSet(FunctionCall call) { return replacement; } + private List inlineStrcpy(FunctionCall call, boolean returnEnd, boolean numberProvided) { + checkValueAndArguments(numberProvided ? 3 : 2, call); + final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register offset = call.getFunction().newRegister(types.getArchType()); + final Register dummy = call.getFunction().newRegister(types.getByteType()); + final Expression destination = call.getArguments().get(0); + final Expression source = call.getArguments().get(1); + final Expression number = numberProvided ? call.getArguments().get(2) : null; + final Expression numberCheck = numberProvided ? expressions.makeEQ(offset, number) : expressions.makeFalse(); + // This implementation is a simple byte-by-byte copy loop. + final Label loop = EventFactory.newLabel("__VERIFIER_strcpy_loop"); + final Label end = EventFactory.newLabel("__VERIFIER_strcpy_end"); + return List.of( + EventFactory.newLocal(offset, expressions.makeZero(types.getArchType())), + loop, + // If bound is reached, break + EventFactory.newJump(numberCheck, end), + // Copy one byte + EventFactory.newLoad(dummy, expressions.makeADD(source, offset)), + EventFactory.newStore(expressions.makeADD(destination, offset), dummy), + // Break on '\0' + EventFactory.newJump(expressions.makeEQ(dummy, expressions.makeZero(types.getByteType())), end), + // Increase offset + EventFactory.newLocal(offset, expressions.makeADD(offset, expressions.makeOne(types.getArchType()))), + // Continue + EventFactory.newGoto(loop), + end, + EventFactory.newLocal(result, returnEnd ? expressions.makeADD(destination, offset) : destination)); + } + + private void checkValueAndArguments(int expectedArgumentCount, FunctionCall call) { + checkArgument(call.getArguments().size() == expectedArgumentCount && call instanceof ValueFunctionCall, + "Wrong function type at %s", call); + } } From 48c9728ba7fdb51b36a49bb1dfa22b90985dbac9 Mon Sep 17 00:00:00 2001 From: Hernan Ponce de Leon Date: Sat, 18 Nov 2023 17:18:20 +0100 Subject: [PATCH 02/21] Disable strcpy intrinsics --- .../dat3m/dartagnan/program/processing/Intrinsics.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index ba95f1419c..810ca2d1b0 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -183,10 +183,10 @@ public enum Info { STD_MEMCPY("memcpy", true, true, true, false, Intrinsics::inlineMemCpy), STD_MEMSET(List.of("memset", "__memset_chk"), true, false, true, false, Intrinsics::inlineMemSet), STD_MEMCMP("memcmp", false, true, true, false, Intrinsics::inlineMemCmp), - STD_STRCPY("strcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, false)), - STD_STPCPY("stpcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, false)), - STD_STRNCPY("strncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, true)), - STD_STPNCPY("stpncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, true)), + // STD_STRCPY("strcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, false)), + // STD_STPCPY("stpcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, false)), + // STD_STRNCPY("strncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, true)), + // STD_STPNCPY("stpncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, true)), STD_MALLOC("malloc", false, false, true, true, Intrinsics::inlineMalloc), STD_CALLOC("calloc", false, false, true, true, Intrinsics::inlineCalloc), STD_FREE("free", true, false, true, true, Intrinsics::inlineAsZero),//TODO support free From 5558326fd8133581bb9248fca467f3d6942bce7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 20 Nov 2023 15:09:45 +0100 Subject: [PATCH 03/21] pthread_mutex_init initializes unlocked mutexes --- .../com/dat3m/dartagnan/program/event/EventFactory.java | 6 ++++-- .../com/dat3m/dartagnan/program/processing/Intrinsics.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java index d8d10193a1..6fcab18b61 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java @@ -7,6 +7,7 @@ import com.dat3m.dartagnan.expression.type.FunctionType; import com.dat3m.dartagnan.expression.type.IntegerType; import com.dat3m.dartagnan.expression.type.Type; +import com.dat3m.dartagnan.expression.type.TypeFactory; import com.dat3m.dartagnan.program.Function; import com.dat3m.dartagnan.program.Register; import com.dat3m.dartagnan.program.event.arch.StoreExclusive; @@ -317,8 +318,9 @@ public static class Pthread { private Pthread() { } - public static InitLock newInitLock(String name, Expression address, Expression value) { - return new InitLock(name, address, value); + public static InitLock newInitLock(String name, Expression address, Expression ignoreAttributes) { + //TODO store attributes inside mutex object + return new InitLock(name, address, expressions.makeZero(TypeFactory.getInstance().getArchType())); } public static Lock newLock(String name, Expression address) { diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 810ca2d1b0..1c594b2048 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -523,9 +523,9 @@ private List inlinePthreadSetSpecific(FunctionCall call) { private List inlinePthreadMutexInit(FunctionCall call) { checkArgument(call.getArguments().size() == 2); final Expression lockAddress = call.getArguments().get(0); - final Expression lockValue = call.getArguments().get(1); + final Expression attributes = call.getArguments().get(1); final String lockName = lockAddress.toString(); - return List.of(EventFactory.Pthread.newInitLock(lockName, lockAddress, lockValue)); + return List.of(EventFactory.Pthread.newInitLock(lockName, lockAddress, attributes)); } private List inlinePthreadMutexDestroy(FunctionCall call) { From e98d35d2fda1a23a60568614e8d2ab581ecb1bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 20 Nov 2023 15:46:58 +0100 Subject: [PATCH 04/21] Define return value of pthread_mutex_* --- .../program/processing/Intrinsics.java | 85 ++++++++----------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 1c594b2048..56010e06e3 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -372,8 +372,7 @@ private List inlineAtomicEnd(FunctionCall ignored) { } private List inlinePthreadCondInit(FunctionCall call) { - checkValueAndArguments(2, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(2, call); final Expression address = call.getArguments().get(0); //final Expression attributes = call.getArguments().get(1); final Expression initializedState = expressions.makeZero(types.getArchType()); @@ -383,8 +382,7 @@ private List inlinePthreadCondInit(FunctionCall call) { } private List inlinePthreadCondDestroy(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Expression address = call.getArguments().get(0); final Expression finalizedState = expressions.makeZero(types.getArchType()); return List.of( @@ -393,8 +391,7 @@ private List inlinePthreadCondDestroy(FunctionCall call) { } private List inlinePthreadCondSignal(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Expression address = call.getArguments().get(0); final Expression one = expressions.makeOne(types.getArchType()); return List.of( @@ -404,8 +401,7 @@ private List inlinePthreadCondSignal(FunctionCall call) { } private List inlinePthreadCondBroadcast(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Expression address = call.getArguments().get(0); final var threadCount = new INonDet(constantId++, types.getArchType(), true); threadCount.setMin(BigInteger.ZERO); @@ -417,8 +413,7 @@ private List inlinePthreadCondBroadcast(FunctionCall call) { } private List inlinePthreadCondWait(FunctionCall call) { - checkValueAndArguments(2, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(2, call); final Expression address = call.getArguments().get(0); final Expression lock = call.getArguments().get(1); final Register dummy = call.getFunction().newRegister(types.getArchType()); @@ -440,11 +435,10 @@ private List inlinePthreadCondWait(FunctionCall call) { } private List inlinePthreadCondTimedwait(FunctionCall call) { - checkValueAndArguments(3, call); + final Register result = checkValueAndArguments(3, call); final Expression address = call.getArguments().get(0); final Expression lock = call.getArguments().get(1); //final Expression timespec = call.getArguments().get(2); - final Register result = ((ValueFunctionCall) call).getResultRegister(); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Label label = EventFactory.newLabel("__VERIFIER_pthread_cond_timedwait_end"); final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); @@ -472,8 +466,7 @@ private List inlinePthreadCondTimedwait(FunctionCall call) { } private List inlinePthreadKeyCreate(FunctionCall call) { - checkValueAndArguments(2, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(2, call); final Expression key = call.getArguments().get(0); final Expression destructor = call.getArguments().get(1); final Program program = call.getFunction().getProgram(); @@ -490,8 +483,7 @@ private List inlinePthreadKeyCreate(FunctionCall call) { } private List inlinePthreadKeyDelete(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); //final Expression key = call.getArguments().get(0); //final int threadID = call.getThread().getId(); return List.of( @@ -499,8 +491,7 @@ private List inlinePthreadKeyDelete(FunctionCall call) { } private List inlinePthreadGetSpecific(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Expression key = call.getArguments().get(0); final int threadID = call.getThread().getId(); final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); @@ -509,8 +500,7 @@ private List inlinePthreadGetSpecific(FunctionCall call) { } private List inlinePthreadSetSpecific(FunctionCall call) { - checkValueAndArguments(2, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(2, call); final Expression key = call.getArguments().get(0); final Expression value = call.getArguments().get(1); final int threadID = call.getThread().getId(); @@ -521,30 +511,32 @@ private List inlinePthreadSetSpecific(FunctionCall call) { } private List inlinePthreadMutexInit(FunctionCall call) { - checkArgument(call.getArguments().size() == 2); + final Register result = checkValueAndArguments(2, call); final Expression lockAddress = call.getArguments().get(0); final Expression attributes = call.getArguments().get(1); final String lockName = lockAddress.toString(); - return List.of(EventFactory.Pthread.newInitLock(lockName, lockAddress, attributes)); + return List.of( + EventFactory.Pthread.newInitLock(lockName, lockAddress, attributes), + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); } private List inlinePthreadMutexDestroy(FunctionCall call) { - checkArgument(call.getArguments().size() == 1); - final Register reg = ((ValueFunctionCall) call).getResultRegister(); - return List.of(EventFactory.newLocal(reg, expressions.makeZero((IntegerType) reg.getType()))); + final Register result = checkValueAndArguments(1, call); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); } private List inlinePthreadMutexLock(FunctionCall call) { - checkArgument(call.getArguments().size() == 1); + final Register result = checkValueAndArguments(1, call); final Expression lockAddress = call.getArguments().get(0); final String lockName = lockAddress.toString(); - return List.of(EventFactory.Pthread.newLock(lockName, lockAddress)); + return List.of( + EventFactory.Pthread.newLock(lockName, lockAddress), + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); } private List inlinePthreadMutexTryLock(FunctionCall call) { - checkArgument(call.getArguments().size() == 1, "Wrong parameter list for \"%s\"", call); - checkArgument(call instanceof ValueFunctionCall, "No support for discarding \"%s\"", call); - final Register register = ((ValueFunctionCall) call).getResultRegister(); + final Register register = checkValueAndArguments(1, call); checkArgument(register.getType() instanceof IntegerType, "Wrong return type for \"%s\"", call); final var error = new INonDet(constantId++, (IntegerType) register.getType(), true); call.getFunction().getProgram().addConstant(error); @@ -559,15 +551,16 @@ private List inlinePthreadMutexTryLock(FunctionCall call) { } private List inlinePthreadMutexUnlock(FunctionCall call) { - checkArgument(call.getArguments().size() == 1); + final Register result = checkValueAndArguments(1, call); final Expression lockAddress = call.getArguments().get(0); final String lockName = lockAddress.toString(); - return List.of(EventFactory.Pthread.newUnlock(lockName, lockAddress)); + return List.of( + EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), + EventFactory.Pthread.newUnlock(lockName, lockAddress)); } private List inlinePthreadRwlockInit(FunctionCall call) { - checkValueAndArguments(2, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(2, call); final Expression lock = call.getArguments().get(0); //final Expression attributes = call.getArguments().get(1); return List.of( @@ -577,14 +570,12 @@ private List inlinePthreadRwlockInit(FunctionCall call) { } private List inlinePthreadRwlockDestroy(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); return List.of(EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); } private List inlinePthreadRwlockWrlock(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Expression lock = call.getArguments().get(0); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression zero = expressions.makeZero(types.getArchType()); @@ -604,8 +595,7 @@ private List inlinePthreadRwlockWrlock(FunctionCall call) { } private List inlinePthreadRwlockTryWrlock(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Expression lock = call.getArguments().get(0); final Register dummy = call.getFunction().newRegister(types.getArchType()); final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); @@ -627,8 +617,7 @@ private List inlinePthreadRwlockTryWrlock(FunctionCall call) { } private List inlinePthreadRwlockRdlock(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression lock = call.getArguments().get(0); final var increment = new INonDet(constantId++, types.getArchType(), true); @@ -651,8 +640,7 @@ private List inlinePthreadRwlockRdlock(FunctionCall call) { } private List inlinePthreadRwlockTryRdlock(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression lock = call.getArguments().get(0); final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); @@ -676,8 +664,7 @@ private List inlinePthreadRwlockTryRdlock(FunctionCall call) { } private List inlinePthreadRwlockUnlock(FunctionCall call) { - checkValueAndArguments(1, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(1, call); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression lock = call.getArguments().get(0); final var decrement = new INonDet(constantId++, types.getArchType(), true); @@ -1172,8 +1159,7 @@ private List inlineMemSet(FunctionCall call) { } private List inlineStrcpy(FunctionCall call, boolean returnEnd, boolean numberProvided) { - checkValueAndArguments(numberProvided ? 3 : 2, call); - final Register result = ((ValueFunctionCall) call).getResultRegister(); + final Register result = checkValueAndArguments(numberProvided ? 3 : 2, call); final Register offset = call.getFunction().newRegister(types.getArchType()); final Register dummy = call.getFunction().newRegister(types.getByteType()); final Expression destination = call.getArguments().get(0); @@ -1201,8 +1187,9 @@ private List inlineStrcpy(FunctionCall call, boolean returnEnd, boolean n EventFactory.newLocal(result, returnEnd ? expressions.makeADD(destination, offset) : destination)); } - private void checkValueAndArguments(int expectedArgumentCount, FunctionCall call) { + private Register checkValueAndArguments(int expectedArgumentCount, FunctionCall call) { checkArgument(call.getArguments().size() == expectedArgumentCount && call instanceof ValueFunctionCall, "Wrong function type at %s", call); + return ((ValueFunctionCall) call).getResultRegister(); } } From 09cb10862cf59b1416acbeda21f789a09f68a096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 4 Dec 2023 18:30:52 +0100 Subject: [PATCH 05/21] Refactor and add references Fix pthread_cond_wait and pthread_cond_timedwait aborting if a broadcast guessed the right amount of threads to awake --- .../parsers/program/visitors/VisitorLlvm.java | 1 + .../program/processing/Inlining.java | 1 + .../program/processing/Intrinsics.java | 307 ++++++++++-------- 3 files changed, 182 insertions(+), 127 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java index bd95702585..62773e9b90 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java @@ -385,6 +385,7 @@ public Expression visitCallInst(CallInstContext ctx) { if (ctx.inlineAsm() != null) { // see https://llvm.org/docs/LangRef.html#inline-assembler-expressions + //TODO add support form inline assembly //FIXME ignore side effects of inline assembly if (resultRegister != null) { block.events.add(newLocal(resultRegister, makeNonDetOfType(returnType))); diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java index b775876e27..de3b28baa6 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Inlining.java @@ -129,6 +129,7 @@ private static Event inlineBody(FunctionCall call, Snapshot callTarget, int scop var replacementMap = new HashMap(); var registerMap = new HashMap(); final List arguments = call.getArguments(); + //TODO add support for __VA_INIT verify(callTarget.isVarArgs ? arguments.size() >= callTarget.parameters.size() : arguments.size() == callTarget.parameters.size(), "Parameter mismatch at %s", call); // All registers have to be replaced diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 56010e06e3..99bc6b81f2 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -372,101 +372,115 @@ private List inlineAtomicEnd(FunctionCall ignored) { } private List inlinePthreadCondInit(FunctionCall call) { - final Register result = checkValueAndArguments(2, call); - final Expression address = call.getArguments().get(0); + //see https://linux.die.net/man/3/pthread_cond_init + final Register errorRegister = getResultRegisterAndCheckArguments(2, call); + final Expression condAddress = call.getArguments().get(0); //final Expression attributes = call.getArguments().get(1); final Expression initializedState = expressions.makeZero(types.getArchType()); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), - EventFactory.newStore(address, initializedState)); + EventFactory.newStore(condAddress, initializedState), + assignSuccess(errorRegister) + ); } private List inlinePthreadCondDestroy(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - final Expression address = call.getArguments().get(0); + //see https://linux.die.net/man/3/pthread_cond_destroy + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Expression condAddress = call.getArguments().get(0); final Expression finalizedState = expressions.makeZero(types.getArchType()); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), - EventFactory.newStore(address, finalizedState)); + EventFactory.newStore(condAddress, finalizedState), + assignSuccess(errorRegister) + ); } private List inlinePthreadCondSignal(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - final Expression address = call.getArguments().get(0); - final Expression one = expressions.makeOne(types.getArchType()); + //see https://linux.die.net/man/3/pthread_cond_signal + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Expression condAddress = call.getArguments().get(0); + final Expression wakeCount = expressions.makeOne(types.getArchType()); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), // Relaxed, since this operation is to be guarded by a mutex. - EventFactory.Atomic.newStore(address, one, Tag.C11.MO_RELAXED)); + EventFactory.Atomic.newStore(condAddress, wakeCount, Tag.C11.MO_RELAXED), + assignSuccess(errorRegister) + ); } private List inlinePthreadCondBroadcast(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - final Expression address = call.getArguments().get(0); - final var threadCount = new INonDet(constantId++, types.getArchType(), true); - threadCount.setMin(BigInteger.ZERO); - call.getFunction().getProgram().addConstant(threadCount); + //see https://linux.die.net/man/3/pthread_cond_broadcast + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Expression condAddress = call.getArguments().get(0); + final var wakeCount = new INonDet(constantId++, types.getArchType(), true); + wakeCount.setMin(BigInteger.ZERO); + call.getFunction().getProgram().addConstant(wakeCount); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), // Relaxed, since this operation is to be guarded by a mutex. - EventFactory.Atomic.newStore(address, threadCount, Tag.C11.MO_RELAXED)); + EventFactory.Atomic.newStore(condAddress, wakeCount, Tag.C11.MO_RELAXED), + assignSuccess(errorRegister) + ); } private List inlinePthreadCondWait(FunctionCall call) { - final Register result = checkValueAndArguments(2, call); - final Expression address = call.getArguments().get(0); - final Expression lock = call.getArguments().get(1); + //see https://linux.die.net/man/3/pthread_cond_wait + final Register errorRegister = getResultRegisterAndCheckArguments(2, call); + final Expression condAddress = call.getArguments().get(0); + final Expression lockAddress = call.getArguments().get(1); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression zero = expressions.makeZero(types.getArchType()); final Expression minusOne = expressions.makeValue(BigInteger.ONE.negate(), types.getArchType()); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), // Allow other threads to access the condition variable. - EventFactory.Pthread.newUnlock(lock.toString(), lock), + EventFactory.Pthread.newUnlock(lockAddress.toString(), lockAddress), // Wait for signal or broadcast. - EventFactory.Atomic.newFADD(dummy, address, minusOne, Tag.C11.MO_RELAXED), + EventFactory.Atomic.newFADD(dummy, condAddress, minusOne, Tag.C11.MO_RELAXED), EventFactory.newAbortIf(expressions.makeGT(dummy, zero, true)), // Wait for all waiters to be notified of a broadcast. If signal, wait for itself. // Subsequent waits cannot be notified by the same broadcast event. - EventFactory.Atomic.newLoad(dummy, address, Tag.C11.MO_RELAXED), - EventFactory.newAbortIf(expressions.makeEQ(dummy, zero)), + EventFactory.Atomic.newLoad(dummy, condAddress, Tag.C11.MO_RELAXED), + EventFactory.newAbortIf(expressions.makeNEQ(dummy, zero)), // Re-lock. - EventFactory.Pthread.newLock(lock.toString(), lock)); + EventFactory.Pthread.newLock(lockAddress.toString(), lockAddress), + assignSuccess(errorRegister) + ); } private List inlinePthreadCondTimedwait(FunctionCall call) { - final Register result = checkValueAndArguments(3, call); - final Expression address = call.getArguments().get(0); - final Expression lock = call.getArguments().get(1); + //see https://linux.die.net/man/3/pthread_cond_timedwait + final Register errorRegister = getResultRegisterAndCheckArguments(3, call); + final Expression condAddress = call.getArguments().get(0); + final Expression lockAddress = call.getArguments().get(1); //final Expression timespec = call.getArguments().get(2); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Label label = EventFactory.newLabel("__VERIFIER_pthread_cond_timedwait_end"); - final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); - call.getFunction().getProgram().addConstant(error); - final Expression zero = expressions.makeGeneralZero(result.getType()); + final var errorValue = new INonDet(constantId++, (IntegerType) errorRegister.getType(), true); + call.getFunction().getProgram().addConstant(errorValue); + final Expression success = expressions.makeGeneralZero(errorRegister.getType()); + final Expression zero = expressions.makeZero(types.getArchType()); final Expression minusOne = expressions.makeValue(BigInteger.ONE.negate(), types.getArchType()); return List.of( // Allow other threads to access the condition variable. - EventFactory.Pthread.newUnlock(lock.toString(), lock), + EventFactory.Pthread.newUnlock(lockAddress.toString(), lockAddress), // Decide success - //TODO proper error code: ETIMEDOUT - EventFactory.newLocal(result, error), - EventFactory.newJump(expressions.makeNEQ(error, zero), label), + EventFactory.newJump(expressions.makeNEQ(errorValue, success), label), // Wait for signal or broadcast. - EventFactory.Atomic.newFADD(dummy, address, minusOne, Tag.C11.MO_RELAXED), + EventFactory.Atomic.newFADD(dummy, condAddress, minusOne, Tag.C11.MO_RELAXED), EventFactory.newAbortIf(expressions.makeGT(dummy, zero, true)), // Wait for all waiters to be notified of a broadcast. If signal, wait for itself. // Subsequent waits cannot be notified by the same broadcast event. - EventFactory.Atomic.newLoad(dummy, address, Tag.C11.MO_RELAXED), - EventFactory.newAbortIf(expressions.makeEQ(dummy, zero)), + EventFactory.Atomic.newLoad(dummy, condAddress, Tag.C11.MO_RELAXED), + EventFactory.newAbortIf(expressions.makeNEQ(dummy, zero)), // Join branches label, // Re-lock. - EventFactory.Pthread.newLock(lock.toString(), lock)); + EventFactory.Pthread.newLock(lockAddress.toString(), lockAddress), + //TODO proper error code: ETIMEDOUT + EventFactory.newLocal(errorRegister, errorValue) + ); } private List inlinePthreadKeyCreate(FunctionCall call) { - final Register result = checkValueAndArguments(2, call); + //see https://linux.die.net/man/3/pthread_key_create + final Register errorRegister = getResultRegisterAndCheckArguments(2, call); final Expression key = call.getArguments().get(0); final Expression destructor = call.getArguments().get(1); final Program program = call.getFunction().getProgram(); @@ -477,106 +491,134 @@ private List inlinePthreadKeyCreate(FunctionCall call) { final Expression destructorOffset = expressions.makeValue(destructorOffsetValue, types.getArchType()); //TODO call destructor at each thread's normal exit return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), EventFactory.newStore(key, object), - EventFactory.newStore(expressions.makeADD(object, destructorOffset), destructor)); + EventFactory.newStore(expressions.makeADD(object, destructorOffset), destructor), + assignSuccess(errorRegister) + ); } private List inlinePthreadKeyDelete(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_key_delete + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); //final Expression key = call.getArguments().get(0); //final int threadID = call.getThread().getId(); + //TODO the destructor should no longer be called by pthread_exit return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + assignSuccess(errorRegister) + ); } private List inlinePthreadGetSpecific(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_getspecific + final Register result = getResultRegisterAndCheckArguments(1, call); final Expression key = call.getArguments().get(0); final int threadID = call.getThread().getId(); final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); return List.of( - EventFactory.newLoad(result, expressions.makeADD(key, offset))); + EventFactory.newLoad(result, expressions.makeADD(key, offset)) + ); } private List inlinePthreadSetSpecific(FunctionCall call) { - final Register result = checkValueAndArguments(2, call); + //see https://linux.die.net/man/3/pthread_setspecific + final Register errorRegister = getResultRegisterAndCheckArguments(2, call); final Expression key = call.getArguments().get(0); final Expression value = call.getArguments().get(1); final int threadID = call.getThread().getId(); final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), - EventFactory.newStore(expressions.makeADD(key, offset), value)); + EventFactory.newStore(expressions.makeADD(key, offset), value), + assignSuccess(errorRegister) + ); } private List inlinePthreadMutexInit(FunctionCall call) { - final Register result = checkValueAndArguments(2, call); + //see https://linux.die.net/man/3/pthread_mutex_init + final Register errorRegister = getResultRegisterAndCheckArguments(2, call); final Expression lockAddress = call.getArguments().get(0); final Expression attributes = call.getArguments().get(1); final String lockName = lockAddress.toString(); return List.of( EventFactory.Pthread.newInitLock(lockName, lockAddress, attributes), - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + assignSuccess(errorRegister) + ); } private List inlinePthreadMutexDestroy(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_mutex_destroy + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + //TODO store a value such that later uses of the lock fail return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + assignSuccess(errorRegister) + ); } private List inlinePthreadMutexLock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_mutex_lock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Expression lockAddress = call.getArguments().get(0); final String lockName = lockAddress.toString(); return List.of( EventFactory.Pthread.newLock(lockName, lockAddress), - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + assignSuccess(errorRegister) + ); } private List inlinePthreadMutexTryLock(FunctionCall call) { - final Register register = checkValueAndArguments(1, call); - checkArgument(register.getType() instanceof IntegerType, "Wrong return type for \"%s\"", call); - final var error = new INonDet(constantId++, (IntegerType) register.getType(), true); - call.getFunction().getProgram().addConstant(error); - final Label label = EventFactory.newLabel("__VERIFIER_trylock_join"); + //see https://linux.die.net/man/3/pthread_mutex_trylock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + checkArgument(errorRegister.getType() instanceof IntegerType, "Wrong return type for \"%s\"", call); + final Register oldValueRegister = call.getFunction().newRegister(types.getBooleanType()); + final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final Expression lockAddress = call.getArguments().get(0); - final String lockName = lockAddress.toString(); + final Expression locked = expressions.makeTrue(); + final Expression unlocked = expressions.makeFalse(); + final Expression fail = expressions.makeNot(successRegister); return List.of( - EventFactory.newLocal(register, error), - EventFactory.newJump(expressions.makeBooleanCast(error), label), - EventFactory.Pthread.newLock(lockName, lockAddress), - label); + EventFactory.Llvm.newCompareExchange(oldValueRegister, successRegister, lockAddress, unlocked, locked, Tag.C11.MO_ACQUIRE), + EventFactory.newLocal(errorRegister, expressions.makeCast(fail, errorRegister.getType())) + ); } private List inlinePthreadMutexUnlock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_mutex_unlock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Expression lockAddress = call.getArguments().get(0); final String lockName = lockAddress.toString(); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), - EventFactory.Pthread.newUnlock(lockName, lockAddress)); + EventFactory.Pthread.newUnlock(lockName, lockAddress), + assignSuccess(errorRegister) + ); } private List inlinePthreadRwlockInit(FunctionCall call) { - final Register result = checkValueAndArguments(2, call); - final Expression lock = call.getArguments().get(0); + //see https://linux.die.net/man/3/pthread_rwlock_init + final Register errorRegister = getResultRegisterAndCheckArguments(2, call); + final Expression lockAddress = call.getArguments().get(0); //final Expression attributes = call.getArguments().get(1); + final Expression unlocked = expressions.makeZero(types.getArchType()); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), - EventFactory.newStore(lock, expressions.makeZero(types.getArchType())) + EventFactory.newStore(lockAddress, unlocked), + assignSuccess(errorRegister) ); } private List inlinePthreadRwlockDestroy(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - return List.of(EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType()))); + //see https://linux.die.net/man/3/pthread_rwlock_destroy + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + //TODO store a value such that later uses of the lock fail + //final Expression lock = call.getArguments().get(0); + //final Expression finalizedValue = expressions.makeZero(types.getArchType()); + return List.of( + //EventFactory.newStore(lock, finalizedValue) + assignSuccess(errorRegister) + ); } private List inlinePthreadRwlockWrlock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - final Expression lock = call.getArguments().get(0); + //see https://linux.die.net/man/3/pthread_rwlock_wrlock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Expression lockAddress = call.getArguments().get(0); final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression zero = expressions.makeZero(types.getArchType()); final Expression one = expressions.makeOne(types.getArchType()); @@ -585,88 +627,84 @@ private List inlinePthreadRwlockWrlock(FunctionCall call) { final Expression locked = expressions.makeNEQ(dummy, zero); final Expression properReplacement = expressions.makeConditional(locked, dummy, one); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), // Try to lock - EventFactory.Atomic.newExchange(dummy, lock, replacement, Tag.C11.MO_ACQUIRE), + EventFactory.Atomic.newExchange(dummy, lockAddress, replacement, Tag.C11.MO_ACQUIRE), // Store one (write-locked) only if successful, else leave unchanged EventFactory.newAssume(expressions.makeEQ(replacement, properReplacement)), // Deadlock if violation occurs in another thread - EventFactory.newAbortIf(locked)); + EventFactory.newAbortIf(locked), + assignSuccess(errorRegister) + ); } private List inlinePthreadRwlockTryWrlock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - final Expression lock = call.getArguments().get(0); + //see https://linux.die.net/man/3/pthread_rwlock_trywrlock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Expression lockAddress = call.getArguments().get(0); final Register dummy = call.getFunction().newRegister(types.getArchType()); - final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); + final var error = new INonDet(constantId++, (IntegerType) errorRegister.getType(), true); call.getFunction().getProgram().addConstant(error); final Expression zero = expressions.makeZero(types.getArchType()); final Expression one = expressions.makeOne(types.getArchType()); + final Expression success = expressions.makeGeneralZero(errorRegister.getType()); //TODO this implementation can fail spontaneously final Label label = EventFactory.newLabel("__VERIFIER_pthread_rwlock_trywrlock_end"); return List.of( - EventFactory.newLocal(result, error), // Decide whether this operation succeeds - EventFactory.newJump(expressions.makeNEQ(error, expressions.makeGeneralZero(result.getType())), label), + EventFactory.newJump(expressions.makeNEQ(error, success), label), // Lock - EventFactory.Atomic.newExchange(dummy, lock, one, Tag.C11.MO_ACQUIRE), + EventFactory.Atomic.newExchange(dummy, lockAddress, one, Tag.C11.MO_ACQUIRE), // Guaranteed success in this branch EventFactory.newAssume(expressions.makeEQ(dummy, zero)), // Join paths - label); + label, + EventFactory.newLocal(errorRegister, error) + ); } private List inlinePthreadRwlockRdlock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_rwlock_rdlock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Register dummy = call.getFunction().newRegister(types.getArchType()); - final Expression lock = call.getArguments().get(0); + final Expression lockAddress = call.getArguments().get(0); final var increment = new INonDet(constantId++, types.getArchType(), true); call.getFunction().getProgram().addConstant(increment); - final Expression zero = expressions.makeZero(types.getArchType()); + final Expression unlocked = expressions.makeZero(types.getArchType()); + final Expression wrLocked = expressions.makeOne(types.getArchType()); final Expression one = expressions.makeOne(types.getArchType()); final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); - final Expression firstReader = expressions.makeEQ(dummy, zero); + final Expression firstReader = expressions.makeEQ(dummy, unlocked); final Expression properIncrement = expressions.makeConditional(firstReader, two, one); return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), // Increment shared counter only if not locked by writer. - EventFactory.Atomic.newFADD(dummy, lock, increment, Tag.C11.MO_ACQUIRE), + EventFactory.Atomic.newFADD(dummy, lockAddress, increment, Tag.C11.MO_ACQUIRE), // Deadlock if a violation occurred in another thread. In this case, lock value was not changed - EventFactory.newAbortIf(expressions.makeEQ(increment, zero)), + EventFactory.newAbortIf(expressions.makeEQ(increment, unlocked)), // On success, lock cannot have been write-locked. - EventFactory.newAssume(expressions.makeNEQ(dummy, one)), + EventFactory.newAssume(expressions.makeNEQ(dummy, wrLocked)), // On success, incremented by two, if first reader, else one. - EventFactory.newAssume(expressions.makeEQ(increment, properIncrement))); + EventFactory.newAssume(expressions.makeEQ(increment, properIncrement)), + assignSuccess(errorRegister) + ); } private List inlinePthreadRwlockTryRdlock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); - final Register dummy = call.getFunction().newRegister(types.getArchType()); - final Expression lock = call.getArguments().get(0); - final var error = new INonDet(constantId++, (IntegerType) result.getType(), true); - call.getFunction().getProgram().addConstant(error); - final var increment = new INonDet(constantId++, types.getArchType(), true); - call.getFunction().getProgram().addConstant(increment); - final Expression zero = expressions.makeZero(types.getArchType()); - final Expression one = expressions.makeOne(types.getArchType()); - final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); - final Expression writeLocked = expressions.makeEQ(dummy, one); - final Expression firstReader = expressions.makeEQ(dummy, zero); - final Expression properIncrement = expressions.makeConditional(writeLocked, zero, - expressions.makeConditional(firstReader, two, one)); - final Expression success = expressions.makeGeneralZero(result.getType()); + //see https://linux.die.net/man/3/pthread_rwlock_tryrdlock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Expression lockAddress = call.getArguments().get(0); + final Expression unlocked = expressions.makeZero(types.getArchType()); + final Expression locked = expressions.makeOne(types.getArchType()); return List.of( - EventFactory.newLocal(result, error), // increment shared counter only if not locked by writer. - EventFactory.Atomic.newFADD(dummy, lock, increment, Tag.C11.MO_ACQUIRE), - EventFactory.newAssume(expressions.makeNEQ(writeLocked, expressions.makeEQ(error, success))), - EventFactory.newAssume(expressions.makeEQ(increment, properIncrement))); + EventFactory.Atomic.newCompareExchange(errorRegister, lockAddress, unlocked, locked, Tag.C11.MO_ACQUIRE) + ); } private List inlinePthreadRwlockUnlock(FunctionCall call) { - final Register result = checkValueAndArguments(1, call); + //see https://linux.die.net/man/3/pthread_rwlock_unlock + final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Register dummy = call.getFunction().newRegister(types.getArchType()); - final Expression lock = call.getArguments().get(0); + final Expression lockAddress = call.getArguments().get(0); final var decrement = new INonDet(constantId++, types.getArchType(), true); call.getFunction().getProgram().addConstant(decrement); final Expression minusTwo = expressions.makeValue(BigInteger.valueOf(-2), types.getArchType()); @@ -674,10 +712,13 @@ private List inlinePthreadRwlockUnlock(FunctionCall call) { final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); final Expression lastReader = expressions.makeEQ(dummy, two); final Expression properDecrement = expressions.makeConditional(lastReader, minusTwo, minusOne); + //TODO does not recognize whether the calling thread is allowed to unlock return List.of( - EventFactory.newLocal(result, expressions.makeGeneralZero(result.getType())), - EventFactory.Atomic.newFADD(dummy, lock, decrement, Tag.C11.MO_RELEASE), - EventFactory.newAssume(expressions.makeEQ(decrement, properDecrement))); + // decreases the lock value by 1, if not the last reader, or else 2. + EventFactory.Atomic.newFADD(dummy, lockAddress, decrement, Tag.C11.MO_RELEASE), + EventFactory.newAssume(expressions.makeEQ(decrement, properDecrement)), + assignSuccess(errorRegister) + ); } private List inlineMalloc(FunctionCall call) { @@ -1159,7 +1200,7 @@ private List inlineMemSet(FunctionCall call) { } private List inlineStrcpy(FunctionCall call, boolean returnEnd, boolean numberProvided) { - final Register result = checkValueAndArguments(numberProvided ? 3 : 2, call); + final Register result = getResultRegisterAndCheckArguments(numberProvided ? 3 : 2, call); final Register offset = call.getFunction().newRegister(types.getArchType()); final Register dummy = call.getFunction().newRegister(types.getByteType()); final Expression destination = call.getArguments().get(0); @@ -1187,9 +1228,21 @@ private List inlineStrcpy(FunctionCall call, boolean returnEnd, boolean n EventFactory.newLocal(result, returnEnd ? expressions.makeADD(destination, offset) : destination)); } - private Register checkValueAndArguments(int expectedArgumentCount, FunctionCall call) { - checkArgument(call.getArguments().size() == expectedArgumentCount && call instanceof ValueFunctionCall, - "Wrong function type at %s", call); + private Event assignSuccess(Register errorRegister) { + return EventFactory.newLocal(errorRegister, expressions.makeGeneralZero(errorRegister.getType())); + } + + private Register getResultRegisterAndCheckArguments(int expectedArgumentCount, FunctionCall call) { + checkArguments(expectedArgumentCount, call); + return getResultRegister(call); + } + + private void checkArguments(int expectedArgumentCount, FunctionCall call) { + checkArgument(call.getArguments().size() == expectedArgumentCount, "Wrong function type at %s", call); + } + + private Register getResultRegister(FunctionCall call) { + checkArgument(call instanceof ValueFunctionCall, "Unexpected value discard at intrinsic \"%s\"", call); return ((ValueFunctionCall) call).getResultRegister(); } } From ee0873db1f40b08687bc7fb9ce005f0b0b82ae6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Tue, 5 Dec 2023 15:24:56 +0100 Subject: [PATCH 06/21] Add spurious wake-ups to pthread_cond_wait --- .../program/processing/Intrinsics.java | 54 ++++--------------- 1 file changed, 10 insertions(+), 44 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 99bc6b81f2..3142961c15 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -376,7 +376,7 @@ private List inlinePthreadCondInit(FunctionCall call) { final Register errorRegister = getResultRegisterAndCheckArguments(2, call); final Expression condAddress = call.getArguments().get(0); //final Expression attributes = call.getArguments().get(1); - final Expression initializedState = expressions.makeZero(types.getArchType()); + final Expression initializedState = expressions.makeTrue(); return List.of( EventFactory.newStore(condAddress, initializedState), assignSuccess(errorRegister) @@ -387,7 +387,7 @@ private List inlinePthreadCondDestroy(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_destroy final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Expression condAddress = call.getArguments().get(0); - final Expression finalizedState = expressions.makeZero(types.getArchType()); + final Expression finalizedState = expressions.makeFalse(); return List.of( EventFactory.newStore(condAddress, finalizedState), assignSuccess(errorRegister) @@ -396,48 +396,28 @@ private List inlinePthreadCondDestroy(FunctionCall call) { private List inlinePthreadCondSignal(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_signal + // Because of spurious wake-ups, there is no need to do anything here. final Register errorRegister = getResultRegisterAndCheckArguments(1, call); - final Expression condAddress = call.getArguments().get(0); - final Expression wakeCount = expressions.makeOne(types.getArchType()); + //final Expression condAddress = call.getArguments().get(0); return List.of( - // Relaxed, since this operation is to be guarded by a mutex. - EventFactory.Atomic.newStore(condAddress, wakeCount, Tag.C11.MO_RELAXED), assignSuccess(errorRegister) ); } private List inlinePthreadCondBroadcast(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_broadcast - final Register errorRegister = getResultRegisterAndCheckArguments(1, call); - final Expression condAddress = call.getArguments().get(0); - final var wakeCount = new INonDet(constantId++, types.getArchType(), true); - wakeCount.setMin(BigInteger.ZERO); - call.getFunction().getProgram().addConstant(wakeCount); - return List.of( - // Relaxed, since this operation is to be guarded by a mutex. - EventFactory.Atomic.newStore(condAddress, wakeCount, Tag.C11.MO_RELAXED), - assignSuccess(errorRegister) - ); + return inlinePthreadCondSignal(call); } private List inlinePthreadCondWait(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_wait final Register errorRegister = getResultRegisterAndCheckArguments(2, call); - final Expression condAddress = call.getArguments().get(0); + //final Expression condAddress = call.getArguments().get(0); final Expression lockAddress = call.getArguments().get(1); - final Register dummy = call.getFunction().newRegister(types.getArchType()); - final Expression zero = expressions.makeZero(types.getArchType()); - final Expression minusOne = expressions.makeValue(BigInteger.ONE.negate(), types.getArchType()); return List.of( // Allow other threads to access the condition variable. EventFactory.Pthread.newUnlock(lockAddress.toString(), lockAddress), - // Wait for signal or broadcast. - EventFactory.Atomic.newFADD(dummy, condAddress, minusOne, Tag.C11.MO_RELAXED), - EventFactory.newAbortIf(expressions.makeGT(dummy, zero, true)), - // Wait for all waiters to be notified of a broadcast. If signal, wait for itself. - // Subsequent waits cannot be notified by the same broadcast event. - EventFactory.Atomic.newLoad(dummy, condAddress, Tag.C11.MO_RELAXED), - EventFactory.newAbortIf(expressions.makeNEQ(dummy, zero)), + // This thread would sleep here. Explicit or spurious signals may wake it. // Re-lock. EventFactory.Pthread.newLock(lockAddress.toString(), lockAddress), assignSuccess(errorRegister) @@ -447,30 +427,16 @@ private List inlinePthreadCondWait(FunctionCall call) { private List inlinePthreadCondTimedwait(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_timedwait final Register errorRegister = getResultRegisterAndCheckArguments(3, call); - final Expression condAddress = call.getArguments().get(0); + //final Expression condAddress = call.getArguments().get(0); final Expression lockAddress = call.getArguments().get(1); //final Expression timespec = call.getArguments().get(2); - final Register dummy = call.getFunction().newRegister(types.getArchType()); - final Label label = EventFactory.newLabel("__VERIFIER_pthread_cond_timedwait_end"); final var errorValue = new INonDet(constantId++, (IntegerType) errorRegister.getType(), true); + errorValue.setMin(BigInteger.ZERO); call.getFunction().getProgram().addConstant(errorValue); - final Expression success = expressions.makeGeneralZero(errorRegister.getType()); - final Expression zero = expressions.makeZero(types.getArchType()); - final Expression minusOne = expressions.makeValue(BigInteger.ONE.negate(), types.getArchType()); return List.of( // Allow other threads to access the condition variable. EventFactory.Pthread.newUnlock(lockAddress.toString(), lockAddress), - // Decide success - EventFactory.newJump(expressions.makeNEQ(errorValue, success), label), - // Wait for signal or broadcast. - EventFactory.Atomic.newFADD(dummy, condAddress, minusOne, Tag.C11.MO_RELAXED), - EventFactory.newAbortIf(expressions.makeGT(dummy, zero, true)), - // Wait for all waiters to be notified of a broadcast. If signal, wait for itself. - // Subsequent waits cannot be notified by the same broadcast event. - EventFactory.Atomic.newLoad(dummy, condAddress, Tag.C11.MO_RELAXED), - EventFactory.newAbortIf(expressions.makeNEQ(dummy, zero)), - // Join branches - label, + // This thread would sleep here. Explicit or spurious signals may wake it. // Re-lock. EventFactory.Pthread.newLock(lockAddress.toString(), lockAddress), //TODO proper error code: ETIMEDOUT From 693801315d68b19aac39284ab7aab2ad867e40bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Tue, 5 Dec 2023 21:25:33 +0100 Subject: [PATCH 07/21] Add missing load in pthread_getspecific --- .../dat3m/dartagnan/program/processing/Intrinsics.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 3142961c15..53c3d22abc 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -477,23 +477,27 @@ private List inlinePthreadKeyDelete(FunctionCall call) { private List inlinePthreadGetSpecific(FunctionCall call) { //see https://linux.die.net/man/3/pthread_getspecific final Register result = getResultRegisterAndCheckArguments(1, call); + final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression key = call.getArguments().get(0); final int threadID = call.getThread().getId(); final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); return List.of( - EventFactory.newLoad(result, expressions.makeADD(key, offset)) + EventFactory.newLoad(dummy, key), + EventFactory.newLoad(result, expressions.makeADD(dummy, offset)) ); } private List inlinePthreadSetSpecific(FunctionCall call) { //see https://linux.die.net/man/3/pthread_setspecific final Register errorRegister = getResultRegisterAndCheckArguments(2, call); + final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression key = call.getArguments().get(0); final Expression value = call.getArguments().get(1); final int threadID = call.getThread().getId(); final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); return List.of( - EventFactory.newStore(expressions.makeADD(key, offset), value), + EventFactory.newLoad(dummy, key), + EventFactory.newStore(expressions.makeADD(dummy, offset), value), assignSuccess(errorRegister) ); } From fe32a93d9d537356140e176189280d963b84ee7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 6 Dec 2023 14:55:37 +0100 Subject: [PATCH 08/21] Fix pthread_key_create allocating dynamic memory too early in the processing pipeline --- .../dat3m/dartagnan/program/memory/MemoryObject.java | 2 +- .../dat3m/dartagnan/program/processing/Intrinsics.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/memory/MemoryObject.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/memory/MemoryObject.java index 6f6abaa1c4..4a809f37bf 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/memory/MemoryObject.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/memory/MemoryObject.java @@ -55,7 +55,7 @@ public class MemoryObject extends IConst { // Should only be called for statically allocated objects. public Set getStaticallyInitializedFields() { - checkState(this.isStaticallyAllocated()); + checkState(this.isStaticallyAllocated(), "Unexpected dynamic object %s", this); return initialValues.keySet(); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 53c3d22abc..1761c3aee3 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -15,7 +15,6 @@ import com.dat3m.dartagnan.program.event.functions.FunctionCall; import com.dat3m.dartagnan.program.event.functions.ValueFunctionCall; import com.dat3m.dartagnan.program.event.lang.svcomp.BeginAtomic; -import com.dat3m.dartagnan.program.memory.MemoryObject; import com.google.common.collect.ImmutableList; import com.google.common.primitives.UnsignedInteger; import com.google.common.primitives.UnsignedLong; @@ -450,13 +449,16 @@ private List inlinePthreadKeyCreate(FunctionCall call) { final Expression key = call.getArguments().get(0); final Expression destructor = call.getArguments().get(1); final Program program = call.getFunction().getProgram(); - final int threadCount = program.getThreads().size(); + final long threadCount = program.getThreads().size(); final int pointerBytes = types.getMemorySizeInBytes(types.getPointerType()); - final MemoryObject object = program.getMemory().allocate((threadCount + 1) * pointerBytes, false); - final BigInteger destructorOffsetValue = BigInteger.valueOf((long) threadCount * pointerBytes); + final Register object = call.getFunction().newRegister(types.getArchType()); + final BigInteger sizeValue = BigInteger.valueOf((threadCount + 1) * pointerBytes); + final Expression size = expressions.makeValue(sizeValue, types.getArchType()); + final BigInteger destructorOffsetValue = BigInteger.valueOf(threadCount * pointerBytes); final Expression destructorOffset = expressions.makeValue(destructorOffsetValue, types.getArchType()); //TODO call destructor at each thread's normal exit return List.of( + EventFactory.newAlloc(object, types.getArchType(), size, false), EventFactory.newStore(key, object), EventFactory.newStore(expressions.makeADD(object, destructorOffset), destructor), assignSuccess(errorRegister) From 1f65e69b6a23cde5eb81f3ddeb731cac54d048ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 11 Dec 2023 15:29:08 +0100 Subject: [PATCH 09/21] Fix indirection in pthread_getspecific and pthread_setspecific. Fix type mismatch in pthread_mutex_trylock. Switch implementations of pthread_cond_signal and pthread_cond_broadcast. --- .../program/processing/Intrinsics.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 1761c3aee3..76c6ff467c 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -395,6 +395,11 @@ private List inlinePthreadCondDestroy(FunctionCall call) { private List inlinePthreadCondSignal(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_signal + return inlinePthreadCondBroadcast(call); + } + + private List inlinePthreadCondBroadcast(FunctionCall call) { + //see https://linux.die.net/man/3/pthread_cond_broadcast // Because of spurious wake-ups, there is no need to do anything here. final Register errorRegister = getResultRegisterAndCheckArguments(1, call); //final Expression condAddress = call.getArguments().get(0); @@ -403,11 +408,6 @@ private List inlinePthreadCondSignal(FunctionCall call) { ); } - private List inlinePthreadCondBroadcast(FunctionCall call) { - //see https://linux.die.net/man/3/pthread_cond_broadcast - return inlinePthreadCondSignal(call); - } - private List inlinePthreadCondWait(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_wait final Register errorRegister = getResultRegisterAndCheckArguments(2, call); @@ -479,27 +479,23 @@ private List inlinePthreadKeyDelete(FunctionCall call) { private List inlinePthreadGetSpecific(FunctionCall call) { //see https://linux.die.net/man/3/pthread_getspecific final Register result = getResultRegisterAndCheckArguments(1, call); - final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression key = call.getArguments().get(0); final int threadID = call.getThread().getId(); - final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); + final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), (IntegerType) key.getType()); return List.of( - EventFactory.newLoad(dummy, key), - EventFactory.newLoad(result, expressions.makeADD(dummy, offset)) + EventFactory.newLoad(result, expressions.makeADD(key, offset)) ); } private List inlinePthreadSetSpecific(FunctionCall call) { //see https://linux.die.net/man/3/pthread_setspecific final Register errorRegister = getResultRegisterAndCheckArguments(2, call); - final Register dummy = call.getFunction().newRegister(types.getArchType()); final Expression key = call.getArguments().get(0); final Expression value = call.getArguments().get(1); final int threadID = call.getThread().getId(); - final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), types.getArchType()); + final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), (IntegerType) key.getType()); return List.of( - EventFactory.newLoad(dummy, key), - EventFactory.newStore(expressions.makeADD(dummy, offset), value), + EventFactory.newStore(expressions.makeADD(key, offset), value), assignSuccess(errorRegister) ); } @@ -540,11 +536,12 @@ private List inlinePthreadMutexTryLock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_mutex_trylock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); checkArgument(errorRegister.getType() instanceof IntegerType, "Wrong return type for \"%s\"", call); - final Register oldValueRegister = call.getFunction().newRegister(types.getBooleanType()); + // We currently use archType in InitLock, Lock and Unlock. + final Register oldValueRegister = call.getFunction().newRegister(types.getArchType()); final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final Expression lockAddress = call.getArguments().get(0); - final Expression locked = expressions.makeTrue(); - final Expression unlocked = expressions.makeFalse(); + final Expression locked = expressions.makeOne(types.getArchType()); + final Expression unlocked = expressions.makeZero(types.getArchType()); final Expression fail = expressions.makeNot(successRegister); return List.of( EventFactory.Llvm.newCompareExchange(oldValueRegister, successRegister, lockAddress, unlocked, locked, Tag.C11.MO_ACQUIRE), From 5a7de2fa5468f53748e1aaf005f4ea12847b9f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 11 Dec 2023 15:58:31 +0100 Subject: [PATCH 10/21] Add ExpressionFactory.makeValue(long,IntegerType) --- .../expression/ExpressionFactory.java | 4 ++++ .../dartagnan/program/event/EventFactory.java | 3 +-- .../program/processing/GEPToAddition.java | 7 +++--- .../program/processing/Intrinsics.java | 22 +++++++++---------- .../processing/NaiveDevirtualisation.java | 3 +-- .../program/processing/ThreadCreation.java | 5 ++--- .../dartagnan/miscellaneous/AnalysisTest.java | 3 +-- 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/expression/ExpressionFactory.java b/dartagnan/src/main/java/com/dat3m/dartagnan/expression/ExpressionFactory.java index 807607d6e8..efa3451e1e 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/expression/ExpressionFactory.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/expression/ExpressionFactory.java @@ -93,6 +93,10 @@ public IValue parseValue(String text, IntegerType type) { return makeValue(new BigInteger(text), type); } + public IValue makeValue(long value, IntegerType type) { + return makeValue(BigInteger.valueOf(value), type); + } + public IValue makeValue(BigInteger value, IntegerType type) { return new IValue(value, type); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java index 6fcab18b61..5d5095305f 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/event/EventFactory.java @@ -43,7 +43,6 @@ import com.dat3m.dartagnan.program.event.lang.svcomp.*; import com.dat3m.dartagnan.program.memory.MemoryObject; -import java.math.BigInteger; import java.util.*; import java.util.stream.Collectors; @@ -135,7 +134,7 @@ public static Init newInit(MemoryObject base, int offset) { //TODO: We simplify here because virtual aliasing currently fails when pointer arithmetic is involved // meaning that and are treated differently. final Expression address = offset == 0 ? base : - expressions.makeADD(base, expressions.makeValue(BigInteger.valueOf(offset), base.getType())); + expressions.makeADD(base, expressions.makeValue(offset, base.getType())); return new Init(base, offset, address); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/GEPToAddition.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/GEPToAddition.java index 67393cbea0..5fdbd161f5 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/GEPToAddition.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/GEPToAddition.java @@ -12,7 +12,6 @@ import com.dat3m.dartagnan.program.event.core.utils.RegReader; import com.dat3m.dartagnan.program.memory.MemoryObject; -import java.math.BigInteger; import java.util.List; public class GEPToAddition implements ProgramProcessor { @@ -53,7 +52,7 @@ public Expression visit(GEPExpression getElementPointer) { assert offsets.size() > 0; result = expressions.makeADD(result, expressions.makeMUL( - expressions.makeValue(BigInteger.valueOf(types.getMemorySizeInBytes(type)), archType), + expressions.makeValue(types.getMemorySizeInBytes(type), archType), expressions.makeIntegerCast(offsets.get(0).accept(this), archType, true))); for (final Expression oldOffset : offsets.subList(1, offsets.size())) { final Expression offset = oldOffset.accept(this); @@ -61,7 +60,7 @@ public Expression visit(GEPExpression getElementPointer) { type = arrayType.getElementType(); result = expressions.makeADD(result, expressions.makeMUL( - expressions.makeValue(BigInteger.valueOf(types.getMemorySizeInBytes(arrayType.getElementType())), archType), + expressions.makeValue(types.getMemorySizeInBytes(arrayType.getElementType()), archType), expressions.makeIntegerCast(offset, archType, true))); continue; } @@ -78,7 +77,7 @@ public Expression visit(GEPExpression getElementPointer) { for (final Type elementType : aggregateType.getDirectFields().subList(0, value)) { o += types.getMemorySizeInBytes(elementType); } - result = expressions.makeADD(result, expressions.makeValue(BigInteger.valueOf(o), archType)); + result = expressions.makeADD(result, expressions.makeValue(o, archType)); } return result; } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 76c6ff467c..a901a5eae9 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -452,10 +452,8 @@ private List inlinePthreadKeyCreate(FunctionCall call) { final long threadCount = program.getThreads().size(); final int pointerBytes = types.getMemorySizeInBytes(types.getPointerType()); final Register object = call.getFunction().newRegister(types.getArchType()); - final BigInteger sizeValue = BigInteger.valueOf((threadCount + 1) * pointerBytes); - final Expression size = expressions.makeValue(sizeValue, types.getArchType()); - final BigInteger destructorOffsetValue = BigInteger.valueOf(threadCount * pointerBytes); - final Expression destructorOffset = expressions.makeValue(destructorOffsetValue, types.getArchType()); + final Expression size = expressions.makeValue((threadCount + 1) * pointerBytes, types.getArchType()); + final Expression destructorOffset = expressions.makeValue(threadCount * pointerBytes, types.getArchType()); //TODO call destructor at each thread's normal exit return List.of( EventFactory.newAlloc(object, types.getArchType(), size, false), @@ -481,7 +479,7 @@ private List inlinePthreadGetSpecific(FunctionCall call) { final Register result = getResultRegisterAndCheckArguments(1, call); final Expression key = call.getArguments().get(0); final int threadID = call.getThread().getId(); - final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), (IntegerType) key.getType()); + final Expression offset = expressions.makeValue(threadID, (IntegerType) key.getType()); return List.of( EventFactory.newLoad(result, expressions.makeADD(key, offset)) ); @@ -493,7 +491,7 @@ private List inlinePthreadSetSpecific(FunctionCall call) { final Expression key = call.getArguments().get(0); final Expression value = call.getArguments().get(1); final int threadID = call.getThread().getId(); - final Expression offset = expressions.makeValue(BigInteger.valueOf(threadID), (IntegerType) key.getType()); + final Expression offset = expressions.makeValue(threadID, (IntegerType) key.getType()); return List.of( EventFactory.newStore(expressions.makeADD(key, offset), value), assignSuccess(errorRegister) @@ -676,8 +674,8 @@ private List inlinePthreadRwlockUnlock(FunctionCall call) { final Expression lockAddress = call.getArguments().get(0); final var decrement = new INonDet(constantId++, types.getArchType(), true); call.getFunction().getProgram().addConstant(decrement); - final Expression minusTwo = expressions.makeValue(BigInteger.valueOf(-2), types.getArchType()); - final Expression minusOne = expressions.makeValue(BigInteger.valueOf(-1), types.getArchType()); + final Expression minusTwo = expressions.makeValue(-2, types.getArchType()); + final Expression minusOne = expressions.makeValue(-1, types.getArchType()); final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); final Expression lastReader = expressions.makeEQ(dummy, two); final Expression properDecrement = expressions.makeConditional(lastReader, minusTwo, minusOne); @@ -1068,7 +1066,7 @@ private List inlineMemCpy(FunctionCall call) { final List replacement = new ArrayList<>(2 * count + 1); for (int i = 0; i < count; i++) { - final Expression offset = expressions.makeValue(BigInteger.valueOf(i), types.getArchType()); + final Expression offset = expressions.makeValue(i, types.getArchType()); final Expression srcAddr = expressions.makeADD(src, offset); final Expression destAddr = expressions.makeADD(dest, offset); // FIXME: We have no other choice but to load ptr-sized chunks for now @@ -1103,7 +1101,7 @@ private List inlineMemCmp(FunctionCall call) { final List replacement = new ArrayList<>(4 * count + 1); final Label endCmp = EventFactory.newLabel("__memcmp_end"); for (int i = 0; i < count; i++) { - final Expression offset = expressions.makeValue(BigInteger.valueOf(i), types.getArchType()); + final Expression offset = expressions.makeValue(i, types.getArchType()); final Expression src1Addr = expressions.makeADD(src1, offset); final Expression src2Addr = expressions.makeADD(src2, offset); //FIXME: This method should properly load byte chunks and compare them (unsigned). @@ -1152,10 +1150,10 @@ private List inlineMemSet(FunctionCall call) { final int fill = fillValue.getValueAsInt(); assert fill == 0; - final Expression zero = expressions.makeValue(BigInteger.valueOf(fill), types.getByteType()); + final Expression zero = expressions.makeValue(fill, types.getByteType()); final List replacement = new ArrayList<>( count + 1); for (int i = 0; i < count; i++) { - final Expression offset = expressions.makeValue(BigInteger.valueOf(i), types.getArchType()); + final Expression offset = expressions.makeValue(i, types.getArchType()); final Expression destAddr = expressions.makeADD(dest, offset); replacement.add(EventFactory.newStore(destAddr, zero)); diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/NaiveDevirtualisation.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/NaiveDevirtualisation.java index 154ae80ed7..2276286076 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/NaiveDevirtualisation.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/NaiveDevirtualisation.java @@ -23,7 +23,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.math.BigInteger; import java.util.*; import java.util.stream.Collectors; @@ -102,7 +101,7 @@ private boolean assignAddressToFunction(Function func, Map fun final ExpressionFactory expressions = ExpressionFactory.getInstance(); if (!func2AddressMap.containsKey(func)) { logger.debug("Assigned address \"{}\" to function \"{}\"", nextAvailableFuncAddress, func); - func2AddressMap.put(func, expressions.makeValue(BigInteger.valueOf(nextAvailableFuncAddress), ptrType)); + func2AddressMap.put(func, expressions.makeValue(nextAvailableFuncAddress, ptrType)); nextAvailableFuncAddress += 8; return true; } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/ThreadCreation.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/ThreadCreation.java index 6c7575208d..578b6cc051 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/ThreadCreation.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/ThreadCreation.java @@ -41,7 +41,6 @@ import org.sosy_lab.common.configuration.Option; import org.sosy_lab.common.configuration.Options; -import java.math.BigInteger; import java.util.*; import static com.dat3m.dartagnan.configuration.OptionNames.THREAD_CREATE_ALWAYS_SUCCEEDS; @@ -129,7 +128,7 @@ public void run(Program program) { assert resultRegister.getType() instanceof IntegerType; final ThreadCreate createEvent = newThreadCreate(List.of(argument)); - final IValue tidExpr = expressions.makeValue(BigInteger.valueOf(nextTid), archType); + final IValue tidExpr = expressions.makeValue(nextTid, archType); final MemoryObject comAddress = program.getMemory().allocate(1, true); comAddress.setCVar("__com" + nextTid + "__" + targetFunction.getName()); @@ -154,7 +153,7 @@ public void run(Program program) { final Register resultRegister = getResultRegister(call); assert resultRegister.getType() instanceof IntegerType; assert arguments.isEmpty(); - final Expression tidExpr = expressions.makeValue(BigInteger.valueOf(thread.getId()), + final Expression tidExpr = expressions.makeValue(thread.getId(), (IntegerType) resultRegister.getType()); final Local tidAssignment = newLocal(resultRegister, tidExpr); tidAssignment.copyAllMetadataFrom(call); diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/miscellaneous/AnalysisTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/miscellaneous/AnalysisTest.java index 340854f9dd..1f990d710a 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/miscellaneous/AnalysisTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/miscellaneous/AnalysisTest.java @@ -26,7 +26,6 @@ import org.sosy_lab.common.configuration.Configuration; import org.sosy_lab.common.configuration.InvalidConfigurationException; -import java.math.BigInteger; import java.util.List; import static com.dat3m.dartagnan.configuration.Alias.FIELD_INSENSITIVE; @@ -392,7 +391,7 @@ private Store newStore(Expression address, Expression value) { } private Expression value(long v) { - return expressions.makeValue(BigInteger.valueOf(v), types.getArchType()); + return expressions.makeValue(v, types.getArchType()); } private Expression plus(Expression lhs, long rhs) { From c41b522c8f151a0f0ebdb9e662ffe17a1d091613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 11 Dec 2023 17:47:07 +0100 Subject: [PATCH 11/21] Fix pthread_rwlock_tryrdlock failing even if read-locked. Outlined several rwlock-related code. --- .../program/processing/Intrinsics.java | 134 ++++++++++-------- 1 file changed, 77 insertions(+), 57 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index a901a5eae9..f673b7bf31 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -446,19 +446,19 @@ private List inlinePthreadCondTimedwait(FunctionCall call) { private List inlinePthreadKeyCreate(FunctionCall call) { //see https://linux.die.net/man/3/pthread_key_create final Register errorRegister = getResultRegisterAndCheckArguments(2, call); - final Expression key = call.getArguments().get(0); + final Expression keyAddress = call.getArguments().get(0); final Expression destructor = call.getArguments().get(1); final Program program = call.getFunction().getProgram(); final long threadCount = program.getThreads().size(); final int pointerBytes = types.getMemorySizeInBytes(types.getPointerType()); - final Register object = call.getFunction().newRegister(types.getArchType()); + final Register storageAddressRegister = call.getFunction().newRegister(types.getArchType()); final Expression size = expressions.makeValue((threadCount + 1) * pointerBytes, types.getArchType()); final Expression destructorOffset = expressions.makeValue(threadCount * pointerBytes, types.getArchType()); //TODO call destructor at each thread's normal exit return List.of( - EventFactory.newAlloc(object, types.getArchType(), size, false), - EventFactory.newStore(key, object), - EventFactory.newStore(expressions.makeADD(object, destructorOffset), destructor), + EventFactory.newAlloc(storageAddressRegister, types.getArchType(), size, true), + EventFactory.newStore(keyAddress, storageAddressRegister), + EventFactory.newStore(expressions.makeADD(storageAddressRegister, destructorOffset), destructor), assignSuccess(errorRegister) ); } @@ -563,9 +563,8 @@ private List inlinePthreadRwlockInit(FunctionCall call) { final Register errorRegister = getResultRegisterAndCheckArguments(2, call); final Expression lockAddress = call.getArguments().get(0); //final Expression attributes = call.getArguments().get(1); - final Expression unlocked = expressions.makeZero(types.getArchType()); return List.of( - EventFactory.newStore(lockAddress, unlocked), + EventFactory.newStore(lockAddress, getRwlockUnlockedValue()), assignSuccess(errorRegister) ); } @@ -586,20 +585,11 @@ private List inlinePthreadRwlockWrlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_wrlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Expression lockAddress = call.getArguments().get(0); - final Register dummy = call.getFunction().newRegister(types.getArchType()); - final Expression zero = expressions.makeZero(types.getArchType()); - final Expression one = expressions.makeOne(types.getArchType()); - final var replacement = new INonDet(constantId++, types.getArchType(), true); - call.getFunction().getProgram().addConstant(replacement); - final Expression locked = expressions.makeNEQ(dummy, zero); - final Expression properReplacement = expressions.makeConditional(locked, dummy, one); + final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); return List.of( - // Try to lock - EventFactory.Atomic.newExchange(dummy, lockAddress, replacement, Tag.C11.MO_ACQUIRE), - // Store one (write-locked) only if successful, else leave unchanged - EventFactory.newAssume(expressions.makeEQ(replacement, properReplacement)), + newRwlockTryWrlock(call, successRegister, lockAddress), // Deadlock if violation occurs in another thread - EventFactory.newAbortIf(locked), + EventFactory.newAbortIf(expressions.makeNot(successRegister)), assignSuccess(errorRegister) ); } @@ -608,49 +598,44 @@ private List inlinePthreadRwlockTryWrlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_trywrlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); final Expression lockAddress = call.getArguments().get(0); - final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final var error = new INonDet(constantId++, (IntegerType) errorRegister.getType(), true); call.getFunction().getProgram().addConstant(error); - final Expression zero = expressions.makeZero(types.getArchType()); - final Expression one = expressions.makeOne(types.getArchType()); final Expression success = expressions.makeGeneralZero(errorRegister.getType()); - //TODO this implementation can fail spontaneously - final Label label = EventFactory.newLabel("__VERIFIER_pthread_rwlock_trywrlock_end"); return List.of( - // Decide whether this operation succeeds - EventFactory.newJump(expressions.makeNEQ(error, success), label), - // Lock - EventFactory.Atomic.newExchange(dummy, lockAddress, one, Tag.C11.MO_ACQUIRE), + newRwlockTryWrlock(call, successRegister, lockAddress), // Guaranteed success in this branch - EventFactory.newAssume(expressions.makeEQ(dummy, zero)), - // Join paths - label, + EventFactory.newAssume(expressions.makeEQ(successRegister, expressions.makeEQ(error, success))), EventFactory.newLocal(errorRegister, error) ); } + private Event newRwlockTryWrlock(FunctionCall call, Register successRegister, Expression lockAddress) { + return EventFactory.Llvm.newCompareExchange( + call.getFunction().newRegister(getRwlockDatatype()), + successRegister, + lockAddress, + getRwlockUnlockedValue(), + getRwlockWriteLockedValue(), + Tag.C11.MO_ACQUIRE + ); + } + private List inlinePthreadRwlockRdlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_rdlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); - final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); final Expression lockAddress = call.getArguments().get(0); - final var increment = new INonDet(constantId++, types.getArchType(), true); + final var increment = new INonDet(constantId++, getRwlockDatatype(), true); call.getFunction().getProgram().addConstant(increment); - final Expression unlocked = expressions.makeZero(types.getArchType()); - final Expression wrLocked = expressions.makeOne(types.getArchType()); - final Expression one = expressions.makeOne(types.getArchType()); - final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); - final Expression firstReader = expressions.makeEQ(dummy, unlocked); - final Expression properIncrement = expressions.makeConditional(firstReader, two, one); + final Expression isWriteLocked = expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()); return List.of( // Increment shared counter only if not locked by writer. - EventFactory.Atomic.newFADD(dummy, lockAddress, increment, Tag.C11.MO_ACQUIRE), + EventFactory.Llvm.newRMW(oldValueRegister, lockAddress, increment, IOpBin.ADD, Tag.C11.MO_ACQUIRE), + // On success, incremented by two, if first reader, else one. TODO On failure, do not store. + EventFactory.newAssume(expressions.makeEQ(increment, getRwlockReadIncrement(oldValueRegister))), // Deadlock if a violation occurred in another thread. In this case, lock value was not changed - EventFactory.newAbortIf(expressions.makeEQ(increment, unlocked)), - // On success, lock cannot have been write-locked. - EventFactory.newAssume(expressions.makeNEQ(dummy, wrLocked)), - // On success, incremented by two, if first reader, else one. - EventFactory.newAssume(expressions.makeEQ(increment, properIncrement)), + EventFactory.newAbortIf(isWriteLocked), assignSuccess(errorRegister) ); } @@ -658,36 +643,71 @@ private List inlinePthreadRwlockRdlock(FunctionCall call) { private List inlinePthreadRwlockTryRdlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_tryrdlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); final Expression lockAddress = call.getArguments().get(0); - final Expression unlocked = expressions.makeZero(types.getArchType()); - final Expression locked = expressions.makeOne(types.getArchType()); + final var increment = new INonDet(constantId++, getRwlockDatatype(), true); + call.getFunction().getProgram().addConstant(increment); + final var error = new INonDet(constantId++, (IntegerType) errorRegister.getType(), true); + call.getFunction().getProgram().addConstant(error); + final Expression isWriteLocked = expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()); + final Expression success = expressions.makeGeneralZero(errorRegister.getType()); return List.of( - // increment shared counter only if not locked by writer. - EventFactory.Atomic.newCompareExchange(errorRegister, lockAddress, unlocked, locked, Tag.C11.MO_ACQUIRE) + // Increment shared counter only if not locked by writer. + EventFactory.Llvm.newRMW(oldValueRegister, lockAddress, increment, IOpBin.ADD, Tag.C11.MO_ACQUIRE), + // On success, incremented by two, if first reader, else one. TODO On failure, do not store. + EventFactory.newAssume(expressions.makeEQ(increment, getRwlockReadIncrement(oldValueRegister))), + // Indicate success with zero. + EventFactory.newAssume(expressions.makeEQ(isWriteLocked, expressions.makeNEQ(error, success))), + EventFactory.newLocal(errorRegister, error) + ); + } + + private Expression getRwlockReadIncrement(Register oldValueRegister) { + return expressions.makeConditional( + expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()), + expressions.makeZero(getRwlockDatatype()), + expressions.makeConditional( + expressions.makeEQ(oldValueRegister, getRwlockUnlockedValue()), + expressions.makeValue(BigInteger.TWO, getRwlockDatatype()), + expressions.makeOne(getRwlockDatatype()) + ) ); } private List inlinePthreadRwlockUnlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_unlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); - final Register dummy = call.getFunction().newRegister(types.getArchType()); + final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); final Expression lockAddress = call.getArguments().get(0); - final var decrement = new INonDet(constantId++, types.getArchType(), true); + final var decrement = new INonDet(constantId++, getRwlockDatatype(), true); call.getFunction().getProgram().addConstant(decrement); - final Expression minusTwo = expressions.makeValue(-2, types.getArchType()); - final Expression minusOne = expressions.makeValue(-1, types.getArchType()); - final Expression two = expressions.makeValue(BigInteger.TWO, types.getArchType()); - final Expression lastReader = expressions.makeEQ(dummy, two); - final Expression properDecrement = expressions.makeConditional(lastReader, minusTwo, minusOne); + final Expression one = expressions.makeOne(getRwlockDatatype()); + final Expression two = expressions.makeValue(BigInteger.TWO, getRwlockDatatype()); + final Expression lastReader = expressions.makeEQ(oldValueRegister, two); + final Expression properDecrement = expressions.makeConditional(lastReader, two, one); //TODO does not recognize whether the calling thread is allowed to unlock return List.of( // decreases the lock value by 1, if not the last reader, or else 2. - EventFactory.Atomic.newFADD(dummy, lockAddress, decrement, Tag.C11.MO_RELEASE), + EventFactory.Llvm.newRMW(oldValueRegister, lockAddress, decrement, IOpBin.SUB, Tag.C11.MO_RELEASE), EventFactory.newAssume(expressions.makeEQ(decrement, properDecrement)), assignSuccess(errorRegister) ); } + private IntegerType getRwlockDatatype() { + return types.getArchType(); + } + + private IValue getRwlockUnlockedValue() { + //FIXME this assumes that the lock is initialized with pthread_rwlock_init, + // but some programs may explicitly initialize it with other platform-dependent values. + return expressions.makeZero(getRwlockDatatype()); + } + + private IValue getRwlockWriteLockedValue() { + return expressions.makeOne(getRwlockDatatype()); + } + private List inlineMalloc(FunctionCall call) { if (call.getArguments().size() != 1) { throw new UnsupportedOperationException(String.format("Unsupported signature for %s.", call)); From 4517ca43c24cbcfb78e6454772f9d17bbbc5160b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 11 Dec 2023 18:18:41 +0100 Subject: [PATCH 12/21] Remove stores from failing pthread_rwlock_try..lock --- .../program/processing/Intrinsics.java | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index f673b7bf31..feb114bb09 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -587,8 +587,9 @@ private List inlinePthreadRwlockWrlock(FunctionCall call) { final Expression lockAddress = call.getArguments().get(0); final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); return List.of( + // Write-lock only if unlocked. newRwlockTryWrlock(call, successRegister, lockAddress), - // Deadlock if violation occurs in another thread + // Deadlock if a violation occurred in another thread. EventFactory.newAbortIf(expressions.makeNot(successRegister)), assignSuccess(errorRegister) ); @@ -603,8 +604,9 @@ private List inlinePthreadRwlockTryWrlock(FunctionCall call) { call.getFunction().getProgram().addConstant(error); final Expression success = expressions.makeGeneralZero(errorRegister.getType()); return List.of( + // Write-lock only if unlocked. newRwlockTryWrlock(call, successRegister, lockAddress), - // Guaranteed success in this branch + // Indicate success by returning zero. EventFactory.newAssume(expressions.makeEQ(successRegister, expressions.makeEQ(error, success))), EventFactory.newLocal(errorRegister, error) ); @@ -624,18 +626,17 @@ private Event newRwlockTryWrlock(FunctionCall call, Register successRegister, Ex private List inlinePthreadRwlockRdlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_rdlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); - final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); + final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final Expression lockAddress = call.getArguments().get(0); - final var increment = new INonDet(constantId++, getRwlockDatatype(), true); - call.getFunction().getProgram().addConstant(increment); - final Expression isWriteLocked = expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()); + final var expected = new INonDet(constantId++, getRwlockDatatype(), true); + call.getFunction().getProgram().addConstant(expected); return List.of( + // Expect any other value than write-locked. + EventFactory.newAssume(expressions.makeNEQ(expected, getRwlockWriteLockedValue())), // Increment shared counter only if not locked by writer. - EventFactory.Llvm.newRMW(oldValueRegister, lockAddress, increment, IOpBin.ADD, Tag.C11.MO_ACQUIRE), - // On success, incremented by two, if first reader, else one. TODO On failure, do not store. - EventFactory.newAssume(expressions.makeEQ(increment, getRwlockReadIncrement(oldValueRegister))), - // Deadlock if a violation occurred in another thread. In this case, lock value was not changed - EventFactory.newAbortIf(isWriteLocked), + newRwlockTryRdlock(call, successRegister, lockAddress, expected), + // Deadlock if a violation occurred in another thread. + EventFactory.newAbortIf(expressions.makeNot(successRegister)), assignSuccess(errorRegister) ); } @@ -643,34 +644,36 @@ private List inlinePthreadRwlockRdlock(FunctionCall call) { private List inlinePthreadRwlockTryRdlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_tryrdlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); - final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); + final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final Expression lockAddress = call.getArguments().get(0); - final var increment = new INonDet(constantId++, getRwlockDatatype(), true); - call.getFunction().getProgram().addConstant(increment); + final var expected = new INonDet(constantId++, getRwlockDatatype(), true); + call.getFunction().getProgram().addConstant(expected); final var error = new INonDet(constantId++, (IntegerType) errorRegister.getType(), true); call.getFunction().getProgram().addConstant(error); - final Expression isWriteLocked = expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()); final Expression success = expressions.makeGeneralZero(errorRegister.getType()); return List.of( + // Expect any other value than write-locked. + EventFactory.newAssume(expressions.makeNEQ(expected, getRwlockWriteLockedValue())), // Increment shared counter only if not locked by writer. - EventFactory.Llvm.newRMW(oldValueRegister, lockAddress, increment, IOpBin.ADD, Tag.C11.MO_ACQUIRE), - // On success, incremented by two, if first reader, else one. TODO On failure, do not store. - EventFactory.newAssume(expressions.makeEQ(increment, getRwlockReadIncrement(oldValueRegister))), + newRwlockTryRdlock(call, successRegister, lockAddress, expected), // Indicate success with zero. - EventFactory.newAssume(expressions.makeEQ(isWriteLocked, expressions.makeNEQ(error, success))), + EventFactory.newAssume(expressions.makeEQ(successRegister, expressions.makeEQ(error, success))), EventFactory.newLocal(errorRegister, error) ); } - private Expression getRwlockReadIncrement(Register oldValueRegister) { - return expressions.makeConditional( - expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()), - expressions.makeZero(getRwlockDatatype()), + private Event newRwlockTryRdlock(FunctionCall call, Register successRegister, Expression lockAddress, Expression expected) { + return EventFactory.Llvm.newCompareExchange( + call.getFunction().newRegister(getRwlockDatatype()), + successRegister, + lockAddress, + expected, expressions.makeConditional( - expressions.makeEQ(oldValueRegister, getRwlockUnlockedValue()), + expressions.makeEQ(expected, getRwlockUnlockedValue()), expressions.makeValue(BigInteger.TWO, getRwlockDatatype()), - expressions.makeOne(getRwlockDatatype()) - ) + expressions.makeADD(expected, expressions.makeOne(getRwlockDatatype())) + ), + Tag.C11.MO_ACQUIRE ); } From a09a8417ed5cdcbda3aac089fe09c5f49926f5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 11 Dec 2023 18:49:01 +0100 Subject: [PATCH 13/21] Refactor Intrinsics, remove strcpy --- .../program/processing/Intrinsics.java | 64 ++++--------------- 1 file changed, 12 insertions(+), 52 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index feb114bb09..bbf39930a9 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -182,10 +182,6 @@ public enum Info { STD_MEMCPY("memcpy", true, true, true, false, Intrinsics::inlineMemCpy), STD_MEMSET(List.of("memset", "__memset_chk"), true, false, true, false, Intrinsics::inlineMemSet), STD_MEMCMP("memcmp", false, true, true, false, Intrinsics::inlineMemCmp), - // STD_STRCPY("strcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, false)), - // STD_STPCPY("stpcpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, false)), - // STD_STRNCPY("strncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, false, true)), - // STD_STPNCPY("stpncpy", true, true, true, true, (i, c) -> i.inlineStrcpy(c, true, true)), STD_MALLOC("malloc", false, false, true, true, Intrinsics::inlineMalloc), STD_CALLOC("calloc", false, false, true, true, Intrinsics::inlineCalloc), STD_FREE("free", true, false, true, true, Intrinsics::inlineAsZero),//TODO support free @@ -712,28 +708,21 @@ private IValue getRwlockWriteLockedValue() { } private List inlineMalloc(FunctionCall call) { - if (call.getArguments().size() != 1) { - throw new UnsupportedOperationException(String.format("Unsupported signature for %s.", call)); - } - final ValueFunctionCall valueCall = (ValueFunctionCall) call; - return List.of(EventFactory.newAlloc( - valueCall.getResultRegister(), - TypeFactory.getInstance().getByteType(), - valueCall.getArguments().get(0), - true - )); + final Register resultRegister = getResultRegisterAndCheckArguments(1, call); + final Expression totalSize = call.getArguments().get(0); + return List.of( + EventFactory.newAlloc(resultRegister, TypeFactory.getInstance().getByteType(), totalSize, true) + ); } private List inlineCalloc(FunctionCall call) { - checkArgument(call.getArguments().size() == 2, "Unsupported signature for %s", call); - checkArgument(call instanceof ValueFunctionCall, "No support for discarded result of %s", call); - final ValueFunctionCall valueCall = (ValueFunctionCall) call; - return List.of(EventFactory.newAlloc( - valueCall.getResultRegister(), - TypeFactory.getInstance().getByteType(), - expressions.makeMUL(valueCall.getArguments().get(0), valueCall.getArguments().get(1)), - true - )); + final Register resultRegister = getResultRegisterAndCheckArguments(2, call); + final Expression elementCount = call.getArguments().get(0); + final Expression elementSize = call.getArguments().get(1); + final Expression totalSize = expressions.makeMUL(elementCount, elementSize); + return List.of( + EventFactory.newAlloc(resultRegister, TypeFactory.getInstance().getByteType(), totalSize, true) + ); } private List inlineAssert(FunctionCall call) { @@ -1189,35 +1178,6 @@ private List inlineMemSet(FunctionCall call) { return replacement; } - private List inlineStrcpy(FunctionCall call, boolean returnEnd, boolean numberProvided) { - final Register result = getResultRegisterAndCheckArguments(numberProvided ? 3 : 2, call); - final Register offset = call.getFunction().newRegister(types.getArchType()); - final Register dummy = call.getFunction().newRegister(types.getByteType()); - final Expression destination = call.getArguments().get(0); - final Expression source = call.getArguments().get(1); - final Expression number = numberProvided ? call.getArguments().get(2) : null; - final Expression numberCheck = numberProvided ? expressions.makeEQ(offset, number) : expressions.makeFalse(); - // This implementation is a simple byte-by-byte copy loop. - final Label loop = EventFactory.newLabel("__VERIFIER_strcpy_loop"); - final Label end = EventFactory.newLabel("__VERIFIER_strcpy_end"); - return List.of( - EventFactory.newLocal(offset, expressions.makeZero(types.getArchType())), - loop, - // If bound is reached, break - EventFactory.newJump(numberCheck, end), - // Copy one byte - EventFactory.newLoad(dummy, expressions.makeADD(source, offset)), - EventFactory.newStore(expressions.makeADD(destination, offset), dummy), - // Break on '\0' - EventFactory.newJump(expressions.makeEQ(dummy, expressions.makeZero(types.getByteType())), end), - // Increase offset - EventFactory.newLocal(offset, expressions.makeADD(offset, expressions.makeOne(types.getArchType()))), - // Continue - EventFactory.newGoto(loop), - end, - EventFactory.newLocal(result, returnEnd ? expressions.makeADD(destination, offset) : destination)); - } - private Event assignSuccess(Register errorRegister) { return EventFactory.newLocal(errorRegister, expressions.makeGeneralZero(errorRegister.getType())); } From cc5917690b083a96186dd4d4dcd6154c2fec6101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 6 Dec 2023 14:37:16 +0100 Subject: [PATCH 14/21] Add pthread_*attr_* intrinsics --- .../program/processing/Intrinsics.java | 152 +++++++++++++++--- 1 file changed, 129 insertions(+), 23 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index bbf39930a9..813b5adff1 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -94,6 +94,12 @@ public enum Info { P_THREAD_JOIN(List.of("pthread_join", "__pthread_join", "\"\\01_pthread_join\""), false, true, false, false, null), P_THREAD_BARRIER_WAIT("pthread_barrier_wait", false, false, true, true, Intrinsics::inlineAsZero), P_THREAD_SELF(List.of("pthread_self", "__VERIFIER_tid"), false, false, true, false, null), + P_THREAD_ATTR_INIT("pthread_attr_init", true, true, true, true, Intrinsics::inlinePthreadAttr), + P_THREAD_ATTR_DESTROY("pthread_attr_destroy", true, true, true, true, Intrinsics::inlinePthreadAttr), + P_THREAD_ATTR_GET(P_THREAD_ATTR.stream().map(a -> "pthread_attr_get" + a).toList(), + true, true, true, true, Intrinsics::inlinePthreadAttr), + P_THREAD_ATTR_SET(P_THREAD_ATTR.stream().map(a -> "pthread_attr_set" + a).toList(), + true, true, true, true, Intrinsics::inlinePthreadAttr), // --------------------------- pthread condition variable --------------------------- P_THREAD_COND_INIT("pthread_cond_init", true, true, true, true, Intrinsics::inlinePthreadCondInit), P_THREAD_COND_DESTROY("pthread_cond_destroy", true, false, true, true, Intrinsics::inlinePthreadCondDestroy), @@ -101,33 +107,25 @@ public enum Info { P_THREAD_COND_BROADCAST("pthread_cond_broadcast", true, false, true, true, Intrinsics::inlinePthreadCondBroadcast), P_THREAD_COND_WAIT("pthread_cond_wait", false, true, false, true, Intrinsics::inlinePthreadCondWait), P_THREAD_COND_TIMEDWAIT("pthread_cond_timedwait", false, false, true, true, Intrinsics::inlinePthreadCondTimedwait), - P_THREAD_CONDATTR_INIT("pthread_condattr_init", true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_CONDATTR_DESTROY("pthread_condattr_destroy", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_CONDATTR_INIT("pthread_condattr_init", true, true, true, true, Intrinsics::inlinePthreadCondAttr), + P_THREAD_CONDATTR_DESTROY("pthread_condattr_destroy", true, true, true, true, Intrinsics::inlinePthreadCondAttr), // --------------------------- pthread key --------------------------- P_THREAD_KEY_CREATE("pthread_key_create", false, false, true, false, Intrinsics::inlinePthreadKeyCreate), P_THREAD_KEY_DELETE("pthread_key_delete", false, false, true, false, Intrinsics::inlinePthreadKeyDelete), P_THREAD_GET_SPECIFIC("pthread_getspecific", false, true, true, false, Intrinsics::inlinePthreadGetSpecific), P_THREAD_SET_SPECIFIC("pthread_setspecific", true, false, true, false, Intrinsics::inlinePthreadSetSpecific), // --------------------------- pthread mutex --------------------------- - P_THREAD_MUTEX_INIT("pthread_mutex_init", true, false, true, true, Intrinsics::inlinePthreadMutexInit), - P_THREAD_MUTEX_DESTROY("pthread_mutex_destroy", true, false, true, true, Intrinsics::inlinePthreadMutexDestroy), + P_THREAD_MUTEX_INIT("pthread_mutex_init", true, true, true, true, Intrinsics::inlinePthreadMutexInit), + P_THREAD_MUTEX_DESTROY("pthread_mutex_destroy", true, true, true, true, Intrinsics::inlinePthreadMutexDestroy), P_THREAD_MUTEX_LOCK("pthread_mutex_lock", true, true, false, true, Intrinsics::inlinePthreadMutexLock), P_THREAD_MUTEX_TRYLOCK("pthread_mutex_trylock", true, true, true, true, Intrinsics::inlinePthreadMutexTryLock), - P_THREAD_MUTEX_UNLOCK("pthread_mutex_unlock", true, false, true, true, Intrinsics::inlinePthreadMutexUnlock), - P_THREAD_MUTEXATTR_INIT("pthread_mutexattr_init", true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_MUTEXATTR_DESTROY("pthread_mutexattr_destroy", true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_MUTEXATTR_SET(List.of( - "pthread_mutexattr_setprioceiling", - "pthread_mutexattr_setprotocol", - "pthread_mutexattr_settype", - "pthread_mutexattr_setpolicy_np"), - true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_MUTEXATTR_GET(List.of( - "pthread_mutexattr_getprioceiling", - "pthread_mutexattr_getprotocol", - "pthread_mutexattr_gettype", - "pthread_mutexattr_getpolicy_np"), - false, true, true, true, Intrinsics::inlineAsZero), + P_THREAD_MUTEX_UNLOCK("pthread_mutex_unlock", true, true, true, true, Intrinsics::inlinePthreadMutexUnlock), + P_THREAD_MUTEXATTR_INIT("pthread_mutexattr_init", true, true, true, true, Intrinsics::inlinePthreadMutexAttr), + P_THREAD_MUTEXATTR_DESTROY("pthread_mutexattr_destroy", true, true, true, true, Intrinsics::inlinePthreadMutexAttr), + P_THREAD_MUTEXATTR_SET(P_THREAD_MUTEXATTR.stream().map(a -> "pthread_mutexattr_get" + a).toList(), + true, true, true, true, Intrinsics::inlinePthreadMutexAttr), + P_THREAD_MUTEXATTR_GET(P_THREAD_MUTEXATTR.stream().map(a -> "pthread_mutexattr_set" + a).toList(), + true, true, true, true, Intrinsics::inlinePthreadMutexAttr), // --------------------------- pthread read/write lock --------------------------- P_THREAD_RWLOCK_INIT("pthread_rwlock_init", true, false, true, true, Intrinsics::inlinePthreadRwlockInit), P_THREAD_RWLOCK_DESTROY("pthread_rwlock_destroy", true, true, true, true, Intrinsics::inlinePthreadRwlockDestroy), @@ -136,10 +134,10 @@ public enum Info { P_THREAD_RWLOCK_RDLOCK("pthread_rwlock_rdlock", true, true, false, true, Intrinsics::inlinePthreadRwlockRdlock), P_THREAD_RWLOCK_TRYRDLOCK("pthread_rwlock_tryrdlock", true, true, true, true, Intrinsics::inlinePthreadRwlockTryRdlock), P_THREAD_RWLOCK_UNLOCK("pthread_rwlock_unlock", true, false, true, true, Intrinsics::inlinePthreadRwlockUnlock), - P_THREAD_RWLOCKATTR_INIT("pthread_rwlockattr_init", true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_RWLOCKATTR_DESTROY("pthread_rwlockattr_destroy", true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_RWLOCKATTR_SET("pthread_rwlockattr_setpshared", true, false, true, true, Intrinsics::inlineAsZero), - P_THREAD_RWLOCKATTR_GET("pthread_rwlockattr_getpshared", true, false, true, true, Intrinsics::inlineAsZero), + P_THREAD_RWLOCKATTR_INIT("pthread_rwlockattr_init", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), + P_THREAD_RWLOCKATTR_DESTROY("pthread_rwlockattr_destroy", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), + P_THREAD_RWLOCKATTR_SET("pthread_rwlockattr_setpshared", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), + P_THREAD_RWLOCKATTR_GET("pthread_rwlockattr_getpshared", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), // --------------------------- SVCOMP --------------------------- VERIFIER_ATOMIC_BEGIN("__VERIFIER_atomic_begin", false, false, true, true, Intrinsics::inlineAtomicBegin), VERIFIER_ATOMIC_END("__VERIFIER_atomic_end", false, false, true, true, Intrinsics::inlineAtomicEnd), @@ -366,6 +364,46 @@ private List inlineAtomicEnd(FunctionCall ignored) { return List.of(EventFactory.Svcomp.newEndAtomic(checkNotNull(currentAtomicBegin))); } + private static final List P_THREAD_ATTR = List.of( + "stack", // no field itself, but describes simultaneous getters and setters for stackaddr and stacksize + "stackaddr", + "stacksize", + "guardsize", + "detachstate", // either PTHREAD_CREATE_DETACHED, or defaults to PTHREAD_CREATE_JOINABLE + "inheritsched", // either PTHREAD_EXPLICIT_SCHED, or defaults to PTHREAD_INHERIT_SCHED + "schedparam", // struct sched_param + "schedpolicy", // either SCHED_FIFO, SCHED_RR, or SCHED_OTHER + "scope" // either PTHREAD_SCOPE_SYSTEM, or PTHREAD_SCOPE_PROCESS + ); + + private List inlinePthreadAttr(FunctionCall call) { + final String suffix = call.getCalledFunction().getName().substring("pthread_attr_".length()); + final int expectedArguments = switch (suffix) { + case "init", "destroy" -> 1; + case "getstack", "setstack" -> 3; + default -> 2; + }; + final Register errorRegister = getResultRegisterAndCheckArguments(expectedArguments, call); + final Expression attrAddress = call.getArguments().get(0); + final boolean initial = suffix.equals("init"); + if (initial || suffix.equals("destroy")) { + final Expression flag = expressions.makeValue(initial); + return List.of( + EventFactory.newStore(attrAddress, flag), + assignSuccess(errorRegister) + ); + } + final boolean getter = suffix.startsWith("get"); + checkArgument(getter || suffix.startsWith("set"), "Unrecognized intrinsics \"%s\"", call); + checkArgument(P_THREAD_ATTR.contains(suffix.substring(3))); + //final Register oldValue = call.getFunction().newRegister(types.getBooleanType()); + //final Expression value = call.getArguments().get(1); + return List.of( + //EventFactory.newLoad(oldValue, attrAddress), + assignSuccess(errorRegister) + ); + } + private List inlinePthreadCondInit(FunctionCall call) { //see https://linux.die.net/man/3/pthread_cond_init final Register errorRegister = getResultRegisterAndCheckArguments(2, call); @@ -439,6 +477,19 @@ private List inlinePthreadCondTimedwait(FunctionCall call) { ); } + private List inlinePthreadCondAttr(FunctionCall call) { + final String suffix = call.getCalledFunction().getName().substring("pthread_condattr_".length()); + final boolean init = suffix.equals("init"); + final boolean destroy = suffix.equals("destroy"); + final Register errorRegister = getResultRegisterAndCheckArguments(init || destroy ? 1 : 2, call); + final Expression attrAddress = call.getArguments().get(0); + checkUnknownIntrinsic(init || destroy, call); + return List.of( + EventFactory.newStore(attrAddress, expressions.makeValue(init)), + assignSuccess(errorRegister) + ); + } + private List inlinePthreadKeyCreate(FunctionCall call) { //see https://linux.die.net/man/3/pthread_key_create final Register errorRegister = getResultRegisterAndCheckArguments(2, call); @@ -494,6 +545,13 @@ private List inlinePthreadSetSpecific(FunctionCall call) { ); } + private static final List P_THREAD_MUTEXATTR = List.of( + "prioceiling", + "protocol", + "type", + "policy_np" + ); + private List inlinePthreadMutexInit(FunctionCall call) { //see https://linux.die.net/man/3/pthread_mutex_init final Register errorRegister = getResultRegisterAndCheckArguments(2, call); @@ -554,6 +612,30 @@ private List inlinePthreadMutexUnlock(FunctionCall call) { ); } + private List inlinePthreadMutexAttr(FunctionCall call) { + final String suffix = call.getCalledFunction().getName().substring("pthread_mutexattr_".length()); + final boolean init = suffix.equals("init"); + final boolean destroy = suffix.equals("destroy"); + final Register errorRegister = getResultRegisterAndCheckArguments(init || destroy ? 1 : 2, call); + final Expression attrAddress = call.getArguments().get(0); + if (init || destroy) { + return List.of( + EventFactory.newStore(attrAddress, expressions.makeValue(init)), + assignSuccess(errorRegister) + ); + } + final boolean get = suffix.startsWith("get"); + checkUnknownIntrinsic(get || suffix.startsWith("set"), call); + checkUnknownIntrinsic(P_THREAD_MUTEXATTR.contains(suffix.substring(3)), call); + return List.of( + assignSuccess(errorRegister) + ); + } + + private static final List P_THREAD_RWLOCK_ATTR = List.of( + "pshared" + ); + private List inlinePthreadRwlockInit(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_init final Register errorRegister = getResultRegisterAndCheckArguments(2, call); @@ -707,6 +789,26 @@ private IValue getRwlockWriteLockedValue() { return expressions.makeOne(getRwlockDatatype()); } + private List inlinePthreadRwlockAttr(FunctionCall call) { + final String suffix = call.getCalledFunction().getName().substring("pthread_rwlockattr_".length()); + final boolean init = suffix.equals("init"); + final boolean destroy = suffix.equals("destroy"); + final Register errorRegister = getResultRegisterAndCheckArguments(init || destroy ? 1 : 2, call); + final Expression attrAddress = call.getArguments().get(0); + if (init || destroy) { + return List.of( + EventFactory.newStore(attrAddress, expressions.makeValue(init)), + assignSuccess(errorRegister) + ); + } + final boolean get = suffix.startsWith("get"); + checkUnknownIntrinsic(get || suffix.startsWith("set"), call); + checkUnknownIntrinsic(P_THREAD_RWLOCK_ATTR.contains(suffix.substring(3)), call); + return List.of( + assignSuccess(errorRegister) + ); + } + private List inlineMalloc(FunctionCall call) { final Register resultRegister = getResultRegisterAndCheckArguments(1, call); final Expression totalSize = call.getArguments().get(0); @@ -1191,6 +1293,10 @@ private void checkArguments(int expectedArgumentCount, FunctionCall call) { checkArgument(call.getArguments().size() == expectedArgumentCount, "Wrong function type at %s", call); } + private void checkUnknownIntrinsic(boolean condition, FunctionCall call) { + checkArgument(condition, "Unknown intrinsic \"%s\"", call); + } + private Register getResultRegister(FunctionCall call) { checkArgument(call instanceof ValueFunctionCall, "Unexpected value discard at intrinsic \"%s\"", call); return ((ValueFunctionCall) call).getResultRegister(); From 407dbe5f7b8c1edb0feb4390e4e4c7c3a256aba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 13 Dec 2023 00:01:51 +0100 Subject: [PATCH 15/21] Add pthread_equal --- .../dat3m/dartagnan/program/processing/Intrinsics.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 813b5adff1..0414e544e0 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -94,6 +94,7 @@ public enum Info { P_THREAD_JOIN(List.of("pthread_join", "__pthread_join", "\"\\01_pthread_join\""), false, true, false, false, null), P_THREAD_BARRIER_WAIT("pthread_barrier_wait", false, false, true, true, Intrinsics::inlineAsZero), P_THREAD_SELF(List.of("pthread_self", "__VERIFIER_tid"), false, false, true, false, null), + P_THREAD_EQUAL("pthread_equal", false, false, true, false, Intrinsics::inlinePthreadEqual), P_THREAD_ATTR_INIT("pthread_attr_init", true, true, true, true, Intrinsics::inlinePthreadAttr), P_THREAD_ATTR_DESTROY("pthread_attr_destroy", true, true, true, true, Intrinsics::inlinePthreadAttr), P_THREAD_ATTR_GET(P_THREAD_ATTR.stream().map(a -> "pthread_attr_get" + a).toList(), @@ -364,6 +365,15 @@ private List inlineAtomicEnd(FunctionCall ignored) { return List.of(EventFactory.Svcomp.newEndAtomic(checkNotNull(currentAtomicBegin))); } + private List inlinePthreadEqual(FunctionCall call) { + final Register resultRegister = getResultRegisterAndCheckArguments(2, call); + final Expression leftId = call.getArguments().get(0); + final Expression rightId = call.getArguments().get(1); + return List.of( + EventFactory.newLocal(resultRegister, expressions.makeEQ(leftId, rightId)) + ); + } + private static final List P_THREAD_ATTR = List.of( "stack", // no field itself, but describes simultaneous getters and setters for stackaddr and stacksize "stackaddr", From 8749470640112230c230ff558d4ee84f9c1a3e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 13 Dec 2023 01:02:42 +0100 Subject: [PATCH 16/21] Add tests --- benchmarks/c/miscellaneous/pthread.c | 413 +++ .../dat3m/dartagnan/c/MiscellaneousTest.java | 1 + .../test/resources/miscellaneous/pthread.ll | 2446 +++++++++++++++++ 3 files changed, 2860 insertions(+) create mode 100644 benchmarks/c/miscellaneous/pthread.c create mode 100644 dartagnan/src/test/resources/miscellaneous/pthread.ll diff --git a/benchmarks/c/miscellaneous/pthread.c b/benchmarks/c/miscellaneous/pthread.c new file mode 100644 index 0000000000..2b5c5ee51d --- /dev/null +++ b/benchmarks/c/miscellaneous/pthread.c @@ -0,0 +1,413 @@ +#include +#include +#include +//TODO #include +void __VERIFIER_loop_bound(int); + +// Test basic support for the pthread library. +// Library symbols can be recognized by the `pthread_` prefix. +// TODO Preprocessor constants cannot be as easily recognized and could be platform-dependent. + +// -------- Threads + +pthread_t thread_create(void*(*runner)(void*), void* data) +{ + pthread_t id; + pthread_attr_t attr; + pthread_attr_init(&attr); + int status = pthread_create(&id, &attr, runner, data); + assert(status == 0); + pthread_attr_destroy(&attr); + return id; +} + +void* thread_join(pthread_t id) +{ + void* result; + int status = pthread_join(id, &result); + assert(status == 0); + return result; +} + +// -------- Mutual exclusion + +//from pthread.h for darwin: +//define PTHREAD_MUTEX_NORMAL 0 +//define PTHREAD_MUTEX_ERRORCHECK 1 +//define PTHREAD_MUTEX_RECURSIVE 2 +//define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL +//define PTHREAD_PRIO_NONE 0 +//define PTHREAD_PRIO_INHERIT 1 +//define PTHREAD_PRIO_PROTECT 2 +//define PTHREAD_MUTEX_POLICY_FAIRSHARE_NP 1 +//define PTHREAD_MUTEX_POLICY_FIRSTFIT_NP 3 +void mutex_init(pthread_mutex_t* lock, int type, int protocol, int policy, int prioceiling) +{ + int status; + int value; + pthread_mutexattr_t attributes; + status = pthread_mutexattr_init(&attributes); + assert(status == 0); + + status = pthread_mutexattr_settype(&attributes, type); + assert(status == 0); + status = pthread_mutexattr_gettype(&attributes, &value); + assert(status == 0);// && value == type); TODO Add storage of attribute entries. + + status = pthread_mutexattr_setprotocol(&attributes, protocol); + assert(status == 0); + status = pthread_mutexattr_getprotocol(&attributes, &value); + assert(status == 0);// && value == protocol); + + status = pthread_mutexattr_setpolicy_np(&attributes, policy); + assert(status == 0); + status = pthread_mutexattr_getpolicy_np(&attributes, &value); + assert(status == 0);// && value == policy); + + status = pthread_mutexattr_setprioceiling(&attributes, prioceiling); + assert(status == 0); + status = pthread_mutexattr_getprioceiling(&attributes, &value); + assert(status == 0);// && value == prioceiling); + + status = pthread_mutex_init(lock, &attributes); + assert(status == 0); + status = pthread_mutexattr_destroy(&attributes); + assert(status == 0); +} + +void mutex_destroy(pthread_mutex_t* lock) +{ + int status = pthread_mutex_destroy(lock); + assert(status == 0); +} + +void mutex_lock(pthread_mutex_t* lock) +{ + int status = pthread_mutex_lock(lock); + assert(status == 0); +} + +bool mutex_trylock(pthread_mutex_t* lock) +{ + int status = pthread_mutex_trylock(lock); + //assert(status == 0 || status == EBUSY); // TODO Add support for platform-dependent error codes. + return status == 0; +} + +void mutex_unlock(pthread_mutex_t* lock) +{ + int status = pthread_mutex_unlock(lock); + assert(status == 0); +} + +void mutex_test() +{ + pthread_mutex_t mutex0; + pthread_mutex_t mutex1; + //TODO Add different behavior based on attributes. + mutex_init(&mutex0, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_PRIO_INHERIT, PTHREAD_MUTEX_POLICY_FAIRSHARE_NP, 1); + mutex_init(&mutex1, PTHREAD_MUTEX_RECURSIVE, PTHREAD_PRIO_PROTECT, PTHREAD_MUTEX_POLICY_FIRSTFIT_NP, 2); + + { + mutex_lock(&mutex0); + bool success = mutex_trylock(&mutex0); + assert(!success); + mutex_unlock(&mutex0); + } + + { + mutex_lock(&mutex1); + + { + bool success = mutex_trylock(&mutex0); + assert(success); + mutex_unlock(&mutex0); + } + + { + bool success = mutex_trylock(&mutex0); + assert(success); + mutex_unlock(&mutex0); + } + + /*{ + //TODO Add support for recursive mutexes. + bool success = mutex_trylock(&mutex1); + assert(success); + mutex_unlock(&mutex1); + }*/ + + mutex_unlock(&mutex1); + } + + mutex_destroy(&mutex1); + mutex_destroy(&mutex0); +} + +// -------- condition variables + +void cond_init(pthread_cond_t* cond) +{ + int status; + pthread_condattr_t attr; + + status = pthread_condattr_init(&attr); + assert(status == 0); + + status = pthread_cond_init(cond, &attr); + assert(status == 0); + + status = pthread_condattr_destroy(&attr); + assert(status == 0); +} + +void cond_destroy(pthread_cond_t* cond) +{ + int status = pthread_cond_destroy(cond); + assert(status == 0); +} + +void cond_signal(pthread_cond_t* cond) +{ + int status = pthread_cond_signal(cond); + assert(status == 0); +} + +void cond_broadcast(pthread_cond_t* cond) +{ + int status = pthread_cond_broadcast(cond); + assert(status == 0); +} + +void cond_wait(pthread_cond_t* cond, pthread_mutex_t* lock) +{ + int status = pthread_cond_wait(cond, lock); + //assert(status == 0); // cannot distinguish signals from spontaneous wakes +} + +void cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* lock, long long millis) +{ + //see https://en.cppreference.com/w/c/chrono/timespec + struct timespec ts; + //timespec_get(&ts, TIME_UTC); + //ts.tv_sec += (time_t) millis / 1000; + //ts.tv_nsec += millis % 1000; + (void)millis; + int status = pthread_cond_timedwait(cond, lock, &ts); +} + +pthread_mutex_t cond_mutex; +pthread_cond_t cond; +int phase = 0; + +void* cond_worker(void* message) +{ + for (bool idle = true; idle; ) + { + mutex_lock(&cond_mutex); + cond_wait(&cond, &cond_mutex); + idle = phase < 1; + mutex_unlock(&cond_mutex); + } + for (bool idle = true; idle; ) + { + mutex_lock(&cond_mutex); + cond_timedwait(&cond, &cond_mutex, 10L); + idle = phase < 2; + mutex_unlock(&cond_mutex); + } + return message; +} + +void cond_test() +{ + void* message = (void*) 42; + mutex_init(&cond_mutex, PTHREAD_MUTEX_NORMAL, PTHREAD_PRIO_NONE, PTHREAD_MUTEX_POLICY_FIRSTFIT_NP, 0); + cond_init(&cond); + + pthread_t worker = thread_create(cond_worker, message); + + { + mutex_lock(&cond_mutex); + ++phase; + cond_signal(&cond); + mutex_unlock(&cond_mutex); + } + + { + mutex_lock(&cond_mutex); + ++phase; + cond_broadcast(&cond); + mutex_unlock(&cond_mutex); + } + + void* result = thread_join(worker); + assert(result == message); + + cond_destroy(&cond); + mutex_destroy(&cond_mutex); +} + +// -------- reader/writer locks + +//from pthread.h for darwin: +//define PTHREAD_PROCESS_SHARED 0 +//define PTHREAD_PROCESS_PRIVATE 1 +void rwlock_init(pthread_rwlock_t* lock, int shared) +{ + int status; + int value; + pthread_rwlockattr_t attributes; + status = pthread_rwlockattr_init(&attributes); + assert(status == 0); + + status = pthread_rwlockattr_setpshared(&attributes, shared); + assert(status == 0); + status = pthread_rwlockattr_getpshared(&attributes, &value); + assert(status == 0);// && value == shared); //TODO Add storage of attribute entries. + + status = pthread_rwlock_init(lock, &attributes); + assert(status == 0); + status = pthread_rwlockattr_destroy(&attributes); + assert(status == 0); +} + +void rwlock_destroy(pthread_rwlock_t* lock) +{ + int status = pthread_rwlock_destroy(lock); + assert(status == 0); +} + +void rwlock_wrlock(pthread_rwlock_t* lock) +{ + int status = pthread_rwlock_wrlock(lock); + assert(status == 0); +} + +bool rwlock_trywrlock(pthread_rwlock_t* lock) +{ + int status = pthread_rwlock_trywrlock(lock); + //assert(status == 0 || status == EBUSY); //TODO Add support for platform-dependent error codes. + return status == 0; +} + +void rwlock_rdlock(pthread_rwlock_t* lock) +{ + int status = pthread_rwlock_rdlock(lock); + assert(status == 0); +} + +bool rwlock_tryrdlock(pthread_rwlock_t* lock) +{ + int status = pthread_rwlock_tryrdlock(lock); + //assert(status == 0 || status == EBUSY); //TODO Add support for platform-dependent error codes. + return status == 0; +} + +void rwlock_unlock(pthread_rwlock_t* lock) +{ + int status = pthread_rwlock_unlock(lock); + assert(status == 0); +} + +void rwlock_test() +{ + pthread_rwlock_t lock; + rwlock_init(&lock, PTHREAD_PROCESS_PRIVATE); + int const test_depth = 4; + + { + rwlock_wrlock(&lock); + bool success = rwlock_trywrlock(&lock); + assert(!success); + success = rwlock_tryrdlock(&lock); + assert(!success); + rwlock_unlock(&lock); + } + + { + __VERIFIER_loop_bound(test_depth); + for (int i = 0; i < test_depth; i++) + { + bool success = rwlock_tryrdlock(&lock); + assert(success); + } + + { + bool success = rwlock_trywrlock(&lock); + assert(!success); + } + + __VERIFIER_loop_bound(test_depth); + for (int i = 0; i < test_depth; i++) { + rwlock_unlock(&lock); + } + } + + { + rwlock_wrlock(&lock); + bool success = rwlock_trywrlock(&lock); + rwlock_unlock(&lock); + } + + rwlock_destroy(&lock); +} + +// -------- thread-local storage + +pthread_t latest_thread; +pthread_key_t local_data; + +void key_destroy(void* unused_value) +{ + latest_thread = pthread_self(); +} + +void* key_worker(void* message) +{ + int my_secret = 1; + + int status = pthread_setspecific(local_data, &my_secret); + assert(status == 0); + + void* my_local_data = pthread_getspecific(local_data); + assert(my_local_data == &my_secret); + + return message; +} + +void key_test() +{ + int my_secret = 2; + void* message = (void*) 41; + int status; + + pthread_key_create(&local_data, key_destroy); + + pthread_t worker = thread_create(key_worker, message); + + status = pthread_setspecific(local_data, &my_secret); + assert(status == 0); + + void* my_local_data = pthread_getspecific(local_data); + assert(my_local_data == &my_secret); + + status = pthread_setspecific(local_data, NULL); + assert(status == 0); + + void* result = thread_join(worker); + assert(result == message); + + status = pthread_key_delete(local_data); + assert(status == 0); + + assert(pthread_equal(latest_thread, worker)); +} + +int main() +{ + mutex_test(); + cond_test(); + rwlock_test(); + key_test(); +} \ No newline at end of file diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java index ac2a939b39..f7bd7a0618 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java @@ -67,6 +67,7 @@ public static Iterable data() throws IOException { {"MP_atomic_bool", IMM, PASS, 1}, {"MP_atomic_bool_weak", IMM, FAIL, 1}, {"nondet_loop", IMM, FAIL, 1}, + {"pthread", IMM, PASS, 1}, {"recursion", IMM, UNKNOWN, 1}, {"recursion", IMM, PASS, 2}, {"thread_chaining", IMM, PASS, 1}, diff --git a/dartagnan/src/test/resources/miscellaneous/pthread.ll b/dartagnan/src/test/resources/miscellaneous/pthread.ll new file mode 100644 index 0000000000..9d4045f75f --- /dev/null +++ b/dartagnan/src/test/resources/miscellaneous/pthread.ll @@ -0,0 +1,2446 @@ +; ModuleID = 'benchmarks/c/miscellaneous/pthread.c' +source_filename = "benchmarks/c/miscellaneous/pthread.c" +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-macosx14.0.0" + +%struct._opaque_pthread_mutex_t = type { i64, [56 x i8] } +%struct._opaque_pthread_cond_t = type { i64, [40 x i8] } +%struct._opaque_pthread_attr_t = type { i64, [56 x i8] } +%struct._opaque_pthread_mutexattr_t = type { i64, [8 x i8] } +%struct._opaque_pthread_condattr_t = type { i64, [8 x i8] } +%struct.timespec = type { i64, i64 } +%struct._opaque_pthread_rwlockattr_t = type { i64, [16 x i8] } +%struct._opaque_pthread_rwlock_t = type { i64, [192 x i8] } + +@__func__.thread_create = private unnamed_addr constant [14 x i8] c"thread_create\00", align 1, !dbg !0 +@.str = private unnamed_addr constant [10 x i8] c"pthread.c\00", align 1, !dbg !8 +@.str.1 = private unnamed_addr constant [12 x i8] c"status == 0\00", align 1, !dbg !13 +@__func__.thread_join = private unnamed_addr constant [12 x i8] c"thread_join\00", align 1, !dbg !18 +@__func__.mutex_init = private unnamed_addr constant [11 x i8] c"mutex_init\00", align 1, !dbg !21 +@__func__.mutex_destroy = private unnamed_addr constant [14 x i8] c"mutex_destroy\00", align 1, !dbg !26 +@__func__.mutex_lock = private unnamed_addr constant [11 x i8] c"mutex_lock\00", align 1, !dbg !28 +@__func__.mutex_unlock = private unnamed_addr constant [13 x i8] c"mutex_unlock\00", align 1, !dbg !30 +@__func__.mutex_test = private unnamed_addr constant [11 x i8] c"mutex_test\00", align 1, !dbg !35 +@.str.2 = private unnamed_addr constant [9 x i8] c"!success\00", align 1, !dbg !37 +@.str.3 = private unnamed_addr constant [8 x i8] c"success\00", align 1, !dbg !42 +@__func__.cond_init = private unnamed_addr constant [10 x i8] c"cond_init\00", align 1, !dbg !47 +@__func__.cond_destroy = private unnamed_addr constant [13 x i8] c"cond_destroy\00", align 1, !dbg !50 +@__func__.cond_signal = private unnamed_addr constant [12 x i8] c"cond_signal\00", align 1, !dbg !52 +@__func__.cond_broadcast = private unnamed_addr constant [15 x i8] c"cond_broadcast\00", align 1, !dbg !54 +@phase = global i32 0, align 4, !dbg !59 +@cond_mutex = global %struct._opaque_pthread_mutex_t zeroinitializer, align 8, !dbg !99 +@cond = global %struct._opaque_pthread_cond_t zeroinitializer, align 8, !dbg !113 +@__func__.cond_test = private unnamed_addr constant [10 x i8] c"cond_test\00", align 1, !dbg !65 +@.str.4 = private unnamed_addr constant [18 x i8] c"result == message\00", align 1, !dbg !67 +@__func__.rwlock_init = private unnamed_addr constant [12 x i8] c"rwlock_init\00", align 1, !dbg !72 +@__func__.rwlock_destroy = private unnamed_addr constant [15 x i8] c"rwlock_destroy\00", align 1, !dbg !74 +@__func__.rwlock_wrlock = private unnamed_addr constant [14 x i8] c"rwlock_wrlock\00", align 1, !dbg !76 +@__func__.rwlock_rdlock = private unnamed_addr constant [14 x i8] c"rwlock_rdlock\00", align 1, !dbg !78 +@__func__.rwlock_unlock = private unnamed_addr constant [14 x i8] c"rwlock_unlock\00", align 1, !dbg !80 +@__func__.rwlock_test = private unnamed_addr constant [12 x i8] c"rwlock_test\00", align 1, !dbg !82 +@latest_thread = global ptr null, align 8, !dbg !125 +@local_data = global i64 0, align 8, !dbg !148 +@__func__.key_worker = private unnamed_addr constant [11 x i8] c"key_worker\00", align 1, !dbg !84 +@.str.5 = private unnamed_addr constant [28 x i8] c"my_local_data == &my_secret\00", align 1, !dbg !86 +@__func__.key_test = private unnamed_addr constant [9 x i8] c"key_test\00", align 1, !dbg !91 +@.str.6 = private unnamed_addr constant [37 x i8] c"pthread_equal(latest_thread, worker)\00", align 1, !dbg !94 + +; Function Attrs: noinline nounwind ssp uwtable +define ptr @thread_create(ptr noundef %0, ptr noundef %1) #0 !dbg !162 { + %3 = alloca ptr, align 8 + %4 = alloca ptr, align 8 + %5 = alloca ptr, align 8 + %6 = alloca %struct._opaque_pthread_attr_t, align 8 + %7 = alloca i32, align 4 + store ptr %0, ptr %3, align 8 + call void @llvm.dbg.declare(metadata ptr %3, metadata !169, metadata !DIExpression()), !dbg !170 + store ptr %1, ptr %4, align 8 + call void @llvm.dbg.declare(metadata ptr %4, metadata !171, metadata !DIExpression()), !dbg !172 + call void @llvm.dbg.declare(metadata ptr %5, metadata !173, metadata !DIExpression()), !dbg !174 + call void @llvm.dbg.declare(metadata ptr %6, metadata !175, metadata !DIExpression()), !dbg !183 + %8 = call i32 @pthread_attr_init(ptr noundef %6), !dbg !184 + call void @llvm.dbg.declare(metadata ptr %7, metadata !185, metadata !DIExpression()), !dbg !186 + %9 = load ptr, ptr %3, align 8, !dbg !187 + %10 = load ptr, ptr %4, align 8, !dbg !188 + %11 = call i32 @pthread_create(ptr noundef %5, ptr noundef %6, ptr noundef %9, ptr noundef %10), !dbg !189 + store i32 %11, ptr %7, align 4, !dbg !186 + %12 = load i32, ptr %7, align 4, !dbg !190 + %13 = icmp eq i32 %12, 0, !dbg !190 + %14 = xor i1 %13, true, !dbg !190 + %15 = zext i1 %14 to i32, !dbg !190 + %16 = sext i32 %15 to i64, !dbg !190 + %17 = icmp ne i64 %16, 0, !dbg !190 + br i1 %17, label %18, label %20, !dbg !190 + +18: ; preds = %2 + call void @__assert_rtn(ptr noundef @__func__.thread_create, ptr noundef @.str, i32 noundef 19, ptr noundef @.str.1) #4, !dbg !190 + unreachable, !dbg !190 + +19: ; No predecessors! + br label %21, !dbg !190 + +20: ; preds = %2 + br label %21, !dbg !190 + +21: ; preds = %20, %19 + %22 = call i32 @pthread_attr_destroy(ptr noundef %6), !dbg !191 + %23 = load ptr, ptr %5, align 8, !dbg !192 + ret ptr %23, !dbg !193 +} + +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 + +declare i32 @pthread_attr_init(ptr noundef) #2 + +declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2 + +; Function Attrs: cold noreturn +declare void @__assert_rtn(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3 + +declare i32 @pthread_attr_destroy(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define ptr @thread_join(ptr noundef %0) #0 !dbg !194 { + %2 = alloca ptr, align 8 + %3 = alloca ptr, align 8 + %4 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !197, metadata !DIExpression()), !dbg !198 + call void @llvm.dbg.declare(metadata ptr %3, metadata !199, metadata !DIExpression()), !dbg !200 + call void @llvm.dbg.declare(metadata ptr %4, metadata !201, metadata !DIExpression()), !dbg !202 + %5 = load ptr, ptr %2, align 8, !dbg !203 + %6 = call i32 @"\01_pthread_join"(ptr noundef %5, ptr noundef %3), !dbg !204 + store i32 %6, ptr %4, align 4, !dbg !202 + %7 = load i32, ptr %4, align 4, !dbg !205 + %8 = icmp eq i32 %7, 0, !dbg !205 + %9 = xor i1 %8, true, !dbg !205 + %10 = zext i1 %9 to i32, !dbg !205 + %11 = sext i32 %10 to i64, !dbg !205 + %12 = icmp ne i64 %11, 0, !dbg !205 + br i1 %12, label %13, label %15, !dbg !205 + +13: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.thread_join, ptr noundef @.str, i32 noundef 28, ptr noundef @.str.1) #4, !dbg !205 + unreachable, !dbg !205 + +14: ; No predecessors! + br label %16, !dbg !205 + +15: ; preds = %1 + br label %16, !dbg !205 + +16: ; preds = %15, %14 + %17 = load ptr, ptr %3, align 8, !dbg !206 + ret ptr %17, !dbg !207 +} + +declare i32 @"\01_pthread_join"(ptr noundef, ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 !dbg !208 { + %6 = alloca ptr, align 8 + %7 = alloca i32, align 4 + %8 = alloca i32, align 4 + %9 = alloca i32, align 4 + %10 = alloca i32, align 4 + %11 = alloca i32, align 4 + %12 = alloca i32, align 4 + %13 = alloca %struct._opaque_pthread_mutexattr_t, align 8 + store ptr %0, ptr %6, align 8 + call void @llvm.dbg.declare(metadata ptr %6, metadata !212, metadata !DIExpression()), !dbg !213 + store i32 %1, ptr %7, align 4 + call void @llvm.dbg.declare(metadata ptr %7, metadata !214, metadata !DIExpression()), !dbg !215 + store i32 %2, ptr %8, align 4 + call void @llvm.dbg.declare(metadata ptr %8, metadata !216, metadata !DIExpression()), !dbg !217 + store i32 %3, ptr %9, align 4 + call void @llvm.dbg.declare(metadata ptr %9, metadata !218, metadata !DIExpression()), !dbg !219 + store i32 %4, ptr %10, align 4 + call void @llvm.dbg.declare(metadata ptr %10, metadata !220, metadata !DIExpression()), !dbg !221 + call void @llvm.dbg.declare(metadata ptr %11, metadata !222, metadata !DIExpression()), !dbg !223 + call void @llvm.dbg.declare(metadata ptr %12, metadata !224, metadata !DIExpression()), !dbg !225 + call void @llvm.dbg.declare(metadata ptr %13, metadata !226, metadata !DIExpression()), !dbg !234 + %14 = call i32 @pthread_mutexattr_init(ptr noundef %13), !dbg !235 + store i32 %14, ptr %11, align 4, !dbg !236 + %15 = load i32, ptr %11, align 4, !dbg !237 + %16 = icmp eq i32 %15, 0, !dbg !237 + %17 = xor i1 %16, true, !dbg !237 + %18 = zext i1 %17 to i32, !dbg !237 + %19 = sext i32 %18 to i64, !dbg !237 + %20 = icmp ne i64 %19, 0, !dbg !237 + br i1 %20, label %21, label %23, !dbg !237 + +21: ; preds = %5 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 50, ptr noundef @.str.1) #4, !dbg !237 + unreachable, !dbg !237 + +22: ; No predecessors! + br label %24, !dbg !237 + +23: ; preds = %5 + br label %24, !dbg !237 + +24: ; preds = %23, %22 + %25 = load i32, ptr %7, align 4, !dbg !238 + %26 = call i32 @pthread_mutexattr_settype(ptr noundef %13, i32 noundef %25), !dbg !239 + store i32 %26, ptr %11, align 4, !dbg !240 + %27 = load i32, ptr %11, align 4, !dbg !241 + %28 = icmp eq i32 %27, 0, !dbg !241 + %29 = xor i1 %28, true, !dbg !241 + %30 = zext i1 %29 to i32, !dbg !241 + %31 = sext i32 %30 to i64, !dbg !241 + %32 = icmp ne i64 %31, 0, !dbg !241 + br i1 %32, label %33, label %35, !dbg !241 + +33: ; preds = %24 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 53, ptr noundef @.str.1) #4, !dbg !241 + unreachable, !dbg !241 + +34: ; No predecessors! + br label %36, !dbg !241 + +35: ; preds = %24 + br label %36, !dbg !241 + +36: ; preds = %35, %34 + %37 = call i32 @pthread_mutexattr_gettype(ptr noundef %13, ptr noundef %12), !dbg !242 + store i32 %37, ptr %11, align 4, !dbg !243 + %38 = load i32, ptr %11, align 4, !dbg !244 + %39 = icmp eq i32 %38, 0, !dbg !244 + %40 = xor i1 %39, true, !dbg !244 + %41 = zext i1 %40 to i32, !dbg !244 + %42 = sext i32 %41 to i64, !dbg !244 + %43 = icmp ne i64 %42, 0, !dbg !244 + br i1 %43, label %44, label %46, !dbg !244 + +44: ; preds = %36 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 55, ptr noundef @.str.1) #4, !dbg !244 + unreachable, !dbg !244 + +45: ; No predecessors! + br label %47, !dbg !244 + +46: ; preds = %36 + br label %47, !dbg !244 + +47: ; preds = %46, %45 + %48 = load i32, ptr %8, align 4, !dbg !245 + %49 = call i32 @pthread_mutexattr_setprotocol(ptr noundef %13, i32 noundef %48), !dbg !246 + store i32 %49, ptr %11, align 4, !dbg !247 + %50 = load i32, ptr %11, align 4, !dbg !248 + %51 = icmp eq i32 %50, 0, !dbg !248 + %52 = xor i1 %51, true, !dbg !248 + %53 = zext i1 %52 to i32, !dbg !248 + %54 = sext i32 %53 to i64, !dbg !248 + %55 = icmp ne i64 %54, 0, !dbg !248 + br i1 %55, label %56, label %58, !dbg !248 + +56: ; preds = %47 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 58, ptr noundef @.str.1) #4, !dbg !248 + unreachable, !dbg !248 + +57: ; No predecessors! + br label %59, !dbg !248 + +58: ; preds = %47 + br label %59, !dbg !248 + +59: ; preds = %58, %57 + %60 = call i32 @pthread_mutexattr_getprotocol(ptr noundef %13, ptr noundef %12), !dbg !249 + store i32 %60, ptr %11, align 4, !dbg !250 + %61 = load i32, ptr %11, align 4, !dbg !251 + %62 = icmp eq i32 %61, 0, !dbg !251 + %63 = xor i1 %62, true, !dbg !251 + %64 = zext i1 %63 to i32, !dbg !251 + %65 = sext i32 %64 to i64, !dbg !251 + %66 = icmp ne i64 %65, 0, !dbg !251 + br i1 %66, label %67, label %69, !dbg !251 + +67: ; preds = %59 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 60, ptr noundef @.str.1) #4, !dbg !251 + unreachable, !dbg !251 + +68: ; No predecessors! + br label %70, !dbg !251 + +69: ; preds = %59 + br label %70, !dbg !251 + +70: ; preds = %69, %68 + %71 = load i32, ptr %9, align 4, !dbg !252 + %72 = call i32 @pthread_mutexattr_setpolicy_np(ptr noundef %13, i32 noundef %71), !dbg !253 + store i32 %72, ptr %11, align 4, !dbg !254 + %73 = load i32, ptr %11, align 4, !dbg !255 + %74 = icmp eq i32 %73, 0, !dbg !255 + %75 = xor i1 %74, true, !dbg !255 + %76 = zext i1 %75 to i32, !dbg !255 + %77 = sext i32 %76 to i64, !dbg !255 + %78 = icmp ne i64 %77, 0, !dbg !255 + br i1 %78, label %79, label %81, !dbg !255 + +79: ; preds = %70 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 63, ptr noundef @.str.1) #4, !dbg !255 + unreachable, !dbg !255 + +80: ; No predecessors! + br label %82, !dbg !255 + +81: ; preds = %70 + br label %82, !dbg !255 + +82: ; preds = %81, %80 + %83 = call i32 @pthread_mutexattr_getpolicy_np(ptr noundef %13, ptr noundef %12), !dbg !256 + store i32 %83, ptr %11, align 4, !dbg !257 + %84 = load i32, ptr %11, align 4, !dbg !258 + %85 = icmp eq i32 %84, 0, !dbg !258 + %86 = xor i1 %85, true, !dbg !258 + %87 = zext i1 %86 to i32, !dbg !258 + %88 = sext i32 %87 to i64, !dbg !258 + %89 = icmp ne i64 %88, 0, !dbg !258 + br i1 %89, label %90, label %92, !dbg !258 + +90: ; preds = %82 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 65, ptr noundef @.str.1) #4, !dbg !258 + unreachable, !dbg !258 + +91: ; No predecessors! + br label %93, !dbg !258 + +92: ; preds = %82 + br label %93, !dbg !258 + +93: ; preds = %92, %91 + %94 = load i32, ptr %10, align 4, !dbg !259 + %95 = call i32 @pthread_mutexattr_setprioceiling(ptr noundef %13, i32 noundef %94), !dbg !260 + store i32 %95, ptr %11, align 4, !dbg !261 + %96 = load i32, ptr %11, align 4, !dbg !262 + %97 = icmp eq i32 %96, 0, !dbg !262 + %98 = xor i1 %97, true, !dbg !262 + %99 = zext i1 %98 to i32, !dbg !262 + %100 = sext i32 %99 to i64, !dbg !262 + %101 = icmp ne i64 %100, 0, !dbg !262 + br i1 %101, label %102, label %104, !dbg !262 + +102: ; preds = %93 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 68, ptr noundef @.str.1) #4, !dbg !262 + unreachable, !dbg !262 + +103: ; No predecessors! + br label %105, !dbg !262 + +104: ; preds = %93 + br label %105, !dbg !262 + +105: ; preds = %104, %103 + %106 = call i32 @pthread_mutexattr_getprioceiling(ptr noundef %13, ptr noundef %12), !dbg !263 + store i32 %106, ptr %11, align 4, !dbg !264 + %107 = load i32, ptr %11, align 4, !dbg !265 + %108 = icmp eq i32 %107, 0, !dbg !265 + %109 = xor i1 %108, true, !dbg !265 + %110 = zext i1 %109 to i32, !dbg !265 + %111 = sext i32 %110 to i64, !dbg !265 + %112 = icmp ne i64 %111, 0, !dbg !265 + br i1 %112, label %113, label %115, !dbg !265 + +113: ; preds = %105 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 70, ptr noundef @.str.1) #4, !dbg !265 + unreachable, !dbg !265 + +114: ; No predecessors! + br label %116, !dbg !265 + +115: ; preds = %105 + br label %116, !dbg !265 + +116: ; preds = %115, %114 + %117 = load ptr, ptr %6, align 8, !dbg !266 + %118 = call i32 @pthread_mutex_init(ptr noundef %117, ptr noundef %13), !dbg !267 + store i32 %118, ptr %11, align 4, !dbg !268 + %119 = load i32, ptr %11, align 4, !dbg !269 + %120 = icmp eq i32 %119, 0, !dbg !269 + %121 = xor i1 %120, true, !dbg !269 + %122 = zext i1 %121 to i32, !dbg !269 + %123 = sext i32 %122 to i64, !dbg !269 + %124 = icmp ne i64 %123, 0, !dbg !269 + br i1 %124, label %125, label %127, !dbg !269 + +125: ; preds = %116 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 73, ptr noundef @.str.1) #4, !dbg !269 + unreachable, !dbg !269 + +126: ; No predecessors! + br label %128, !dbg !269 + +127: ; preds = %116 + br label %128, !dbg !269 + +128: ; preds = %127, %126 + %129 = call i32 @"\01_pthread_mutexattr_destroy"(ptr noundef %13), !dbg !270 + store i32 %129, ptr %11, align 4, !dbg !271 + %130 = load i32, ptr %11, align 4, !dbg !272 + %131 = icmp eq i32 %130, 0, !dbg !272 + %132 = xor i1 %131, true, !dbg !272 + %133 = zext i1 %132 to i32, !dbg !272 + %134 = sext i32 %133 to i64, !dbg !272 + %135 = icmp ne i64 %134, 0, !dbg !272 + br i1 %135, label %136, label %138, !dbg !272 + +136: ; preds = %128 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 75, ptr noundef @.str.1) #4, !dbg !272 + unreachable, !dbg !272 + +137: ; No predecessors! + br label %139, !dbg !272 + +138: ; preds = %128 + br label %139, !dbg !272 + +139: ; preds = %138, %137 + ret void, !dbg !273 +} + +declare i32 @pthread_mutexattr_init(ptr noundef) #2 + +declare i32 @pthread_mutexattr_settype(ptr noundef, i32 noundef) #2 + +declare i32 @pthread_mutexattr_gettype(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_mutexattr_setprotocol(ptr noundef, i32 noundef) #2 + +declare i32 @pthread_mutexattr_getprotocol(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_mutexattr_setpolicy_np(ptr noundef, i32 noundef) #2 + +declare i32 @pthread_mutexattr_getpolicy_np(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_mutexattr_setprioceiling(ptr noundef, i32 noundef) #2 + +declare i32 @pthread_mutexattr_getprioceiling(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) #2 + +declare i32 @"\01_pthread_mutexattr_destroy"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @mutex_destroy(ptr noundef %0) #0 !dbg !274 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !277, metadata !DIExpression()), !dbg !278 + call void @llvm.dbg.declare(metadata ptr %3, metadata !279, metadata !DIExpression()), !dbg !280 + %4 = load ptr, ptr %2, align 8, !dbg !281 + %5 = call i32 @pthread_mutex_destroy(ptr noundef %4), !dbg !282 + store i32 %5, ptr %3, align 4, !dbg !280 + %6 = load i32, ptr %3, align 4, !dbg !283 + %7 = icmp eq i32 %6, 0, !dbg !283 + %8 = xor i1 %7, true, !dbg !283 + %9 = zext i1 %8 to i32, !dbg !283 + %10 = sext i32 %9 to i64, !dbg !283 + %11 = icmp ne i64 %10, 0, !dbg !283 + br i1 %11, label %12, label %14, !dbg !283 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.mutex_destroy, ptr noundef @.str, i32 noundef 81, ptr noundef @.str.1) #4, !dbg !283 + unreachable, !dbg !283 + +13: ; No predecessors! + br label %15, !dbg !283 + +14: ; preds = %1 + br label %15, !dbg !283 + +15: ; preds = %14, %13 + ret void, !dbg !284 +} + +declare i32 @pthread_mutex_destroy(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @mutex_lock(ptr noundef %0) #0 !dbg !285 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !286, metadata !DIExpression()), !dbg !287 + call void @llvm.dbg.declare(metadata ptr %3, metadata !288, metadata !DIExpression()), !dbg !289 + %4 = load ptr, ptr %2, align 8, !dbg !290 + %5 = call i32 @pthread_mutex_lock(ptr noundef %4), !dbg !291 + store i32 %5, ptr %3, align 4, !dbg !289 + %6 = load i32, ptr %3, align 4, !dbg !292 + %7 = icmp eq i32 %6, 0, !dbg !292 + %8 = xor i1 %7, true, !dbg !292 + %9 = zext i1 %8 to i32, !dbg !292 + %10 = sext i32 %9 to i64, !dbg !292 + %11 = icmp ne i64 %10, 0, !dbg !292 + br i1 %11, label %12, label %14, !dbg !292 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.mutex_lock, ptr noundef @.str, i32 noundef 87, ptr noundef @.str.1) #4, !dbg !292 + unreachable, !dbg !292 + +13: ; No predecessors! + br label %15, !dbg !292 + +14: ; preds = %1 + br label %15, !dbg !292 + +15: ; preds = %14, %13 + ret void, !dbg !293 +} + +declare i32 @pthread_mutex_lock(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define zeroext i1 @mutex_trylock(ptr noundef %0) #0 !dbg !294 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !298, metadata !DIExpression()), !dbg !299 + call void @llvm.dbg.declare(metadata ptr %3, metadata !300, metadata !DIExpression()), !dbg !301 + %4 = load ptr, ptr %2, align 8, !dbg !302 + %5 = call i32 @pthread_mutex_trylock(ptr noundef %4), !dbg !303 + store i32 %5, ptr %3, align 4, !dbg !301 + %6 = load i32, ptr %3, align 4, !dbg !304 + %7 = icmp eq i32 %6, 0, !dbg !305 + ret i1 %7, !dbg !306 +} + +declare i32 @pthread_mutex_trylock(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @mutex_unlock(ptr noundef %0) #0 !dbg !307 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !308, metadata !DIExpression()), !dbg !309 + call void @llvm.dbg.declare(metadata ptr %3, metadata !310, metadata !DIExpression()), !dbg !311 + %4 = load ptr, ptr %2, align 8, !dbg !312 + %5 = call i32 @pthread_mutex_unlock(ptr noundef %4), !dbg !313 + store i32 %5, ptr %3, align 4, !dbg !311 + %6 = load i32, ptr %3, align 4, !dbg !314 + %7 = icmp eq i32 %6, 0, !dbg !314 + %8 = xor i1 %7, true, !dbg !314 + %9 = zext i1 %8 to i32, !dbg !314 + %10 = sext i32 %9 to i64, !dbg !314 + %11 = icmp ne i64 %10, 0, !dbg !314 + br i1 %11, label %12, label %14, !dbg !314 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.mutex_unlock, ptr noundef @.str, i32 noundef 100, ptr noundef @.str.1) #4, !dbg !314 + unreachable, !dbg !314 + +13: ; No predecessors! + br label %15, !dbg !314 + +14: ; preds = %1 + br label %15, !dbg !314 + +15: ; preds = %14, %13 + ret void, !dbg !315 +} + +declare i32 @pthread_mutex_unlock(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @mutex_test() #0 !dbg !316 { + %1 = alloca %struct._opaque_pthread_mutex_t, align 8 + %2 = alloca %struct._opaque_pthread_mutex_t, align 8 + %3 = alloca i8, align 1 + %4 = alloca i8, align 1 + %5 = alloca i8, align 1 + call void @llvm.dbg.declare(metadata ptr %1, metadata !319, metadata !DIExpression()), !dbg !320 + call void @llvm.dbg.declare(metadata ptr %2, metadata !321, metadata !DIExpression()), !dbg !322 + call void @mutex_init(ptr noundef %1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1), !dbg !323 + call void @mutex_init(ptr noundef %2, i32 noundef 2, i32 noundef 2, i32 noundef 3, i32 noundef 2), !dbg !324 + call void @mutex_lock(ptr noundef %1), !dbg !325 + call void @llvm.dbg.declare(metadata ptr %3, metadata !327, metadata !DIExpression()), !dbg !328 + %6 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !329 + %7 = zext i1 %6 to i8, !dbg !328 + store i8 %7, ptr %3, align 1, !dbg !328 + %8 = load i8, ptr %3, align 1, !dbg !330 + %9 = trunc i8 %8 to i1, !dbg !330 + %10 = xor i1 %9, true, !dbg !330 + %11 = xor i1 %10, true, !dbg !330 + %12 = zext i1 %11 to i32, !dbg !330 + %13 = sext i32 %12 to i64, !dbg !330 + %14 = icmp ne i64 %13, 0, !dbg !330 + br i1 %14, label %15, label %17, !dbg !330 + +15: ; preds = %0 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 114, ptr noundef @.str.2) #4, !dbg !330 + unreachable, !dbg !330 + +16: ; No predecessors! + br label %18, !dbg !330 + +17: ; preds = %0 + br label %18, !dbg !330 + +18: ; preds = %17, %16 + call void @mutex_unlock(ptr noundef %1), !dbg !331 + call void @mutex_lock(ptr noundef %2), !dbg !332 + call void @llvm.dbg.declare(metadata ptr %4, metadata !334, metadata !DIExpression()), !dbg !336 + %19 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !337 + %20 = zext i1 %19 to i8, !dbg !336 + store i8 %20, ptr %4, align 1, !dbg !336 + %21 = load i8, ptr %4, align 1, !dbg !338 + %22 = trunc i8 %21 to i1, !dbg !338 + %23 = xor i1 %22, true, !dbg !338 + %24 = zext i1 %23 to i32, !dbg !338 + %25 = sext i32 %24 to i64, !dbg !338 + %26 = icmp ne i64 %25, 0, !dbg !338 + br i1 %26, label %27, label %29, !dbg !338 + +27: ; preds = %18 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 123, ptr noundef @.str.3) #4, !dbg !338 + unreachable, !dbg !338 + +28: ; No predecessors! + br label %30, !dbg !338 + +29: ; preds = %18 + br label %30, !dbg !338 + +30: ; preds = %29, %28 + call void @mutex_unlock(ptr noundef %1), !dbg !339 + call void @llvm.dbg.declare(metadata ptr %5, metadata !340, metadata !DIExpression()), !dbg !342 + %31 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !343 + %32 = zext i1 %31 to i8, !dbg !342 + store i8 %32, ptr %5, align 1, !dbg !342 + %33 = load i8, ptr %5, align 1, !dbg !344 + %34 = trunc i8 %33 to i1, !dbg !344 + %35 = xor i1 %34, true, !dbg !344 + %36 = zext i1 %35 to i32, !dbg !344 + %37 = sext i32 %36 to i64, !dbg !344 + %38 = icmp ne i64 %37, 0, !dbg !344 + br i1 %38, label %39, label %41, !dbg !344 + +39: ; preds = %30 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 129, ptr noundef @.str.3) #4, !dbg !344 + unreachable, !dbg !344 + +40: ; No predecessors! + br label %42, !dbg !344 + +41: ; preds = %30 + br label %42, !dbg !344 + +42: ; preds = %41, %40 + call void @mutex_unlock(ptr noundef %1), !dbg !345 + call void @mutex_unlock(ptr noundef %2), !dbg !346 + call void @mutex_destroy(ptr noundef %2), !dbg !347 + call void @mutex_destroy(ptr noundef %1), !dbg !348 + ret void, !dbg !349 +} + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_init(ptr noundef %0) #0 !dbg !350 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + %4 = alloca %struct._opaque_pthread_condattr_t, align 8 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !354, metadata !DIExpression()), !dbg !355 + call void @llvm.dbg.declare(metadata ptr %3, metadata !356, metadata !DIExpression()), !dbg !357 + call void @llvm.dbg.declare(metadata ptr %4, metadata !358, metadata !DIExpression()), !dbg !366 + %5 = call i32 @pthread_condattr_init(ptr noundef %4), !dbg !367 + store i32 %5, ptr %3, align 4, !dbg !368 + %6 = load i32, ptr %3, align 4, !dbg !369 + %7 = icmp eq i32 %6, 0, !dbg !369 + %8 = xor i1 %7, true, !dbg !369 + %9 = zext i1 %8 to i32, !dbg !369 + %10 = sext i32 %9 to i64, !dbg !369 + %11 = icmp ne i64 %10, 0, !dbg !369 + br i1 %11, label %12, label %14, !dbg !369 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 155, ptr noundef @.str.1) #4, !dbg !369 + unreachable, !dbg !369 + +13: ; No predecessors! + br label %15, !dbg !369 + +14: ; preds = %1 + br label %15, !dbg !369 + +15: ; preds = %14, %13 + %16 = load ptr, ptr %2, align 8, !dbg !370 + %17 = call i32 @"\01_pthread_cond_init"(ptr noundef %16, ptr noundef %4), !dbg !371 + store i32 %17, ptr %3, align 4, !dbg !372 + %18 = load i32, ptr %3, align 4, !dbg !373 + %19 = icmp eq i32 %18, 0, !dbg !373 + %20 = xor i1 %19, true, !dbg !373 + %21 = zext i1 %20 to i32, !dbg !373 + %22 = sext i32 %21 to i64, !dbg !373 + %23 = icmp ne i64 %22, 0, !dbg !373 + br i1 %23, label %24, label %26, !dbg !373 + +24: ; preds = %15 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 158, ptr noundef @.str.1) #4, !dbg !373 + unreachable, !dbg !373 + +25: ; No predecessors! + br label %27, !dbg !373 + +26: ; preds = %15 + br label %27, !dbg !373 + +27: ; preds = %26, %25 + %28 = call i32 @pthread_condattr_destroy(ptr noundef %4), !dbg !374 + store i32 %28, ptr %3, align 4, !dbg !375 + %29 = load i32, ptr %3, align 4, !dbg !376 + %30 = icmp eq i32 %29, 0, !dbg !376 + %31 = xor i1 %30, true, !dbg !376 + %32 = zext i1 %31 to i32, !dbg !376 + %33 = sext i32 %32 to i64, !dbg !376 + %34 = icmp ne i64 %33, 0, !dbg !376 + br i1 %34, label %35, label %37, !dbg !376 + +35: ; preds = %27 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 161, ptr noundef @.str.1) #4, !dbg !376 + unreachable, !dbg !376 + +36: ; No predecessors! + br label %38, !dbg !376 + +37: ; preds = %27 + br label %38, !dbg !376 + +38: ; preds = %37, %36 + ret void, !dbg !377 +} + +declare i32 @pthread_condattr_init(ptr noundef) #2 + +declare i32 @"\01_pthread_cond_init"(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_condattr_destroy(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_destroy(ptr noundef %0) #0 !dbg !378 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !379, metadata !DIExpression()), !dbg !380 + call void @llvm.dbg.declare(metadata ptr %3, metadata !381, metadata !DIExpression()), !dbg !382 + %4 = load ptr, ptr %2, align 8, !dbg !383 + %5 = call i32 @pthread_cond_destroy(ptr noundef %4), !dbg !384 + store i32 %5, ptr %3, align 4, !dbg !382 + %6 = load i32, ptr %3, align 4, !dbg !385 + %7 = icmp eq i32 %6, 0, !dbg !385 + %8 = xor i1 %7, true, !dbg !385 + %9 = zext i1 %8 to i32, !dbg !385 + %10 = sext i32 %9 to i64, !dbg !385 + %11 = icmp ne i64 %10, 0, !dbg !385 + br i1 %11, label %12, label %14, !dbg !385 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.cond_destroy, ptr noundef @.str, i32 noundef 167, ptr noundef @.str.1) #4, !dbg !385 + unreachable, !dbg !385 + +13: ; No predecessors! + br label %15, !dbg !385 + +14: ; preds = %1 + br label %15, !dbg !385 + +15: ; preds = %14, %13 + ret void, !dbg !386 +} + +declare i32 @pthread_cond_destroy(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_signal(ptr noundef %0) #0 !dbg !387 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !388, metadata !DIExpression()), !dbg !389 + call void @llvm.dbg.declare(metadata ptr %3, metadata !390, metadata !DIExpression()), !dbg !391 + %4 = load ptr, ptr %2, align 8, !dbg !392 + %5 = call i32 @pthread_cond_signal(ptr noundef %4), !dbg !393 + store i32 %5, ptr %3, align 4, !dbg !391 + %6 = load i32, ptr %3, align 4, !dbg !394 + %7 = icmp eq i32 %6, 0, !dbg !394 + %8 = xor i1 %7, true, !dbg !394 + %9 = zext i1 %8 to i32, !dbg !394 + %10 = sext i32 %9 to i64, !dbg !394 + %11 = icmp ne i64 %10, 0, !dbg !394 + br i1 %11, label %12, label %14, !dbg !394 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.cond_signal, ptr noundef @.str, i32 noundef 173, ptr noundef @.str.1) #4, !dbg !394 + unreachable, !dbg !394 + +13: ; No predecessors! + br label %15, !dbg !394 + +14: ; preds = %1 + br label %15, !dbg !394 + +15: ; preds = %14, %13 + ret void, !dbg !395 +} + +declare i32 @pthread_cond_signal(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_broadcast(ptr noundef %0) #0 !dbg !396 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !397, metadata !DIExpression()), !dbg !398 + call void @llvm.dbg.declare(metadata ptr %3, metadata !399, metadata !DIExpression()), !dbg !400 + %4 = load ptr, ptr %2, align 8, !dbg !401 + %5 = call i32 @pthread_cond_broadcast(ptr noundef %4), !dbg !402 + store i32 %5, ptr %3, align 4, !dbg !400 + %6 = load i32, ptr %3, align 4, !dbg !403 + %7 = icmp eq i32 %6, 0, !dbg !403 + %8 = xor i1 %7, true, !dbg !403 + %9 = zext i1 %8 to i32, !dbg !403 + %10 = sext i32 %9 to i64, !dbg !403 + %11 = icmp ne i64 %10, 0, !dbg !403 + br i1 %11, label %12, label %14, !dbg !403 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.cond_broadcast, ptr noundef @.str, i32 noundef 179, ptr noundef @.str.1) #4, !dbg !403 + unreachable, !dbg !403 + +13: ; No predecessors! + br label %15, !dbg !403 + +14: ; preds = %1 + br label %15, !dbg !403 + +15: ; preds = %14, %13 + ret void, !dbg !404 +} + +declare i32 @pthread_cond_broadcast(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_wait(ptr noundef %0, ptr noundef %1) #0 !dbg !405 { + %3 = alloca ptr, align 8 + %4 = alloca ptr, align 8 + %5 = alloca i32, align 4 + store ptr %0, ptr %3, align 8 + call void @llvm.dbg.declare(metadata ptr %3, metadata !408, metadata !DIExpression()), !dbg !409 + store ptr %1, ptr %4, align 8 + call void @llvm.dbg.declare(metadata ptr %4, metadata !410, metadata !DIExpression()), !dbg !411 + call void @llvm.dbg.declare(metadata ptr %5, metadata !412, metadata !DIExpression()), !dbg !413 + %6 = load ptr, ptr %3, align 8, !dbg !414 + %7 = load ptr, ptr %4, align 8, !dbg !415 + %8 = call i32 @"\01_pthread_cond_wait"(ptr noundef %6, ptr noundef %7), !dbg !416 + store i32 %8, ptr %5, align 4, !dbg !413 + ret void, !dbg !417 +} + +declare i32 @"\01_pthread_cond_wait"(ptr noundef, ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 !dbg !418 { + %4 = alloca ptr, align 8 + %5 = alloca ptr, align 8 + %6 = alloca i64, align 8 + %7 = alloca %struct.timespec, align 8 + %8 = alloca i32, align 4 + store ptr %0, ptr %4, align 8 + call void @llvm.dbg.declare(metadata ptr %4, metadata !422, metadata !DIExpression()), !dbg !423 + store ptr %1, ptr %5, align 8 + call void @llvm.dbg.declare(metadata ptr %5, metadata !424, metadata !DIExpression()), !dbg !425 + store i64 %2, ptr %6, align 8 + call void @llvm.dbg.declare(metadata ptr %6, metadata !426, metadata !DIExpression()), !dbg !427 + call void @llvm.dbg.declare(metadata ptr %7, metadata !428, metadata !DIExpression()), !dbg !436 + %9 = load i64, ptr %6, align 8, !dbg !437 + call void @llvm.dbg.declare(metadata ptr %8, metadata !438, metadata !DIExpression()), !dbg !439 + %10 = load ptr, ptr %4, align 8, !dbg !440 + %11 = load ptr, ptr %5, align 8, !dbg !441 + %12 = call i32 @"\01_pthread_cond_timedwait"(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !442 + store i32 %12, ptr %8, align 4, !dbg !439 + ret void, !dbg !443 +} + +declare i32 @"\01_pthread_cond_timedwait"(ptr noundef, ptr noundef, ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define ptr @cond_worker(ptr noundef %0) #0 !dbg !444 { + %2 = alloca ptr, align 8 + %3 = alloca i8, align 1 + %4 = alloca i8, align 1 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !445, metadata !DIExpression()), !dbg !446 + call void @llvm.dbg.declare(metadata ptr %3, metadata !447, metadata !DIExpression()), !dbg !449 + store i8 1, ptr %3, align 1, !dbg !449 + br label %5, !dbg !450 + +5: ; preds = %8, %1 + %6 = load i8, ptr %3, align 1, !dbg !451 + %7 = trunc i8 %6 to i1, !dbg !451 + br i1 %7, label %8, label %12, !dbg !453 + +8: ; preds = %5 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !454 + call void @cond_wait(ptr noundef @cond, ptr noundef @cond_mutex), !dbg !456 + %9 = load i32, ptr @phase, align 4, !dbg !457 + %10 = icmp slt i32 %9, 1, !dbg !458 + %11 = zext i1 %10 to i8, !dbg !459 + store i8 %11, ptr %3, align 1, !dbg !459 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !460 + br label %5, !dbg !461, !llvm.loop !462 + +12: ; preds = %5 + call void @llvm.dbg.declare(metadata ptr %4, metadata !465, metadata !DIExpression()), !dbg !467 + store i8 1, ptr %4, align 1, !dbg !467 + br label %13, !dbg !468 + +13: ; preds = %16, %12 + %14 = load i8, ptr %4, align 1, !dbg !469 + %15 = trunc i8 %14 to i1, !dbg !469 + br i1 %15, label %16, label %20, !dbg !471 + +16: ; preds = %13 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !472 + call void @cond_timedwait(ptr noundef @cond, ptr noundef @cond_mutex, i64 noundef 10), !dbg !474 + %17 = load i32, ptr @phase, align 4, !dbg !475 + %18 = icmp slt i32 %17, 2, !dbg !476 + %19 = zext i1 %18 to i8, !dbg !477 + store i8 %19, ptr %4, align 1, !dbg !477 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !478 + br label %13, !dbg !479, !llvm.loop !480 + +20: ; preds = %13 + %21 = load ptr, ptr %2, align 8, !dbg !482 + ret ptr %21, !dbg !483 +} + +; Function Attrs: noinline nounwind ssp uwtable +define void @cond_test() #0 !dbg !484 { + %1 = alloca ptr, align 8 + %2 = alloca ptr, align 8 + %3 = alloca ptr, align 8 + call void @llvm.dbg.declare(metadata ptr %1, metadata !485, metadata !DIExpression()), !dbg !486 + store ptr inttoptr (i64 42 to ptr), ptr %1, align 8, !dbg !486 + call void @mutex_init(ptr noundef @cond_mutex, i32 noundef 0, i32 noundef 0, i32 noundef 3, i32 noundef 0), !dbg !487 + call void @cond_init(ptr noundef @cond), !dbg !488 + call void @llvm.dbg.declare(metadata ptr %2, metadata !489, metadata !DIExpression()), !dbg !490 + %4 = load ptr, ptr %1, align 8, !dbg !491 + %5 = call ptr @thread_create(ptr noundef @cond_worker, ptr noundef %4), !dbg !492 + store ptr %5, ptr %2, align 8, !dbg !490 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !493 + %6 = load i32, ptr @phase, align 4, !dbg !495 + %7 = add nsw i32 %6, 1, !dbg !495 + store i32 %7, ptr @phase, align 4, !dbg !495 + call void @cond_signal(ptr noundef @cond), !dbg !496 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !497 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !498 + %8 = load i32, ptr @phase, align 4, !dbg !500 + %9 = add nsw i32 %8, 1, !dbg !500 + store i32 %9, ptr @phase, align 4, !dbg !500 + call void @cond_broadcast(ptr noundef @cond), !dbg !501 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !502 + call void @llvm.dbg.declare(metadata ptr %3, metadata !503, metadata !DIExpression()), !dbg !504 + %10 = load ptr, ptr %2, align 8, !dbg !505 + %11 = call ptr @thread_join(ptr noundef %10), !dbg !506 + store ptr %11, ptr %3, align 8, !dbg !504 + %12 = load ptr, ptr %3, align 8, !dbg !507 + %13 = load ptr, ptr %1, align 8, !dbg !507 + %14 = icmp eq ptr %12, %13, !dbg !507 + %15 = xor i1 %14, true, !dbg !507 + %16 = zext i1 %15 to i32, !dbg !507 + %17 = sext i32 %16 to i64, !dbg !507 + %18 = icmp ne i64 %17, 0, !dbg !507 + br i1 %18, label %19, label %21, !dbg !507 + +19: ; preds = %0 + call void @__assert_rtn(ptr noundef @__func__.cond_test, ptr noundef @.str, i32 noundef 245, ptr noundef @.str.4) #4, !dbg !507 + unreachable, !dbg !507 + +20: ; No predecessors! + br label %22, !dbg !507 + +21: ; preds = %0 + br label %22, !dbg !507 + +22: ; preds = %21, %20 + call void @cond_destroy(ptr noundef @cond), !dbg !508 + call void @mutex_destroy(ptr noundef @cond_mutex), !dbg !509 + ret void, !dbg !510 +} + +; Function Attrs: noinline nounwind ssp uwtable +define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { + %3 = alloca ptr, align 8 + %4 = alloca i32, align 4 + %5 = alloca i32, align 4 + %6 = alloca i32, align 4 + %7 = alloca %struct._opaque_pthread_rwlockattr_t, align 8 + store ptr %0, ptr %3, align 8 + call void @llvm.dbg.declare(metadata ptr %3, metadata !525, metadata !DIExpression()), !dbg !526 + store i32 %1, ptr %4, align 4 + call void @llvm.dbg.declare(metadata ptr %4, metadata !527, metadata !DIExpression()), !dbg !528 + call void @llvm.dbg.declare(metadata ptr %5, metadata !529, metadata !DIExpression()), !dbg !530 + call void @llvm.dbg.declare(metadata ptr %6, metadata !531, metadata !DIExpression()), !dbg !532 + call void @llvm.dbg.declare(metadata ptr %7, metadata !533, metadata !DIExpression()), !dbg !544 + %8 = call i32 @pthread_rwlockattr_init(ptr noundef %7), !dbg !545 + store i32 %8, ptr %5, align 4, !dbg !546 + %9 = load i32, ptr %5, align 4, !dbg !547 + %10 = icmp eq i32 %9, 0, !dbg !547 + %11 = xor i1 %10, true, !dbg !547 + %12 = zext i1 %11 to i32, !dbg !547 + %13 = sext i32 %12 to i64, !dbg !547 + %14 = icmp ne i64 %13, 0, !dbg !547 + br i1 %14, label %15, label %17, !dbg !547 + +15: ; preds = %2 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 262, ptr noundef @.str.1) #4, !dbg !547 + unreachable, !dbg !547 + +16: ; No predecessors! + br label %18, !dbg !547 + +17: ; preds = %2 + br label %18, !dbg !547 + +18: ; preds = %17, %16 + %19 = load i32, ptr %4, align 4, !dbg !548 + %20 = call i32 @pthread_rwlockattr_setpshared(ptr noundef %7, i32 noundef %19), !dbg !549 + store i32 %20, ptr %5, align 4, !dbg !550 + %21 = load i32, ptr %5, align 4, !dbg !551 + %22 = icmp eq i32 %21, 0, !dbg !551 + %23 = xor i1 %22, true, !dbg !551 + %24 = zext i1 %23 to i32, !dbg !551 + %25 = sext i32 %24 to i64, !dbg !551 + %26 = icmp ne i64 %25, 0, !dbg !551 + br i1 %26, label %27, label %29, !dbg !551 + +27: ; preds = %18 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 265, ptr noundef @.str.1) #4, !dbg !551 + unreachable, !dbg !551 + +28: ; No predecessors! + br label %30, !dbg !551 + +29: ; preds = %18 + br label %30, !dbg !551 + +30: ; preds = %29, %28 + %31 = call i32 @pthread_rwlockattr_getpshared(ptr noundef %7, ptr noundef %6), !dbg !552 + store i32 %31, ptr %5, align 4, !dbg !553 + %32 = load i32, ptr %5, align 4, !dbg !554 + %33 = icmp eq i32 %32, 0, !dbg !554 + %34 = xor i1 %33, true, !dbg !554 + %35 = zext i1 %34 to i32, !dbg !554 + %36 = sext i32 %35 to i64, !dbg !554 + %37 = icmp ne i64 %36, 0, !dbg !554 + br i1 %37, label %38, label %40, !dbg !554 + +38: ; preds = %30 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 267, ptr noundef @.str.1) #4, !dbg !554 + unreachable, !dbg !554 + +39: ; No predecessors! + br label %41, !dbg !554 + +40: ; preds = %30 + br label %41, !dbg !554 + +41: ; preds = %40, %39 + %42 = load ptr, ptr %3, align 8, !dbg !555 + %43 = call i32 @"\01_pthread_rwlock_init"(ptr noundef %42, ptr noundef %7), !dbg !556 + store i32 %43, ptr %5, align 4, !dbg !557 + %44 = load i32, ptr %5, align 4, !dbg !558 + %45 = icmp eq i32 %44, 0, !dbg !558 + %46 = xor i1 %45, true, !dbg !558 + %47 = zext i1 %46 to i32, !dbg !558 + %48 = sext i32 %47 to i64, !dbg !558 + %49 = icmp ne i64 %48, 0, !dbg !558 + br i1 %49, label %50, label %52, !dbg !558 + +50: ; preds = %41 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 270, ptr noundef @.str.1) #4, !dbg !558 + unreachable, !dbg !558 + +51: ; No predecessors! + br label %53, !dbg !558 + +52: ; preds = %41 + br label %53, !dbg !558 + +53: ; preds = %52, %51 + %54 = call i32 @pthread_rwlockattr_destroy(ptr noundef %7), !dbg !559 + store i32 %54, ptr %5, align 4, !dbg !560 + %55 = load i32, ptr %5, align 4, !dbg !561 + %56 = icmp eq i32 %55, 0, !dbg !561 + %57 = xor i1 %56, true, !dbg !561 + %58 = zext i1 %57 to i32, !dbg !561 + %59 = sext i32 %58 to i64, !dbg !561 + %60 = icmp ne i64 %59, 0, !dbg !561 + br i1 %60, label %61, label %63, !dbg !561 + +61: ; preds = %53 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 272, ptr noundef @.str.1) #4, !dbg !561 + unreachable, !dbg !561 + +62: ; No predecessors! + br label %64, !dbg !561 + +63: ; preds = %53 + br label %64, !dbg !561 + +64: ; preds = %63, %62 + ret void, !dbg !562 +} + +declare i32 @pthread_rwlockattr_init(ptr noundef) #2 + +declare i32 @pthread_rwlockattr_setpshared(ptr noundef, i32 noundef) #2 + +declare i32 @pthread_rwlockattr_getpshared(ptr noundef, ptr noundef) #2 + +declare i32 @"\01_pthread_rwlock_init"(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_rwlockattr_destroy(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !566, metadata !DIExpression()), !dbg !567 + call void @llvm.dbg.declare(metadata ptr %3, metadata !568, metadata !DIExpression()), !dbg !569 + %4 = load ptr, ptr %2, align 8, !dbg !570 + %5 = call i32 @"\01_pthread_rwlock_destroy"(ptr noundef %4), !dbg !571 + store i32 %5, ptr %3, align 4, !dbg !569 + %6 = load i32, ptr %3, align 4, !dbg !572 + %7 = icmp eq i32 %6, 0, !dbg !572 + %8 = xor i1 %7, true, !dbg !572 + %9 = zext i1 %8 to i32, !dbg !572 + %10 = sext i32 %9 to i64, !dbg !572 + %11 = icmp ne i64 %10, 0, !dbg !572 + br i1 %11, label %12, label %14, !dbg !572 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.rwlock_destroy, ptr noundef @.str, i32 noundef 278, ptr noundef @.str.1) #4, !dbg !572 + unreachable, !dbg !572 + +13: ; No predecessors! + br label %15, !dbg !572 + +14: ; preds = %1 + br label %15, !dbg !572 + +15: ; preds = %14, %13 + ret void, !dbg !573 +} + +declare i32 @"\01_pthread_rwlock_destroy"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !575, metadata !DIExpression()), !dbg !576 + call void @llvm.dbg.declare(metadata ptr %3, metadata !577, metadata !DIExpression()), !dbg !578 + %4 = load ptr, ptr %2, align 8, !dbg !579 + %5 = call i32 @"\01_pthread_rwlock_wrlock"(ptr noundef %4), !dbg !580 + store i32 %5, ptr %3, align 4, !dbg !578 + %6 = load i32, ptr %3, align 4, !dbg !581 + %7 = icmp eq i32 %6, 0, !dbg !581 + %8 = xor i1 %7, true, !dbg !581 + %9 = zext i1 %8 to i32, !dbg !581 + %10 = sext i32 %9 to i64, !dbg !581 + %11 = icmp ne i64 %10, 0, !dbg !581 + br i1 %11, label %12, label %14, !dbg !581 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.rwlock_wrlock, ptr noundef @.str, i32 noundef 284, ptr noundef @.str.1) #4, !dbg !581 + unreachable, !dbg !581 + +13: ; No predecessors! + br label %15, !dbg !581 + +14: ; preds = %1 + br label %15, !dbg !581 + +15: ; preds = %14, %13 + ret void, !dbg !582 +} + +declare i32 @"\01_pthread_rwlock_wrlock"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !583 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !586, metadata !DIExpression()), !dbg !587 + call void @llvm.dbg.declare(metadata ptr %3, metadata !588, metadata !DIExpression()), !dbg !589 + %4 = load ptr, ptr %2, align 8, !dbg !590 + %5 = call i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef %4), !dbg !591 + store i32 %5, ptr %3, align 4, !dbg !589 + %6 = load i32, ptr %3, align 4, !dbg !592 + %7 = icmp eq i32 %6, 0, !dbg !593 + ret i1 %7, !dbg !594 +} + +declare i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !596, metadata !DIExpression()), !dbg !597 + call void @llvm.dbg.declare(metadata ptr %3, metadata !598, metadata !DIExpression()), !dbg !599 + %4 = load ptr, ptr %2, align 8, !dbg !600 + %5 = call i32 @"\01_pthread_rwlock_rdlock"(ptr noundef %4), !dbg !601 + store i32 %5, ptr %3, align 4, !dbg !599 + %6 = load i32, ptr %3, align 4, !dbg !602 + %7 = icmp eq i32 %6, 0, !dbg !602 + %8 = xor i1 %7, true, !dbg !602 + %9 = zext i1 %8 to i32, !dbg !602 + %10 = sext i32 %9 to i64, !dbg !602 + %11 = icmp ne i64 %10, 0, !dbg !602 + br i1 %11, label %12, label %14, !dbg !602 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.rwlock_rdlock, ptr noundef @.str, i32 noundef 297, ptr noundef @.str.1) #4, !dbg !602 + unreachable, !dbg !602 + +13: ; No predecessors! + br label %15, !dbg !602 + +14: ; preds = %1 + br label %15, !dbg !602 + +15: ; preds = %14, %13 + ret void, !dbg !603 +} + +declare i32 @"\01_pthread_rwlock_rdlock"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !604 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !605, metadata !DIExpression()), !dbg !606 + call void @llvm.dbg.declare(metadata ptr %3, metadata !607, metadata !DIExpression()), !dbg !608 + %4 = load ptr, ptr %2, align 8, !dbg !609 + %5 = call i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef %4), !dbg !610 + store i32 %5, ptr %3, align 4, !dbg !608 + %6 = load i32, ptr %3, align 4, !dbg !611 + %7 = icmp eq i32 %6, 0, !dbg !612 + ret i1 %7, !dbg !613 +} + +declare i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !615, metadata !DIExpression()), !dbg !616 + call void @llvm.dbg.declare(metadata ptr %3, metadata !617, metadata !DIExpression()), !dbg !618 + %4 = load ptr, ptr %2, align 8, !dbg !619 + %5 = call i32 @"\01_pthread_rwlock_unlock"(ptr noundef %4), !dbg !620 + store i32 %5, ptr %3, align 4, !dbg !618 + %6 = load i32, ptr %3, align 4, !dbg !621 + %7 = icmp eq i32 %6, 0, !dbg !621 + %8 = xor i1 %7, true, !dbg !621 + %9 = zext i1 %8 to i32, !dbg !621 + %10 = sext i32 %9 to i64, !dbg !621 + %11 = icmp ne i64 %10, 0, !dbg !621 + br i1 %11, label %12, label %14, !dbg !621 + +12: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.rwlock_unlock, ptr noundef @.str, i32 noundef 310, ptr noundef @.str.1) #4, !dbg !621 + unreachable, !dbg !621 + +13: ; No predecessors! + br label %15, !dbg !621 + +14: ; preds = %1 + br label %15, !dbg !621 + +15: ; preds = %14, %13 + ret void, !dbg !622 +} + +declare i32 @"\01_pthread_rwlock_unlock"(ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @rwlock_test() #0 !dbg !623 { + %1 = alloca %struct._opaque_pthread_rwlock_t, align 8 + %2 = alloca i32, align 4 + %3 = alloca i8, align 1 + %4 = alloca i32, align 4 + %5 = alloca i8, align 1 + %6 = alloca i8, align 1 + %7 = alloca i32, align 4 + %8 = alloca i8, align 1 + call void @llvm.dbg.declare(metadata ptr %1, metadata !624, metadata !DIExpression()), !dbg !625 + call void @rwlock_init(ptr noundef %1, i32 noundef 2), !dbg !626 + call void @llvm.dbg.declare(metadata ptr %2, metadata !627, metadata !DIExpression()), !dbg !629 + store i32 4, ptr %2, align 4, !dbg !629 + call void @rwlock_wrlock(ptr noundef %1), !dbg !630 + call void @llvm.dbg.declare(metadata ptr %3, metadata !632, metadata !DIExpression()), !dbg !633 + %9 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !634 + %10 = zext i1 %9 to i8, !dbg !633 + store i8 %10, ptr %3, align 1, !dbg !633 + %11 = load i8, ptr %3, align 1, !dbg !635 + %12 = trunc i8 %11 to i1, !dbg !635 + %13 = xor i1 %12, true, !dbg !635 + %14 = xor i1 %13, true, !dbg !635 + %15 = zext i1 %14 to i32, !dbg !635 + %16 = sext i32 %15 to i64, !dbg !635 + %17 = icmp ne i64 %16, 0, !dbg !635 + br i1 %17, label %18, label %20, !dbg !635 + +18: ; preds = %0 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 322, ptr noundef @.str.2) #4, !dbg !635 + unreachable, !dbg !635 + +19: ; No predecessors! + br label %21, !dbg !635 + +20: ; preds = %0 + br label %21, !dbg !635 + +21: ; preds = %20, %19 + %22 = call zeroext i1 @rwlock_tryrdlock(ptr noundef %1), !dbg !636 + %23 = zext i1 %22 to i8, !dbg !637 + store i8 %23, ptr %3, align 1, !dbg !637 + %24 = load i8, ptr %3, align 1, !dbg !638 + %25 = trunc i8 %24 to i1, !dbg !638 + %26 = xor i1 %25, true, !dbg !638 + %27 = xor i1 %26, true, !dbg !638 + %28 = zext i1 %27 to i32, !dbg !638 + %29 = sext i32 %28 to i64, !dbg !638 + %30 = icmp ne i64 %29, 0, !dbg !638 + br i1 %30, label %31, label %33, !dbg !638 + +31: ; preds = %21 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 324, ptr noundef @.str.2) #4, !dbg !638 + unreachable, !dbg !638 + +32: ; No predecessors! + br label %34, !dbg !638 + +33: ; preds = %21 + br label %34, !dbg !638 + +34: ; preds = %33, %32 + call void @rwlock_unlock(ptr noundef %1), !dbg !639 + call void @__VERIFIER_loop_bound(i32 noundef 4), !dbg !640 + call void @llvm.dbg.declare(metadata ptr %4, metadata !642, metadata !DIExpression()), !dbg !644 + store i32 0, ptr %4, align 4, !dbg !644 + br label %35, !dbg !645 + +35: ; preds = %51, %34 + %36 = load i32, ptr %4, align 4, !dbg !646 + %37 = icmp slt i32 %36, 4, !dbg !648 + br i1 %37, label %38, label %54, !dbg !649 + +38: ; preds = %35 + call void @llvm.dbg.declare(metadata ptr %5, metadata !650, metadata !DIExpression()), !dbg !652 + %39 = call zeroext i1 @rwlock_tryrdlock(ptr noundef %1), !dbg !653 + %40 = zext i1 %39 to i8, !dbg !652 + store i8 %40, ptr %5, align 1, !dbg !652 + %41 = load i8, ptr %5, align 1, !dbg !654 + %42 = trunc i8 %41 to i1, !dbg !654 + %43 = xor i1 %42, true, !dbg !654 + %44 = zext i1 %43 to i32, !dbg !654 + %45 = sext i32 %44 to i64, !dbg !654 + %46 = icmp ne i64 %45, 0, !dbg !654 + br i1 %46, label %47, label %49, !dbg !654 + +47: ; preds = %38 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 333, ptr noundef @.str.3) #4, !dbg !654 + unreachable, !dbg !654 + +48: ; No predecessors! + br label %50, !dbg !654 + +49: ; preds = %38 + br label %50, !dbg !654 + +50: ; preds = %49, %48 + br label %51, !dbg !655 + +51: ; preds = %50 + %52 = load i32, ptr %4, align 4, !dbg !656 + %53 = add nsw i32 %52, 1, !dbg !656 + store i32 %53, ptr %4, align 4, !dbg !656 + br label %35, !dbg !657, !llvm.loop !658 + +54: ; preds = %35 + call void @llvm.dbg.declare(metadata ptr %6, metadata !660, metadata !DIExpression()), !dbg !662 + %55 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !663 + %56 = zext i1 %55 to i8, !dbg !662 + store i8 %56, ptr %6, align 1, !dbg !662 + %57 = load i8, ptr %6, align 1, !dbg !664 + %58 = trunc i8 %57 to i1, !dbg !664 + %59 = xor i1 %58, true, !dbg !664 + %60 = xor i1 %59, true, !dbg !664 + %61 = zext i1 %60 to i32, !dbg !664 + %62 = sext i32 %61 to i64, !dbg !664 + %63 = icmp ne i64 %62, 0, !dbg !664 + br i1 %63, label %64, label %66, !dbg !664 + +64: ; preds = %54 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 338, ptr noundef @.str.2) #4, !dbg !664 + unreachable, !dbg !664 + +65: ; No predecessors! + br label %67, !dbg !664 + +66: ; preds = %54 + br label %67, !dbg !664 + +67: ; preds = %66, %65 + call void @__VERIFIER_loop_bound(i32 noundef 4), !dbg !665 + call void @llvm.dbg.declare(metadata ptr %7, metadata !666, metadata !DIExpression()), !dbg !668 + store i32 0, ptr %7, align 4, !dbg !668 + br label %68, !dbg !669 + +68: ; preds = %72, %67 + %69 = load i32, ptr %7, align 4, !dbg !670 + %70 = icmp slt i32 %69, 4, !dbg !672 + br i1 %70, label %71, label %75, !dbg !673 + +71: ; preds = %68 + call void @rwlock_unlock(ptr noundef %1), !dbg !674 + br label %72, !dbg !676 + +72: ; preds = %71 + %73 = load i32, ptr %7, align 4, !dbg !677 + %74 = add nsw i32 %73, 1, !dbg !677 + store i32 %74, ptr %7, align 4, !dbg !677 + br label %68, !dbg !678, !llvm.loop !679 + +75: ; preds = %68 + call void @rwlock_wrlock(ptr noundef %1), !dbg !681 + call void @llvm.dbg.declare(metadata ptr %8, metadata !683, metadata !DIExpression()), !dbg !684 + %76 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !685 + %77 = zext i1 %76 to i8, !dbg !684 + store i8 %77, ptr %8, align 1, !dbg !684 + call void @rwlock_unlock(ptr noundef %1), !dbg !686 + call void @rwlock_destroy(ptr noundef %1), !dbg !687 + ret void, !dbg !688 +} + +declare void @__VERIFIER_loop_bound(i32 noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @key_destroy(ptr noundef %0) #0 !dbg !689 { + %2 = alloca ptr, align 8 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !690, metadata !DIExpression()), !dbg !691 + %3 = call ptr @pthread_self(), !dbg !692 + store ptr %3, ptr @latest_thread, align 8, !dbg !693 + ret void, !dbg !694 +} + +declare ptr @pthread_self() #2 + +; Function Attrs: noinline nounwind ssp uwtable +define ptr @key_worker(ptr noundef %0) #0 !dbg !695 { + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + %4 = alloca i32, align 4 + %5 = alloca ptr, align 8 + store ptr %0, ptr %2, align 8 + call void @llvm.dbg.declare(metadata ptr %2, metadata !696, metadata !DIExpression()), !dbg !697 + call void @llvm.dbg.declare(metadata ptr %3, metadata !698, metadata !DIExpression()), !dbg !699 + store i32 1, ptr %3, align 4, !dbg !699 + call void @llvm.dbg.declare(metadata ptr %4, metadata !700, metadata !DIExpression()), !dbg !701 + %6 = load i64, ptr @local_data, align 8, !dbg !702 + %7 = call i32 @pthread_setspecific(i64 noundef %6, ptr noundef %3), !dbg !703 + store i32 %7, ptr %4, align 4, !dbg !701 + %8 = load i32, ptr %4, align 4, !dbg !704 + %9 = icmp eq i32 %8, 0, !dbg !704 + %10 = xor i1 %9, true, !dbg !704 + %11 = zext i1 %10 to i32, !dbg !704 + %12 = sext i32 %11 to i64, !dbg !704 + %13 = icmp ne i64 %12, 0, !dbg !704 + br i1 %13, label %14, label %16, !dbg !704 + +14: ; preds = %1 + call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 371, ptr noundef @.str.1) #4, !dbg !704 + unreachable, !dbg !704 + +15: ; No predecessors! + br label %17, !dbg !704 + +16: ; preds = %1 + br label %17, !dbg !704 + +17: ; preds = %16, %15 + call void @llvm.dbg.declare(metadata ptr %5, metadata !705, metadata !DIExpression()), !dbg !706 + %18 = load i64, ptr @local_data, align 8, !dbg !707 + %19 = call ptr @pthread_getspecific(i64 noundef %18), !dbg !708 + store ptr %19, ptr %5, align 8, !dbg !706 + %20 = load ptr, ptr %5, align 8, !dbg !709 + %21 = icmp eq ptr %20, %3, !dbg !709 + %22 = xor i1 %21, true, !dbg !709 + %23 = zext i1 %22 to i32, !dbg !709 + %24 = sext i32 %23 to i64, !dbg !709 + %25 = icmp ne i64 %24, 0, !dbg !709 + br i1 %25, label %26, label %28, !dbg !709 + +26: ; preds = %17 + call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 374, ptr noundef @.str.5) #4, !dbg !709 + unreachable, !dbg !709 + +27: ; No predecessors! + br label %29, !dbg !709 + +28: ; preds = %17 + br label %29, !dbg !709 + +29: ; preds = %28, %27 + %30 = load ptr, ptr %2, align 8, !dbg !710 + ret ptr %30, !dbg !711 +} + +declare i32 @pthread_setspecific(i64 noundef, ptr noundef) #2 + +declare ptr @pthread_getspecific(i64 noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define void @key_test() #0 !dbg !712 { + %1 = alloca i32, align 4 + %2 = alloca ptr, align 8 + %3 = alloca i32, align 4 + %4 = alloca ptr, align 8 + %5 = alloca ptr, align 8 + %6 = alloca ptr, align 8 + call void @llvm.dbg.declare(metadata ptr %1, metadata !713, metadata !DIExpression()), !dbg !714 + store i32 2, ptr %1, align 4, !dbg !714 + call void @llvm.dbg.declare(metadata ptr %2, metadata !715, metadata !DIExpression()), !dbg !716 + store ptr inttoptr (i64 41 to ptr), ptr %2, align 8, !dbg !716 + call void @llvm.dbg.declare(metadata ptr %3, metadata !717, metadata !DIExpression()), !dbg !718 + %7 = call i32 @pthread_key_create(ptr noundef @local_data, ptr noundef @key_destroy), !dbg !719 + call void @llvm.dbg.declare(metadata ptr %4, metadata !720, metadata !DIExpression()), !dbg !721 + %8 = load ptr, ptr %2, align 8, !dbg !722 + %9 = call ptr @thread_create(ptr noundef @key_worker, ptr noundef %8), !dbg !723 + store ptr %9, ptr %4, align 8, !dbg !721 + %10 = load i64, ptr @local_data, align 8, !dbg !724 + %11 = call i32 @pthread_setspecific(i64 noundef %10, ptr noundef %1), !dbg !725 + store i32 %11, ptr %3, align 4, !dbg !726 + %12 = load i32, ptr %3, align 4, !dbg !727 + %13 = icmp eq i32 %12, 0, !dbg !727 + %14 = xor i1 %13, true, !dbg !727 + %15 = zext i1 %14 to i32, !dbg !727 + %16 = sext i32 %15 to i64, !dbg !727 + %17 = icmp ne i64 %16, 0, !dbg !727 + br i1 %17, label %18, label %20, !dbg !727 + +18: ; preds = %0 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 390, ptr noundef @.str.1) #4, !dbg !727 + unreachable, !dbg !727 + +19: ; No predecessors! + br label %21, !dbg !727 + +20: ; preds = %0 + br label %21, !dbg !727 + +21: ; preds = %20, %19 + call void @llvm.dbg.declare(metadata ptr %5, metadata !728, metadata !DIExpression()), !dbg !729 + %22 = load i64, ptr @local_data, align 8, !dbg !730 + %23 = call ptr @pthread_getspecific(i64 noundef %22), !dbg !731 + store ptr %23, ptr %5, align 8, !dbg !729 + %24 = load ptr, ptr %5, align 8, !dbg !732 + %25 = icmp eq ptr %24, %1, !dbg !732 + %26 = xor i1 %25, true, !dbg !732 + %27 = zext i1 %26 to i32, !dbg !732 + %28 = sext i32 %27 to i64, !dbg !732 + %29 = icmp ne i64 %28, 0, !dbg !732 + br i1 %29, label %30, label %32, !dbg !732 + +30: ; preds = %21 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 393, ptr noundef @.str.5) #4, !dbg !732 + unreachable, !dbg !732 + +31: ; No predecessors! + br label %33, !dbg !732 + +32: ; preds = %21 + br label %33, !dbg !732 + +33: ; preds = %32, %31 + %34 = load i64, ptr @local_data, align 8, !dbg !733 + %35 = call i32 @pthread_setspecific(i64 noundef %34, ptr noundef null), !dbg !734 + store i32 %35, ptr %3, align 4, !dbg !735 + %36 = load i32, ptr %3, align 4, !dbg !736 + %37 = icmp eq i32 %36, 0, !dbg !736 + %38 = xor i1 %37, true, !dbg !736 + %39 = zext i1 %38 to i32, !dbg !736 + %40 = sext i32 %39 to i64, !dbg !736 + %41 = icmp ne i64 %40, 0, !dbg !736 + br i1 %41, label %42, label %44, !dbg !736 + +42: ; preds = %33 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 396, ptr noundef @.str.1) #4, !dbg !736 + unreachable, !dbg !736 + +43: ; No predecessors! + br label %45, !dbg !736 + +44: ; preds = %33 + br label %45, !dbg !736 + +45: ; preds = %44, %43 + call void @llvm.dbg.declare(metadata ptr %6, metadata !737, metadata !DIExpression()), !dbg !738 + %46 = load ptr, ptr %4, align 8, !dbg !739 + %47 = call ptr @thread_join(ptr noundef %46), !dbg !740 + store ptr %47, ptr %6, align 8, !dbg !738 + %48 = load ptr, ptr %6, align 8, !dbg !741 + %49 = load ptr, ptr %2, align 8, !dbg !741 + %50 = icmp eq ptr %48, %49, !dbg !741 + %51 = xor i1 %50, true, !dbg !741 + %52 = zext i1 %51 to i32, !dbg !741 + %53 = sext i32 %52 to i64, !dbg !741 + %54 = icmp ne i64 %53, 0, !dbg !741 + br i1 %54, label %55, label %57, !dbg !741 + +55: ; preds = %45 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 399, ptr noundef @.str.4) #4, !dbg !741 + unreachable, !dbg !741 + +56: ; No predecessors! + br label %58, !dbg !741 + +57: ; preds = %45 + br label %58, !dbg !741 + +58: ; preds = %57, %56 + %59 = load i64, ptr @local_data, align 8, !dbg !742 + %60 = call i32 @pthread_key_delete(i64 noundef %59), !dbg !743 + store i32 %60, ptr %3, align 4, !dbg !744 + %61 = load i32, ptr %3, align 4, !dbg !745 + %62 = icmp eq i32 %61, 0, !dbg !745 + %63 = xor i1 %62, true, !dbg !745 + %64 = zext i1 %63 to i32, !dbg !745 + %65 = sext i32 %64 to i64, !dbg !745 + %66 = icmp ne i64 %65, 0, !dbg !745 + br i1 %66, label %67, label %69, !dbg !745 + +67: ; preds = %58 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 402, ptr noundef @.str.1) #4, !dbg !745 + unreachable, !dbg !745 + +68: ; No predecessors! + br label %70, !dbg !745 + +69: ; preds = %58 + br label %70, !dbg !745 + +70: ; preds = %69, %68 + %71 = load ptr, ptr @latest_thread, align 8, !dbg !746 + %72 = load ptr, ptr %4, align 8, !dbg !746 + %73 = call i32 @pthread_equal(ptr noundef %71, ptr noundef %72), !dbg !746 + %74 = icmp ne i32 %73, 0, !dbg !746 + %75 = xor i1 %74, true, !dbg !746 + %76 = zext i1 %75 to i32, !dbg !746 + %77 = sext i32 %76 to i64, !dbg !746 + %78 = icmp ne i64 %77, 0, !dbg !746 + br i1 %78, label %79, label %81, !dbg !746 + +79: ; preds = %70 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 404, ptr noundef @.str.6) #4, !dbg !746 + unreachable, !dbg !746 + +80: ; No predecessors! + br label %82, !dbg !746 + +81: ; preds = %70 + br label %82, !dbg !746 + +82: ; preds = %81, %80 + ret void, !dbg !747 +} + +declare i32 @pthread_key_create(ptr noundef, ptr noundef) #2 + +declare i32 @pthread_key_delete(i64 noundef) #2 + +declare i32 @pthread_equal(ptr noundef, ptr noundef) #2 + +; Function Attrs: noinline nounwind ssp uwtable +define i32 @main() #0 !dbg !748 { + call void @mutex_test(), !dbg !751 + call void @cond_test(), !dbg !752 + call void @rwlock_test(), !dbg !753 + call void @key_test(), !dbg !754 + ret i32 0, !dbg !755 +} + +attributes #0 = { noinline nounwind ssp uwtable "frame-pointer"="non-leaf" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.5a,+zcm,+zcz" } +attributes #1 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #2 = { "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.5a,+zcm,+zcz" } +attributes #3 = { cold noreturn "disable-tail-calls"="true" "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.5a,+zcm,+zcz" } +attributes #4 = { cold noreturn } + +!llvm.dbg.cu = !{!61} +!llvm.module.flags = !{!155, !156, !157, !158, !159, !160} +!llvm.ident = !{!161} + +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) +!1 = distinct !DIGlobalVariable(scope: null, file: !2, line: 19, type: !3, isLocal: true, isDefinition: true) +!2 = !DIFile(filename: "benchmarks/c/miscellaneous/pthread.c", directory: "/Users/r/Documents/Dat3M") +!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 112, elements: !6) +!4 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5) +!5 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) +!6 = !{!7} +!7 = !DISubrange(count: 14) +!8 = !DIGlobalVariableExpression(var: !9, expr: !DIExpression()) +!9 = distinct !DIGlobalVariable(scope: null, file: !2, line: 19, type: !10, isLocal: true, isDefinition: true) +!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 80, elements: !11) +!11 = !{!12} +!12 = !DISubrange(count: 10) +!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression()) +!14 = distinct !DIGlobalVariable(scope: null, file: !2, line: 19, type: !15, isLocal: true, isDefinition: true) +!15 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 96, elements: !16) +!16 = !{!17} +!17 = !DISubrange(count: 12) +!18 = !DIGlobalVariableExpression(var: !19, expr: !DIExpression()) +!19 = distinct !DIGlobalVariable(scope: null, file: !2, line: 28, type: !20, isLocal: true, isDefinition: true) +!20 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 96, elements: !16) +!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression()) +!22 = distinct !DIGlobalVariable(scope: null, file: !2, line: 50, type: !23, isLocal: true, isDefinition: true) +!23 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 88, elements: !24) +!24 = !{!25} +!25 = !DISubrange(count: 11) +!26 = !DIGlobalVariableExpression(var: !27, expr: !DIExpression()) +!27 = distinct !DIGlobalVariable(scope: null, file: !2, line: 81, type: !3, isLocal: true, isDefinition: true) +!28 = !DIGlobalVariableExpression(var: !29, expr: !DIExpression()) +!29 = distinct !DIGlobalVariable(scope: null, file: !2, line: 87, type: !23, isLocal: true, isDefinition: true) +!30 = !DIGlobalVariableExpression(var: !31, expr: !DIExpression()) +!31 = distinct !DIGlobalVariable(scope: null, file: !2, line: 100, type: !32, isLocal: true, isDefinition: true) +!32 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 104, elements: !33) +!33 = !{!34} +!34 = !DISubrange(count: 13) +!35 = !DIGlobalVariableExpression(var: !36, expr: !DIExpression()) +!36 = distinct !DIGlobalVariable(scope: null, file: !2, line: 114, type: !23, isLocal: true, isDefinition: true) +!37 = !DIGlobalVariableExpression(var: !38, expr: !DIExpression()) +!38 = distinct !DIGlobalVariable(scope: null, file: !2, line: 114, type: !39, isLocal: true, isDefinition: true) +!39 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 72, elements: !40) +!40 = !{!41} +!41 = !DISubrange(count: 9) +!42 = !DIGlobalVariableExpression(var: !43, expr: !DIExpression()) +!43 = distinct !DIGlobalVariable(scope: null, file: !2, line: 123, type: !44, isLocal: true, isDefinition: true) +!44 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 64, elements: !45) +!45 = !{!46} +!46 = !DISubrange(count: 8) +!47 = !DIGlobalVariableExpression(var: !48, expr: !DIExpression()) +!48 = distinct !DIGlobalVariable(scope: null, file: !2, line: 155, type: !49, isLocal: true, isDefinition: true) +!49 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 80, elements: !11) +!50 = !DIGlobalVariableExpression(var: !51, expr: !DIExpression()) +!51 = distinct !DIGlobalVariable(scope: null, file: !2, line: 167, type: !32, isLocal: true, isDefinition: true) +!52 = !DIGlobalVariableExpression(var: !53, expr: !DIExpression()) +!53 = distinct !DIGlobalVariable(scope: null, file: !2, line: 173, type: !20, isLocal: true, isDefinition: true) +!54 = !DIGlobalVariableExpression(var: !55, expr: !DIExpression()) +!55 = distinct !DIGlobalVariable(scope: null, file: !2, line: 179, type: !56, isLocal: true, isDefinition: true) +!56 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 120, elements: !57) +!57 = !{!58} +!58 = !DISubrange(count: 15) +!59 = !DIGlobalVariableExpression(var: !60, expr: !DIExpression()) +!60 = distinct !DIGlobalVariable(name: "phase", scope: !61, file: !2, line: 201, type: !154, isLocal: false, isDefinition: true) +!61 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "Homebrew clang version 15.0.7", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !62, globals: !64, splitDebugInlining: false, nameTableKind: None, sysroot: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk", sdk: "MacOSX13.sdk") +!62 = !{!63} +!63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +!64 = !{!0, !8, !13, !18, !21, !26, !28, !30, !35, !37, !42, !47, !50, !52, !54, !59, !65, !67, !72, !74, !76, !78, !80, !82, !84, !86, !91, !94, !99, !113, !125, !148} +!65 = !DIGlobalVariableExpression(var: !66, expr: !DIExpression()) +!66 = distinct !DIGlobalVariable(scope: null, file: !2, line: 245, type: !49, isLocal: true, isDefinition: true) +!67 = !DIGlobalVariableExpression(var: !68, expr: !DIExpression()) +!68 = distinct !DIGlobalVariable(scope: null, file: !2, line: 245, type: !69, isLocal: true, isDefinition: true) +!69 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 144, elements: !70) +!70 = !{!71} +!71 = !DISubrange(count: 18) +!72 = !DIGlobalVariableExpression(var: !73, expr: !DIExpression()) +!73 = distinct !DIGlobalVariable(scope: null, file: !2, line: 262, type: !20, isLocal: true, isDefinition: true) +!74 = !DIGlobalVariableExpression(var: !75, expr: !DIExpression()) +!75 = distinct !DIGlobalVariable(scope: null, file: !2, line: 278, type: !56, isLocal: true, isDefinition: true) +!76 = !DIGlobalVariableExpression(var: !77, expr: !DIExpression()) +!77 = distinct !DIGlobalVariable(scope: null, file: !2, line: 284, type: !3, isLocal: true, isDefinition: true) +!78 = !DIGlobalVariableExpression(var: !79, expr: !DIExpression()) +!79 = distinct !DIGlobalVariable(scope: null, file: !2, line: 297, type: !3, isLocal: true, isDefinition: true) +!80 = !DIGlobalVariableExpression(var: !81, expr: !DIExpression()) +!81 = distinct !DIGlobalVariable(scope: null, file: !2, line: 310, type: !3, isLocal: true, isDefinition: true) +!82 = !DIGlobalVariableExpression(var: !83, expr: !DIExpression()) +!83 = distinct !DIGlobalVariable(scope: null, file: !2, line: 322, type: !20, isLocal: true, isDefinition: true) +!84 = !DIGlobalVariableExpression(var: !85, expr: !DIExpression()) +!85 = distinct !DIGlobalVariable(scope: null, file: !2, line: 371, type: !23, isLocal: true, isDefinition: true) +!86 = !DIGlobalVariableExpression(var: !87, expr: !DIExpression()) +!87 = distinct !DIGlobalVariable(scope: null, file: !2, line: 374, type: !88, isLocal: true, isDefinition: true) +!88 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 224, elements: !89) +!89 = !{!90} +!90 = !DISubrange(count: 28) +!91 = !DIGlobalVariableExpression(var: !92, expr: !DIExpression()) +!92 = distinct !DIGlobalVariable(scope: null, file: !2, line: 390, type: !93, isLocal: true, isDefinition: true) +!93 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 72, elements: !40) +!94 = !DIGlobalVariableExpression(var: !95, expr: !DIExpression()) +!95 = distinct !DIGlobalVariable(scope: null, file: !2, line: 404, type: !96, isLocal: true, isDefinition: true) +!96 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 296, elements: !97) +!97 = !{!98} +!98 = !DISubrange(count: 37) +!99 = !DIGlobalVariableExpression(var: !100, expr: !DIExpression()) +!100 = distinct !DIGlobalVariable(name: "cond_mutex", scope: !61, file: !2, line: 199, type: !101, isLocal: false, isDefinition: true) +!101 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutex_t", file: !102, line: 31, baseType: !103) +!102 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h", directory: "") +!103 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutex_t", file: !104, line: 113, baseType: !105) +!104 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_types.h", directory: "") +!105 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutex_t", file: !104, line: 78, size: 512, elements: !106) +!106 = !{!107, !109} +!107 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !105, file: !104, line: 79, baseType: !108, size: 64) +!108 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed) +!109 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !105, file: !104, line: 80, baseType: !110, size: 448, offset: 64) +!110 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 448, elements: !111) +!111 = !{!112} +!112 = !DISubrange(count: 56) +!113 = !DIGlobalVariableExpression(var: !114, expr: !DIExpression()) +!114 = distinct !DIGlobalVariable(name: "cond", scope: !61, file: !2, line: 200, type: !115, isLocal: false, isDefinition: true) +!115 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_cond_t", file: !116, line: 31, baseType: !117) +!116 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_cond_t.h", directory: "") +!117 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_cond_t", file: !104, line: 110, baseType: !118) +!118 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_cond_t", file: !104, line: 68, size: 384, elements: !119) +!119 = !{!120, !121} +!120 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !118, file: !104, line: 69, baseType: !108, size: 64) +!121 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !118, file: !104, line: 70, baseType: !122, size: 320, offset: 64) +!122 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 320, elements: !123) +!123 = !{!124} +!124 = !DISubrange(count: 40) +!125 = !DIGlobalVariableExpression(var: !126, expr: !DIExpression()) +!126 = distinct !DIGlobalVariable(name: "latest_thread", scope: !61, file: !2, line: 358, type: !127, isLocal: false, isDefinition: true) +!127 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_t", file: !128, line: 31, baseType: !129) +!128 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_t.h", directory: "") +!129 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_t", file: !104, line: 118, baseType: !130) +!130 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !131, size: 64) +!131 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_t", file: !104, line: 103, size: 65536, elements: !132) +!132 = !{!133, !134, !144} +!133 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !131, file: !104, line: 104, baseType: !108, size: 64) +!134 = !DIDerivedType(tag: DW_TAG_member, name: "__cleanup_stack", scope: !131, file: !104, line: 105, baseType: !135, size: 64, offset: 64) +!135 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !136, size: 64) +!136 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__darwin_pthread_handler_rec", file: !104, line: 57, size: 192, elements: !137) +!137 = !{!138, !142, !143} +!138 = !DIDerivedType(tag: DW_TAG_member, name: "__routine", scope: !136, file: !104, line: 58, baseType: !139, size: 64) +!139 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !140, size: 64) +!140 = !DISubroutineType(types: !141) +!141 = !{null, !63} +!142 = !DIDerivedType(tag: DW_TAG_member, name: "__arg", scope: !136, file: !104, line: 59, baseType: !63, size: 64, offset: 64) +!143 = !DIDerivedType(tag: DW_TAG_member, name: "__next", scope: !136, file: !104, line: 60, baseType: !135, size: 64, offset: 128) +!144 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !131, file: !104, line: 106, baseType: !145, size: 65408, offset: 128) +!145 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 65408, elements: !146) +!146 = !{!147} +!147 = !DISubrange(count: 8176) +!148 = !DIGlobalVariableExpression(var: !149, expr: !DIExpression()) +!149 = distinct !DIGlobalVariable(name: "local_data", scope: !61, file: !2, line: 359, type: !150, isLocal: false, isDefinition: true) +!150 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_key_t", file: !151, line: 31, baseType: !152) +!151 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_key_t.h", directory: "") +!152 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_key_t", file: !104, line: 112, baseType: !153) +!153 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned) +!154 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!155 = !{i32 7, !"Dwarf Version", i32 4} +!156 = !{i32 2, !"Debug Info Version", i32 3} +!157 = !{i32 1, !"wchar_size", i32 4} +!158 = !{i32 7, !"PIC Level", i32 2} +!159 = !{i32 7, !"uwtable", i32 2} +!160 = !{i32 7, !"frame-pointer", i32 1} +!161 = !{!"Homebrew clang version 15.0.7"} +!162 = distinct !DISubprogram(name: "thread_create", scope: !2, file: !2, line: 13, type: !163, scopeLine: 14, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!163 = !DISubroutineType(types: !164) +!164 = !{!127, !165, !63} +!165 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !166, size: 64) +!166 = !DISubroutineType(types: !167) +!167 = !{!63, !63} +!168 = !{} +!169 = !DILocalVariable(name: "runner", arg: 1, scope: !162, file: !2, line: 13, type: !165) +!170 = !DILocation(line: 13, column: 32, scope: !162) +!171 = !DILocalVariable(name: "data", arg: 2, scope: !162, file: !2, line: 13, type: !63) +!172 = !DILocation(line: 13, column: 54, scope: !162) +!173 = !DILocalVariable(name: "id", scope: !162, file: !2, line: 15, type: !127) +!174 = !DILocation(line: 15, column: 15, scope: !162) +!175 = !DILocalVariable(name: "attr", scope: !162, file: !2, line: 16, type: !176) +!176 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_attr_t", file: !177, line: 31, baseType: !178) +!177 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_attr_t.h", directory: "") +!178 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_attr_t", file: !104, line: 109, baseType: !179) +!179 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_attr_t", file: !104, line: 63, size: 512, elements: !180) +!180 = !{!181, !182} +!181 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !179, file: !104, line: 64, baseType: !108, size: 64) +!182 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !179, file: !104, line: 65, baseType: !110, size: 448, offset: 64) +!183 = !DILocation(line: 16, column: 20, scope: !162) +!184 = !DILocation(line: 17, column: 5, scope: !162) +!185 = !DILocalVariable(name: "status", scope: !162, file: !2, line: 18, type: !154) +!186 = !DILocation(line: 18, column: 9, scope: !162) +!187 = !DILocation(line: 18, column: 45, scope: !162) +!188 = !DILocation(line: 18, column: 53, scope: !162) +!189 = !DILocation(line: 18, column: 18, scope: !162) +!190 = !DILocation(line: 19, column: 5, scope: !162) +!191 = !DILocation(line: 20, column: 5, scope: !162) +!192 = !DILocation(line: 21, column: 12, scope: !162) +!193 = !DILocation(line: 21, column: 5, scope: !162) +!194 = distinct !DISubprogram(name: "thread_join", scope: !2, file: !2, line: 24, type: !195, scopeLine: 25, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!195 = !DISubroutineType(types: !196) +!196 = !{!63, !127} +!197 = !DILocalVariable(name: "id", arg: 1, scope: !194, file: !2, line: 24, type: !127) +!198 = !DILocation(line: 24, column: 29, scope: !194) +!199 = !DILocalVariable(name: "result", scope: !194, file: !2, line: 26, type: !63) +!200 = !DILocation(line: 26, column: 11, scope: !194) +!201 = !DILocalVariable(name: "status", scope: !194, file: !2, line: 27, type: !154) +!202 = !DILocation(line: 27, column: 9, scope: !194) +!203 = !DILocation(line: 27, column: 31, scope: !194) +!204 = !DILocation(line: 27, column: 18, scope: !194) +!205 = !DILocation(line: 28, column: 5, scope: !194) +!206 = !DILocation(line: 29, column: 12, scope: !194) +!207 = !DILocation(line: 29, column: 5, scope: !194) +!208 = distinct !DISubprogram(name: "mutex_init", scope: !2, file: !2, line: 44, type: !209, scopeLine: 45, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!209 = !DISubroutineType(types: !210) +!210 = !{null, !211, !154, !154, !154, !154} +!211 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !101, size: 64) +!212 = !DILocalVariable(name: "lock", arg: 1, scope: !208, file: !2, line: 44, type: !211) +!213 = !DILocation(line: 44, column: 34, scope: !208) +!214 = !DILocalVariable(name: "type", arg: 2, scope: !208, file: !2, line: 44, type: !154) +!215 = !DILocation(line: 44, column: 44, scope: !208) +!216 = !DILocalVariable(name: "protocol", arg: 3, scope: !208, file: !2, line: 44, type: !154) +!217 = !DILocation(line: 44, column: 54, scope: !208) +!218 = !DILocalVariable(name: "policy", arg: 4, scope: !208, file: !2, line: 44, type: !154) +!219 = !DILocation(line: 44, column: 68, scope: !208) +!220 = !DILocalVariable(name: "prioceiling", arg: 5, scope: !208, file: !2, line: 44, type: !154) +!221 = !DILocation(line: 44, column: 80, scope: !208) +!222 = !DILocalVariable(name: "status", scope: !208, file: !2, line: 46, type: !154) +!223 = !DILocation(line: 46, column: 9, scope: !208) +!224 = !DILocalVariable(name: "value", scope: !208, file: !2, line: 47, type: !154) +!225 = !DILocation(line: 47, column: 9, scope: !208) +!226 = !DILocalVariable(name: "attributes", scope: !208, file: !2, line: 48, type: !227) +!227 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutexattr_t", file: !228, line: 31, baseType: !229) +!228 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h", directory: "") +!229 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutexattr_t", file: !104, line: 114, baseType: !230) +!230 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutexattr_t", file: !104, line: 83, size: 128, elements: !231) +!231 = !{!232, !233} +!232 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !230, file: !104, line: 84, baseType: !108, size: 64) +!233 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !230, file: !104, line: 85, baseType: !44, size: 64, offset: 64) +!234 = !DILocation(line: 48, column: 25, scope: !208) +!235 = !DILocation(line: 49, column: 14, scope: !208) +!236 = !DILocation(line: 49, column: 12, scope: !208) +!237 = !DILocation(line: 50, column: 5, scope: !208) +!238 = !DILocation(line: 52, column: 53, scope: !208) +!239 = !DILocation(line: 52, column: 14, scope: !208) +!240 = !DILocation(line: 52, column: 12, scope: !208) +!241 = !DILocation(line: 53, column: 5, scope: !208) +!242 = !DILocation(line: 54, column: 14, scope: !208) +!243 = !DILocation(line: 54, column: 12, scope: !208) +!244 = !DILocation(line: 55, column: 5, scope: !208) +!245 = !DILocation(line: 57, column: 57, scope: !208) +!246 = !DILocation(line: 57, column: 14, scope: !208) +!247 = !DILocation(line: 57, column: 12, scope: !208) +!248 = !DILocation(line: 58, column: 5, scope: !208) +!249 = !DILocation(line: 59, column: 14, scope: !208) +!250 = !DILocation(line: 59, column: 12, scope: !208) +!251 = !DILocation(line: 60, column: 5, scope: !208) +!252 = !DILocation(line: 62, column: 58, scope: !208) +!253 = !DILocation(line: 62, column: 14, scope: !208) +!254 = !DILocation(line: 62, column: 12, scope: !208) +!255 = !DILocation(line: 63, column: 5, scope: !208) +!256 = !DILocation(line: 64, column: 14, scope: !208) +!257 = !DILocation(line: 64, column: 12, scope: !208) +!258 = !DILocation(line: 65, column: 5, scope: !208) +!259 = !DILocation(line: 67, column: 60, scope: !208) +!260 = !DILocation(line: 67, column: 14, scope: !208) +!261 = !DILocation(line: 67, column: 12, scope: !208) +!262 = !DILocation(line: 68, column: 5, scope: !208) +!263 = !DILocation(line: 69, column: 14, scope: !208) +!264 = !DILocation(line: 69, column: 12, scope: !208) +!265 = !DILocation(line: 70, column: 5, scope: !208) +!266 = !DILocation(line: 72, column: 33, scope: !208) +!267 = !DILocation(line: 72, column: 14, scope: !208) +!268 = !DILocation(line: 72, column: 12, scope: !208) +!269 = !DILocation(line: 73, column: 5, scope: !208) +!270 = !DILocation(line: 74, column: 14, scope: !208) +!271 = !DILocation(line: 74, column: 12, scope: !208) +!272 = !DILocation(line: 75, column: 5, scope: !208) +!273 = !DILocation(line: 76, column: 1, scope: !208) +!274 = distinct !DISubprogram(name: "mutex_destroy", scope: !2, file: !2, line: 78, type: !275, scopeLine: 79, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!275 = !DISubroutineType(types: !276) +!276 = !{null, !211} +!277 = !DILocalVariable(name: "lock", arg: 1, scope: !274, file: !2, line: 78, type: !211) +!278 = !DILocation(line: 78, column: 37, scope: !274) +!279 = !DILocalVariable(name: "status", scope: !274, file: !2, line: 80, type: !154) +!280 = !DILocation(line: 80, column: 9, scope: !274) +!281 = !DILocation(line: 80, column: 40, scope: !274) +!282 = !DILocation(line: 80, column: 18, scope: !274) +!283 = !DILocation(line: 81, column: 5, scope: !274) +!284 = !DILocation(line: 82, column: 1, scope: !274) +!285 = distinct !DISubprogram(name: "mutex_lock", scope: !2, file: !2, line: 84, type: !275, scopeLine: 85, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!286 = !DILocalVariable(name: "lock", arg: 1, scope: !285, file: !2, line: 84, type: !211) +!287 = !DILocation(line: 84, column: 34, scope: !285) +!288 = !DILocalVariable(name: "status", scope: !285, file: !2, line: 86, type: !154) +!289 = !DILocation(line: 86, column: 9, scope: !285) +!290 = !DILocation(line: 86, column: 37, scope: !285) +!291 = !DILocation(line: 86, column: 18, scope: !285) +!292 = !DILocation(line: 87, column: 5, scope: !285) +!293 = !DILocation(line: 88, column: 1, scope: !285) +!294 = distinct !DISubprogram(name: "mutex_trylock", scope: !2, file: !2, line: 90, type: !295, scopeLine: 91, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!295 = !DISubroutineType(types: !296) +!296 = !{!297, !211} +!297 = !DIBasicType(name: "_Bool", size: 8, encoding: DW_ATE_boolean) +!298 = !DILocalVariable(name: "lock", arg: 1, scope: !294, file: !2, line: 90, type: !211) +!299 = !DILocation(line: 90, column: 37, scope: !294) +!300 = !DILocalVariable(name: "status", scope: !294, file: !2, line: 92, type: !154) +!301 = !DILocation(line: 92, column: 9, scope: !294) +!302 = !DILocation(line: 92, column: 40, scope: !294) +!303 = !DILocation(line: 92, column: 18, scope: !294) +!304 = !DILocation(line: 94, column: 12, scope: !294) +!305 = !DILocation(line: 94, column: 19, scope: !294) +!306 = !DILocation(line: 94, column: 5, scope: !294) +!307 = distinct !DISubprogram(name: "mutex_unlock", scope: !2, file: !2, line: 97, type: !275, scopeLine: 98, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!308 = !DILocalVariable(name: "lock", arg: 1, scope: !307, file: !2, line: 97, type: !211) +!309 = !DILocation(line: 97, column: 36, scope: !307) +!310 = !DILocalVariable(name: "status", scope: !307, file: !2, line: 99, type: !154) +!311 = !DILocation(line: 99, column: 9, scope: !307) +!312 = !DILocation(line: 99, column: 39, scope: !307) +!313 = !DILocation(line: 99, column: 18, scope: !307) +!314 = !DILocation(line: 100, column: 5, scope: !307) +!315 = !DILocation(line: 101, column: 1, scope: !307) +!316 = distinct !DISubprogram(name: "mutex_test", scope: !2, file: !2, line: 103, type: !317, scopeLine: 104, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!317 = !DISubroutineType(types: !318) +!318 = !{null} +!319 = !DILocalVariable(name: "mutex0", scope: !316, file: !2, line: 105, type: !101) +!320 = !DILocation(line: 105, column: 21, scope: !316) +!321 = !DILocalVariable(name: "mutex1", scope: !316, file: !2, line: 106, type: !101) +!322 = !DILocation(line: 106, column: 21, scope: !316) +!323 = !DILocation(line: 108, column: 5, scope: !316) +!324 = !DILocation(line: 109, column: 5, scope: !316) +!325 = !DILocation(line: 112, column: 9, scope: !326) +!326 = distinct !DILexicalBlock(scope: !316, file: !2, line: 111, column: 5) +!327 = !DILocalVariable(name: "success", scope: !326, file: !2, line: 113, type: !297) +!328 = !DILocation(line: 113, column: 14, scope: !326) +!329 = !DILocation(line: 113, column: 24, scope: !326) +!330 = !DILocation(line: 114, column: 9, scope: !326) +!331 = !DILocation(line: 115, column: 9, scope: !326) +!332 = !DILocation(line: 119, column: 9, scope: !333) +!333 = distinct !DILexicalBlock(scope: !316, file: !2, line: 118, column: 5) +!334 = !DILocalVariable(name: "success", scope: !335, file: !2, line: 122, type: !297) +!335 = distinct !DILexicalBlock(scope: !333, file: !2, line: 121, column: 9) +!336 = !DILocation(line: 122, column: 18, scope: !335) +!337 = !DILocation(line: 122, column: 28, scope: !335) +!338 = !DILocation(line: 123, column: 13, scope: !335) +!339 = !DILocation(line: 124, column: 13, scope: !335) +!340 = !DILocalVariable(name: "success", scope: !341, file: !2, line: 128, type: !297) +!341 = distinct !DILexicalBlock(scope: !333, file: !2, line: 127, column: 9) +!342 = !DILocation(line: 128, column: 18, scope: !341) +!343 = !DILocation(line: 128, column: 28, scope: !341) +!344 = !DILocation(line: 129, column: 13, scope: !341) +!345 = !DILocation(line: 130, column: 13, scope: !341) +!346 = !DILocation(line: 140, column: 9, scope: !333) +!347 = !DILocation(line: 143, column: 5, scope: !316) +!348 = !DILocation(line: 144, column: 5, scope: !316) +!349 = !DILocation(line: 145, column: 1, scope: !316) +!350 = distinct !DISubprogram(name: "cond_init", scope: !2, file: !2, line: 149, type: !351, scopeLine: 150, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!351 = !DISubroutineType(types: !352) +!352 = !{null, !353} +!353 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !115, size: 64) +!354 = !DILocalVariable(name: "cond", arg: 1, scope: !350, file: !2, line: 149, type: !353) +!355 = !DILocation(line: 149, column: 32, scope: !350) +!356 = !DILocalVariable(name: "status", scope: !350, file: !2, line: 151, type: !154) +!357 = !DILocation(line: 151, column: 9, scope: !350) +!358 = !DILocalVariable(name: "attr", scope: !350, file: !2, line: 152, type: !359) +!359 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_condattr_t", file: !360, line: 31, baseType: !361) +!360 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h", directory: "") +!361 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_condattr_t", file: !104, line: 111, baseType: !362) +!362 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_condattr_t", file: !104, line: 73, size: 128, elements: !363) +!363 = !{!364, !365} +!364 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !362, file: !104, line: 74, baseType: !108, size: 64) +!365 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !362, file: !104, line: 75, baseType: !44, size: 64, offset: 64) +!366 = !DILocation(line: 152, column: 24, scope: !350) +!367 = !DILocation(line: 154, column: 14, scope: !350) +!368 = !DILocation(line: 154, column: 12, scope: !350) +!369 = !DILocation(line: 155, column: 5, scope: !350) +!370 = !DILocation(line: 157, column: 32, scope: !350) +!371 = !DILocation(line: 157, column: 14, scope: !350) +!372 = !DILocation(line: 157, column: 12, scope: !350) +!373 = !DILocation(line: 158, column: 5, scope: !350) +!374 = !DILocation(line: 160, column: 14, scope: !350) +!375 = !DILocation(line: 160, column: 12, scope: !350) +!376 = !DILocation(line: 161, column: 5, scope: !350) +!377 = !DILocation(line: 162, column: 1, scope: !350) +!378 = distinct !DISubprogram(name: "cond_destroy", scope: !2, file: !2, line: 164, type: !351, scopeLine: 165, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!379 = !DILocalVariable(name: "cond", arg: 1, scope: !378, file: !2, line: 164, type: !353) +!380 = !DILocation(line: 164, column: 35, scope: !378) +!381 = !DILocalVariable(name: "status", scope: !378, file: !2, line: 166, type: !154) +!382 = !DILocation(line: 166, column: 9, scope: !378) +!383 = !DILocation(line: 166, column: 39, scope: !378) +!384 = !DILocation(line: 166, column: 18, scope: !378) +!385 = !DILocation(line: 167, column: 5, scope: !378) +!386 = !DILocation(line: 168, column: 1, scope: !378) +!387 = distinct !DISubprogram(name: "cond_signal", scope: !2, file: !2, line: 170, type: !351, scopeLine: 171, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!388 = !DILocalVariable(name: "cond", arg: 1, scope: !387, file: !2, line: 170, type: !353) +!389 = !DILocation(line: 170, column: 34, scope: !387) +!390 = !DILocalVariable(name: "status", scope: !387, file: !2, line: 172, type: !154) +!391 = !DILocation(line: 172, column: 9, scope: !387) +!392 = !DILocation(line: 172, column: 38, scope: !387) +!393 = !DILocation(line: 172, column: 18, scope: !387) +!394 = !DILocation(line: 173, column: 5, scope: !387) +!395 = !DILocation(line: 174, column: 1, scope: !387) +!396 = distinct !DISubprogram(name: "cond_broadcast", scope: !2, file: !2, line: 176, type: !351, scopeLine: 177, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!397 = !DILocalVariable(name: "cond", arg: 1, scope: !396, file: !2, line: 176, type: !353) +!398 = !DILocation(line: 176, column: 37, scope: !396) +!399 = !DILocalVariable(name: "status", scope: !396, file: !2, line: 178, type: !154) +!400 = !DILocation(line: 178, column: 9, scope: !396) +!401 = !DILocation(line: 178, column: 41, scope: !396) +!402 = !DILocation(line: 178, column: 18, scope: !396) +!403 = !DILocation(line: 179, column: 5, scope: !396) +!404 = !DILocation(line: 180, column: 1, scope: !396) +!405 = distinct !DISubprogram(name: "cond_wait", scope: !2, file: !2, line: 182, type: !406, scopeLine: 183, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!406 = !DISubroutineType(types: !407) +!407 = !{null, !353, !211} +!408 = !DILocalVariable(name: "cond", arg: 1, scope: !405, file: !2, line: 182, type: !353) +!409 = !DILocation(line: 182, column: 32, scope: !405) +!410 = !DILocalVariable(name: "lock", arg: 2, scope: !405, file: !2, line: 182, type: !211) +!411 = !DILocation(line: 182, column: 55, scope: !405) +!412 = !DILocalVariable(name: "status", scope: !405, file: !2, line: 184, type: !154) +!413 = !DILocation(line: 184, column: 9, scope: !405) +!414 = !DILocation(line: 184, column: 36, scope: !405) +!415 = !DILocation(line: 184, column: 42, scope: !405) +!416 = !DILocation(line: 184, column: 18, scope: !405) +!417 = !DILocation(line: 186, column: 1, scope: !405) +!418 = distinct !DISubprogram(name: "cond_timedwait", scope: !2, file: !2, line: 188, type: !419, scopeLine: 189, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!419 = !DISubroutineType(types: !420) +!420 = !{null, !353, !211, !421} +!421 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed) +!422 = !DILocalVariable(name: "cond", arg: 1, scope: !418, file: !2, line: 188, type: !353) +!423 = !DILocation(line: 188, column: 37, scope: !418) +!424 = !DILocalVariable(name: "lock", arg: 2, scope: !418, file: !2, line: 188, type: !211) +!425 = !DILocation(line: 188, column: 60, scope: !418) +!426 = !DILocalVariable(name: "millis", arg: 3, scope: !418, file: !2, line: 188, type: !421) +!427 = !DILocation(line: 188, column: 76, scope: !418) +!428 = !DILocalVariable(name: "ts", scope: !418, file: !2, line: 191, type: !429) +!429 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "timespec", file: !430, line: 33, size: 128, elements: !431) +!430 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_timespec.h", directory: "") +!431 = !{!432, !435} +!432 = !DIDerivedType(tag: DW_TAG_member, name: "tv_sec", scope: !429, file: !430, line: 35, baseType: !433, size: 64) +!433 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_time_t", file: !434, line: 98, baseType: !108) +!434 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/arm/_types.h", directory: "") +!435 = !DIDerivedType(tag: DW_TAG_member, name: "tv_nsec", scope: !429, file: !430, line: 36, baseType: !108, size: 64, offset: 64) +!436 = !DILocation(line: 191, column: 21, scope: !418) +!437 = !DILocation(line: 195, column: 11, scope: !418) +!438 = !DILocalVariable(name: "status", scope: !418, file: !2, line: 196, type: !154) +!439 = !DILocation(line: 196, column: 9, scope: !418) +!440 = !DILocation(line: 196, column: 41, scope: !418) +!441 = !DILocation(line: 196, column: 47, scope: !418) +!442 = !DILocation(line: 196, column: 18, scope: !418) +!443 = !DILocation(line: 197, column: 1, scope: !418) +!444 = distinct !DISubprogram(name: "cond_worker", scope: !2, file: !2, line: 203, type: !166, scopeLine: 204, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!445 = !DILocalVariable(name: "message", arg: 1, scope: !444, file: !2, line: 203, type: !63) +!446 = !DILocation(line: 203, column: 25, scope: !444) +!447 = !DILocalVariable(name: "idle", scope: !448, file: !2, line: 205, type: !297) +!448 = distinct !DILexicalBlock(scope: !444, file: !2, line: 205, column: 5) +!449 = !DILocation(line: 205, column: 15, scope: !448) +!450 = !DILocation(line: 205, column: 10, scope: !448) +!451 = !DILocation(line: 205, column: 28, scope: !452) +!452 = distinct !DILexicalBlock(scope: !448, file: !2, line: 205, column: 5) +!453 = !DILocation(line: 205, column: 5, scope: !448) +!454 = !DILocation(line: 207, column: 9, scope: !455) +!455 = distinct !DILexicalBlock(scope: !452, file: !2, line: 206, column: 5) +!456 = !DILocation(line: 208, column: 9, scope: !455) +!457 = !DILocation(line: 209, column: 16, scope: !455) +!458 = !DILocation(line: 209, column: 22, scope: !455) +!459 = !DILocation(line: 209, column: 14, scope: !455) +!460 = !DILocation(line: 210, column: 9, scope: !455) +!461 = !DILocation(line: 205, column: 5, scope: !452) +!462 = distinct !{!462, !453, !463, !464} +!463 = !DILocation(line: 211, column: 5, scope: !448) +!464 = !{!"llvm.loop.mustprogress"} +!465 = !DILocalVariable(name: "idle", scope: !466, file: !2, line: 212, type: !297) +!466 = distinct !DILexicalBlock(scope: !444, file: !2, line: 212, column: 5) +!467 = !DILocation(line: 212, column: 15, scope: !466) +!468 = !DILocation(line: 212, column: 10, scope: !466) +!469 = !DILocation(line: 212, column: 28, scope: !470) +!470 = distinct !DILexicalBlock(scope: !466, file: !2, line: 212, column: 5) +!471 = !DILocation(line: 212, column: 5, scope: !466) +!472 = !DILocation(line: 214, column: 9, scope: !473) +!473 = distinct !DILexicalBlock(scope: !470, file: !2, line: 213, column: 5) +!474 = !DILocation(line: 215, column: 9, scope: !473) +!475 = !DILocation(line: 216, column: 16, scope: !473) +!476 = !DILocation(line: 216, column: 22, scope: !473) +!477 = !DILocation(line: 216, column: 14, scope: !473) +!478 = !DILocation(line: 217, column: 9, scope: !473) +!479 = !DILocation(line: 212, column: 5, scope: !470) +!480 = distinct !{!480, !471, !481, !464} +!481 = !DILocation(line: 218, column: 5, scope: !466) +!482 = !DILocation(line: 219, column: 12, scope: !444) +!483 = !DILocation(line: 219, column: 5, scope: !444) +!484 = distinct !DISubprogram(name: "cond_test", scope: !2, file: !2, line: 222, type: !317, scopeLine: 223, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!485 = !DILocalVariable(name: "message", scope: !484, file: !2, line: 224, type: !63) +!486 = !DILocation(line: 224, column: 11, scope: !484) +!487 = !DILocation(line: 225, column: 5, scope: !484) +!488 = !DILocation(line: 226, column: 5, scope: !484) +!489 = !DILocalVariable(name: "worker", scope: !484, file: !2, line: 228, type: !127) +!490 = !DILocation(line: 228, column: 15, scope: !484) +!491 = !DILocation(line: 228, column: 51, scope: !484) +!492 = !DILocation(line: 228, column: 24, scope: !484) +!493 = !DILocation(line: 231, column: 9, scope: !494) +!494 = distinct !DILexicalBlock(scope: !484, file: !2, line: 230, column: 5) +!495 = !DILocation(line: 232, column: 9, scope: !494) +!496 = !DILocation(line: 233, column: 9, scope: !494) +!497 = !DILocation(line: 234, column: 9, scope: !494) +!498 = !DILocation(line: 238, column: 9, scope: !499) +!499 = distinct !DILexicalBlock(scope: !484, file: !2, line: 237, column: 5) +!500 = !DILocation(line: 239, column: 9, scope: !499) +!501 = !DILocation(line: 240, column: 9, scope: !499) +!502 = !DILocation(line: 241, column: 9, scope: !499) +!503 = !DILocalVariable(name: "result", scope: !484, file: !2, line: 244, type: !63) +!504 = !DILocation(line: 244, column: 11, scope: !484) +!505 = !DILocation(line: 244, column: 32, scope: !484) +!506 = !DILocation(line: 244, column: 20, scope: !484) +!507 = !DILocation(line: 245, column: 5, scope: !484) +!508 = !DILocation(line: 247, column: 5, scope: !484) +!509 = !DILocation(line: 248, column: 5, scope: !484) +!510 = !DILocation(line: 249, column: 1, scope: !484) +!511 = distinct !DISubprogram(name: "rwlock_init", scope: !2, file: !2, line: 256, type: !512, scopeLine: 257, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!512 = !DISubroutineType(types: !513) +!513 = !{null, !514, !154} +!514 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !515, size: 64) +!515 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlock_t", file: !516, line: 31, baseType: !517) +!516 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h", directory: "") +!517 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlock_t", file: !104, line: 116, baseType: !518) +!518 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlock_t", file: !104, line: 93, size: 1600, elements: !519) +!519 = !{!520, !521} +!520 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !518, file: !104, line: 94, baseType: !108, size: 64) +!521 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !518, file: !104, line: 95, baseType: !522, size: 1536, offset: 64) +!522 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 1536, elements: !523) +!523 = !{!524} +!524 = !DISubrange(count: 192) +!525 = !DILocalVariable(name: "lock", arg: 1, scope: !511, file: !2, line: 256, type: !514) +!526 = !DILocation(line: 256, column: 36, scope: !511) +!527 = !DILocalVariable(name: "shared", arg: 2, scope: !511, file: !2, line: 256, type: !154) +!528 = !DILocation(line: 256, column: 46, scope: !511) +!529 = !DILocalVariable(name: "status", scope: !511, file: !2, line: 258, type: !154) +!530 = !DILocation(line: 258, column: 9, scope: !511) +!531 = !DILocalVariable(name: "value", scope: !511, file: !2, line: 259, type: !154) +!532 = !DILocation(line: 259, column: 9, scope: !511) +!533 = !DILocalVariable(name: "attributes", scope: !511, file: !2, line: 260, type: !534) +!534 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlockattr_t", file: !535, line: 31, baseType: !536) +!535 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h", directory: "") +!536 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlockattr_t", file: !104, line: 117, baseType: !537) +!537 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlockattr_t", file: !104, line: 98, size: 192, elements: !538) +!538 = !{!539, !540} +!539 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !537, file: !104, line: 99, baseType: !108, size: 64) +!540 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !537, file: !104, line: 100, baseType: !541, size: 128, offset: 64) +!541 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 128, elements: !542) +!542 = !{!543} +!543 = !DISubrange(count: 16) +!544 = !DILocation(line: 260, column: 26, scope: !511) +!545 = !DILocation(line: 261, column: 14, scope: !511) +!546 = !DILocation(line: 261, column: 12, scope: !511) +!547 = !DILocation(line: 262, column: 5, scope: !511) +!548 = !DILocation(line: 264, column: 57, scope: !511) +!549 = !DILocation(line: 264, column: 14, scope: !511) +!550 = !DILocation(line: 264, column: 12, scope: !511) +!551 = !DILocation(line: 265, column: 5, scope: !511) +!552 = !DILocation(line: 266, column: 14, scope: !511) +!553 = !DILocation(line: 266, column: 12, scope: !511) +!554 = !DILocation(line: 267, column: 5, scope: !511) +!555 = !DILocation(line: 269, column: 34, scope: !511) +!556 = !DILocation(line: 269, column: 14, scope: !511) +!557 = !DILocation(line: 269, column: 12, scope: !511) +!558 = !DILocation(line: 270, column: 5, scope: !511) +!559 = !DILocation(line: 271, column: 14, scope: !511) +!560 = !DILocation(line: 271, column: 12, scope: !511) +!561 = !DILocation(line: 272, column: 5, scope: !511) +!562 = !DILocation(line: 273, column: 1, scope: !511) +!563 = distinct !DISubprogram(name: "rwlock_destroy", scope: !2, file: !2, line: 275, type: !564, scopeLine: 276, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!564 = !DISubroutineType(types: !565) +!565 = !{null, !514} +!566 = !DILocalVariable(name: "lock", arg: 1, scope: !563, file: !2, line: 275, type: !514) +!567 = !DILocation(line: 275, column: 39, scope: !563) +!568 = !DILocalVariable(name: "status", scope: !563, file: !2, line: 277, type: !154) +!569 = !DILocation(line: 277, column: 9, scope: !563) +!570 = !DILocation(line: 277, column: 41, scope: !563) +!571 = !DILocation(line: 277, column: 18, scope: !563) +!572 = !DILocation(line: 278, column: 5, scope: !563) +!573 = !DILocation(line: 279, column: 1, scope: !563) +!574 = distinct !DISubprogram(name: "rwlock_wrlock", scope: !2, file: !2, line: 281, type: !564, scopeLine: 282, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!575 = !DILocalVariable(name: "lock", arg: 1, scope: !574, file: !2, line: 281, type: !514) +!576 = !DILocation(line: 281, column: 38, scope: !574) +!577 = !DILocalVariable(name: "status", scope: !574, file: !2, line: 283, type: !154) +!578 = !DILocation(line: 283, column: 9, scope: !574) +!579 = !DILocation(line: 283, column: 40, scope: !574) +!580 = !DILocation(line: 283, column: 18, scope: !574) +!581 = !DILocation(line: 284, column: 5, scope: !574) +!582 = !DILocation(line: 285, column: 1, scope: !574) +!583 = distinct !DISubprogram(name: "rwlock_trywrlock", scope: !2, file: !2, line: 287, type: !584, scopeLine: 288, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!584 = !DISubroutineType(types: !585) +!585 = !{!297, !514} +!586 = !DILocalVariable(name: "lock", arg: 1, scope: !583, file: !2, line: 287, type: !514) +!587 = !DILocation(line: 287, column: 41, scope: !583) +!588 = !DILocalVariable(name: "status", scope: !583, file: !2, line: 289, type: !154) +!589 = !DILocation(line: 289, column: 9, scope: !583) +!590 = !DILocation(line: 289, column: 43, scope: !583) +!591 = !DILocation(line: 289, column: 18, scope: !583) +!592 = !DILocation(line: 291, column: 12, scope: !583) +!593 = !DILocation(line: 291, column: 19, scope: !583) +!594 = !DILocation(line: 291, column: 5, scope: !583) +!595 = distinct !DISubprogram(name: "rwlock_rdlock", scope: !2, file: !2, line: 294, type: !564, scopeLine: 295, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!596 = !DILocalVariable(name: "lock", arg: 1, scope: !595, file: !2, line: 294, type: !514) +!597 = !DILocation(line: 294, column: 38, scope: !595) +!598 = !DILocalVariable(name: "status", scope: !595, file: !2, line: 296, type: !154) +!599 = !DILocation(line: 296, column: 9, scope: !595) +!600 = !DILocation(line: 296, column: 40, scope: !595) +!601 = !DILocation(line: 296, column: 18, scope: !595) +!602 = !DILocation(line: 297, column: 5, scope: !595) +!603 = !DILocation(line: 298, column: 1, scope: !595) +!604 = distinct !DISubprogram(name: "rwlock_tryrdlock", scope: !2, file: !2, line: 300, type: !584, scopeLine: 301, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!605 = !DILocalVariable(name: "lock", arg: 1, scope: !604, file: !2, line: 300, type: !514) +!606 = !DILocation(line: 300, column: 41, scope: !604) +!607 = !DILocalVariable(name: "status", scope: !604, file: !2, line: 302, type: !154) +!608 = !DILocation(line: 302, column: 9, scope: !604) +!609 = !DILocation(line: 302, column: 43, scope: !604) +!610 = !DILocation(line: 302, column: 18, scope: !604) +!611 = !DILocation(line: 304, column: 12, scope: !604) +!612 = !DILocation(line: 304, column: 19, scope: !604) +!613 = !DILocation(line: 304, column: 5, scope: !604) +!614 = distinct !DISubprogram(name: "rwlock_unlock", scope: !2, file: !2, line: 307, type: !564, scopeLine: 308, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!615 = !DILocalVariable(name: "lock", arg: 1, scope: !614, file: !2, line: 307, type: !514) +!616 = !DILocation(line: 307, column: 38, scope: !614) +!617 = !DILocalVariable(name: "status", scope: !614, file: !2, line: 309, type: !154) +!618 = !DILocation(line: 309, column: 9, scope: !614) +!619 = !DILocation(line: 309, column: 40, scope: !614) +!620 = !DILocation(line: 309, column: 18, scope: !614) +!621 = !DILocation(line: 310, column: 5, scope: !614) +!622 = !DILocation(line: 311, column: 1, scope: !614) +!623 = distinct !DISubprogram(name: "rwlock_test", scope: !2, file: !2, line: 313, type: !317, scopeLine: 314, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!624 = !DILocalVariable(name: "lock", scope: !623, file: !2, line: 315, type: !515) +!625 = !DILocation(line: 315, column: 22, scope: !623) +!626 = !DILocation(line: 316, column: 5, scope: !623) +!627 = !DILocalVariable(name: "test_depth", scope: !623, file: !2, line: 317, type: !628) +!628 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !154) +!629 = !DILocation(line: 317, column: 15, scope: !623) +!630 = !DILocation(line: 320, column: 9, scope: !631) +!631 = distinct !DILexicalBlock(scope: !623, file: !2, line: 319, column: 5) +!632 = !DILocalVariable(name: "success", scope: !631, file: !2, line: 321, type: !297) +!633 = !DILocation(line: 321, column: 14, scope: !631) +!634 = !DILocation(line: 321, column: 24, scope: !631) +!635 = !DILocation(line: 322, column: 9, scope: !631) +!636 = !DILocation(line: 323, column: 19, scope: !631) +!637 = !DILocation(line: 323, column: 17, scope: !631) +!638 = !DILocation(line: 324, column: 9, scope: !631) +!639 = !DILocation(line: 325, column: 9, scope: !631) +!640 = !DILocation(line: 329, column: 9, scope: !641) +!641 = distinct !DILexicalBlock(scope: !623, file: !2, line: 328, column: 5) +!642 = !DILocalVariable(name: "i", scope: !643, file: !2, line: 330, type: !154) +!643 = distinct !DILexicalBlock(scope: !641, file: !2, line: 330, column: 9) +!644 = !DILocation(line: 330, column: 18, scope: !643) +!645 = !DILocation(line: 330, column: 14, scope: !643) +!646 = !DILocation(line: 330, column: 25, scope: !647) +!647 = distinct !DILexicalBlock(scope: !643, file: !2, line: 330, column: 9) +!648 = !DILocation(line: 330, column: 27, scope: !647) +!649 = !DILocation(line: 330, column: 9, scope: !643) +!650 = !DILocalVariable(name: "success", scope: !651, file: !2, line: 332, type: !297) +!651 = distinct !DILexicalBlock(scope: !647, file: !2, line: 331, column: 9) +!652 = !DILocation(line: 332, column: 18, scope: !651) +!653 = !DILocation(line: 332, column: 28, scope: !651) +!654 = !DILocation(line: 333, column: 13, scope: !651) +!655 = !DILocation(line: 334, column: 9, scope: !651) +!656 = !DILocation(line: 330, column: 42, scope: !647) +!657 = !DILocation(line: 330, column: 9, scope: !647) +!658 = distinct !{!658, !649, !659, !464} +!659 = !DILocation(line: 334, column: 9, scope: !643) +!660 = !DILocalVariable(name: "success", scope: !661, file: !2, line: 337, type: !297) +!661 = distinct !DILexicalBlock(scope: !641, file: !2, line: 336, column: 9) +!662 = !DILocation(line: 337, column: 18, scope: !661) +!663 = !DILocation(line: 337, column: 28, scope: !661) +!664 = !DILocation(line: 338, column: 13, scope: !661) +!665 = !DILocation(line: 341, column: 9, scope: !641) +!666 = !DILocalVariable(name: "i", scope: !667, file: !2, line: 342, type: !154) +!667 = distinct !DILexicalBlock(scope: !641, file: !2, line: 342, column: 9) +!668 = !DILocation(line: 342, column: 18, scope: !667) +!669 = !DILocation(line: 342, column: 14, scope: !667) +!670 = !DILocation(line: 342, column: 25, scope: !671) +!671 = distinct !DILexicalBlock(scope: !667, file: !2, line: 342, column: 9) +!672 = !DILocation(line: 342, column: 27, scope: !671) +!673 = !DILocation(line: 342, column: 9, scope: !667) +!674 = !DILocation(line: 343, column: 13, scope: !675) +!675 = distinct !DILexicalBlock(scope: !671, file: !2, line: 342, column: 46) +!676 = !DILocation(line: 344, column: 9, scope: !675) +!677 = !DILocation(line: 342, column: 42, scope: !671) +!678 = !DILocation(line: 342, column: 9, scope: !671) +!679 = distinct !{!679, !673, !680, !464} +!680 = !DILocation(line: 344, column: 9, scope: !667) +!681 = !DILocation(line: 348, column: 9, scope: !682) +!682 = distinct !DILexicalBlock(scope: !623, file: !2, line: 347, column: 5) +!683 = !DILocalVariable(name: "success", scope: !682, file: !2, line: 349, type: !297) +!684 = !DILocation(line: 349, column: 14, scope: !682) +!685 = !DILocation(line: 349, column: 24, scope: !682) +!686 = !DILocation(line: 350, column: 9, scope: !682) +!687 = !DILocation(line: 353, column: 5, scope: !623) +!688 = !DILocation(line: 354, column: 1, scope: !623) +!689 = distinct !DISubprogram(name: "key_destroy", scope: !2, file: !2, line: 361, type: !140, scopeLine: 362, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!690 = !DILocalVariable(name: "unused_value", arg: 1, scope: !689, file: !2, line: 361, type: !63) +!691 = !DILocation(line: 361, column: 24, scope: !689) +!692 = !DILocation(line: 363, column: 21, scope: !689) +!693 = !DILocation(line: 363, column: 19, scope: !689) +!694 = !DILocation(line: 364, column: 1, scope: !689) +!695 = distinct !DISubprogram(name: "key_worker", scope: !2, file: !2, line: 366, type: !166, scopeLine: 367, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!696 = !DILocalVariable(name: "message", arg: 1, scope: !695, file: !2, line: 366, type: !63) +!697 = !DILocation(line: 366, column: 24, scope: !695) +!698 = !DILocalVariable(name: "my_secret", scope: !695, file: !2, line: 368, type: !154) +!699 = !DILocation(line: 368, column: 9, scope: !695) +!700 = !DILocalVariable(name: "status", scope: !695, file: !2, line: 370, type: !154) +!701 = !DILocation(line: 370, column: 9, scope: !695) +!702 = !DILocation(line: 370, column: 38, scope: !695) +!703 = !DILocation(line: 370, column: 18, scope: !695) +!704 = !DILocation(line: 371, column: 5, scope: !695) +!705 = !DILocalVariable(name: "my_local_data", scope: !695, file: !2, line: 373, type: !63) +!706 = !DILocation(line: 373, column: 11, scope: !695) +!707 = !DILocation(line: 373, column: 47, scope: !695) +!708 = !DILocation(line: 373, column: 27, scope: !695) +!709 = !DILocation(line: 374, column: 5, scope: !695) +!710 = !DILocation(line: 376, column: 12, scope: !695) +!711 = !DILocation(line: 376, column: 5, scope: !695) +!712 = distinct !DISubprogram(name: "key_test", scope: !2, file: !2, line: 379, type: !317, scopeLine: 380, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!713 = !DILocalVariable(name: "my_secret", scope: !712, file: !2, line: 381, type: !154) +!714 = !DILocation(line: 381, column: 9, scope: !712) +!715 = !DILocalVariable(name: "message", scope: !712, file: !2, line: 382, type: !63) +!716 = !DILocation(line: 382, column: 11, scope: !712) +!717 = !DILocalVariable(name: "status", scope: !712, file: !2, line: 383, type: !154) +!718 = !DILocation(line: 383, column: 9, scope: !712) +!719 = !DILocation(line: 385, column: 5, scope: !712) +!720 = !DILocalVariable(name: "worker", scope: !712, file: !2, line: 387, type: !127) +!721 = !DILocation(line: 387, column: 15, scope: !712) +!722 = !DILocation(line: 387, column: 50, scope: !712) +!723 = !DILocation(line: 387, column: 24, scope: !712) +!724 = !DILocation(line: 389, column: 34, scope: !712) +!725 = !DILocation(line: 389, column: 14, scope: !712) +!726 = !DILocation(line: 389, column: 12, scope: !712) +!727 = !DILocation(line: 390, column: 5, scope: !712) +!728 = !DILocalVariable(name: "my_local_data", scope: !712, file: !2, line: 392, type: !63) +!729 = !DILocation(line: 392, column: 11, scope: !712) +!730 = !DILocation(line: 392, column: 47, scope: !712) +!731 = !DILocation(line: 392, column: 27, scope: !712) +!732 = !DILocation(line: 393, column: 5, scope: !712) +!733 = !DILocation(line: 395, column: 34, scope: !712) +!734 = !DILocation(line: 395, column: 14, scope: !712) +!735 = !DILocation(line: 395, column: 12, scope: !712) +!736 = !DILocation(line: 396, column: 5, scope: !712) +!737 = !DILocalVariable(name: "result", scope: !712, file: !2, line: 398, type: !63) +!738 = !DILocation(line: 398, column: 11, scope: !712) +!739 = !DILocation(line: 398, column: 32, scope: !712) +!740 = !DILocation(line: 398, column: 20, scope: !712) +!741 = !DILocation(line: 399, column: 5, scope: !712) +!742 = !DILocation(line: 401, column: 33, scope: !712) +!743 = !DILocation(line: 401, column: 14, scope: !712) +!744 = !DILocation(line: 401, column: 12, scope: !712) +!745 = !DILocation(line: 402, column: 5, scope: !712) +!746 = !DILocation(line: 404, column: 5, scope: !712) +!747 = !DILocation(line: 405, column: 1, scope: !712) +!748 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 407, type: !749, scopeLine: 408, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!749 = !DISubroutineType(types: !750) +!750 = !{!154} +!751 = !DILocation(line: 409, column: 5, scope: !748) +!752 = !DILocation(line: 410, column: 5, scope: !748) +!753 = !DILocation(line: 411, column: 5, scope: !748) +!754 = !DILocation(line: 412, column: 5, scope: !748) +!755 = !DILocation(line: 413, column: 1, scope: !748) From 0b4b8b73ac04656ef562b8caba634c33653b29ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 13 Dec 2023 01:04:50 +0100 Subject: [PATCH 17/21] Remove "\01_" prefix --- .../test/resources/miscellaneous/pthread.ll | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/dartagnan/src/test/resources/miscellaneous/pthread.ll b/dartagnan/src/test/resources/miscellaneous/pthread.ll index 9d4045f75f..d86dc5c517 100644 --- a/dartagnan/src/test/resources/miscellaneous/pthread.ll +++ b/dartagnan/src/test/resources/miscellaneous/pthread.ll @@ -110,7 +110,7 @@ define ptr @thread_join(ptr noundef %0) #0 !dbg !194 { call void @llvm.dbg.declare(metadata ptr %3, metadata !199, metadata !DIExpression()), !dbg !200 call void @llvm.dbg.declare(metadata ptr %4, metadata !201, metadata !DIExpression()), !dbg !202 %5 = load ptr, ptr %2, align 8, !dbg !203 - %6 = call i32 @"\01_pthread_join"(ptr noundef %5, ptr noundef %3), !dbg !204 + %6 = call i32 @pthread_join(ptr noundef %5, ptr noundef %3), !dbg !204 store i32 %6, ptr %4, align 4, !dbg !202 %7 = load i32, ptr %4, align 4, !dbg !205 %8 = icmp eq i32 %7, 0, !dbg !205 @@ -135,7 +135,7 @@ define ptr @thread_join(ptr noundef %0) #0 !dbg !194 { ret ptr %17, !dbg !207 } -declare i32 @"\01_pthread_join"(ptr noundef, ptr noundef) #2 +declare i32 @pthread_join(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 !dbg !208 { @@ -375,7 +375,7 @@ define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noun br label %128, !dbg !269 128: ; preds = %127, %126 - %129 = call i32 @"\01_pthread_mutexattr_destroy"(ptr noundef %13), !dbg !270 + %129 = call i32 @pthread_mutexattr_destroy(ptr noundef %13), !dbg !270 store i32 %129, ptr %11, align 4, !dbg !271 %130 = load i32, ptr %11, align 4, !dbg !272 %131 = icmp eq i32 %130, 0, !dbg !272 @@ -419,7 +419,7 @@ declare i32 @pthread_mutexattr_getprioceiling(ptr noundef, ptr noundef) #2 declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) #2 -declare i32 @"\01_pthread_mutexattr_destroy"(ptr noundef) #2 +declare i32 @pthread_mutexattr_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @mutex_destroy(ptr noundef %0) #0 !dbg !274 { @@ -663,7 +663,7 @@ define void @cond_init(ptr noundef %0) #0 !dbg !350 { 15: ; preds = %14, %13 %16 = load ptr, ptr %2, align 8, !dbg !370 - %17 = call i32 @"\01_pthread_cond_init"(ptr noundef %16, ptr noundef %4), !dbg !371 + %17 = call i32 @pthread_cond_init(ptr noundef %16, ptr noundef %4), !dbg !371 store i32 %17, ptr %3, align 4, !dbg !372 %18 = load i32, ptr %3, align 4, !dbg !373 %19 = icmp eq i32 %18, 0, !dbg !373 @@ -710,7 +710,7 @@ define void @cond_init(ptr noundef %0) #0 !dbg !350 { declare i32 @pthread_condattr_init(ptr noundef) #2 -declare i32 @"\01_pthread_cond_init"(ptr noundef, ptr noundef) #2 +declare i32 @pthread_cond_init(ptr noundef, ptr noundef) #2 declare i32 @pthread_condattr_destroy(ptr noundef) #2 @@ -828,12 +828,12 @@ define void @cond_wait(ptr noundef %0, ptr noundef %1) #0 !dbg !405 { call void @llvm.dbg.declare(metadata ptr %5, metadata !412, metadata !DIExpression()), !dbg !413 %6 = load ptr, ptr %3, align 8, !dbg !414 %7 = load ptr, ptr %4, align 8, !dbg !415 - %8 = call i32 @"\01_pthread_cond_wait"(ptr noundef %6, ptr noundef %7), !dbg !416 + %8 = call i32 @pthread_cond_wait(ptr noundef %6, ptr noundef %7), !dbg !416 store i32 %8, ptr %5, align 4, !dbg !413 ret void, !dbg !417 } -declare i32 @"\01_pthread_cond_wait"(ptr noundef, ptr noundef) #2 +declare i32 @pthread_cond_wait(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 !dbg !418 { @@ -853,12 +853,12 @@ define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 ! call void @llvm.dbg.declare(metadata ptr %8, metadata !438, metadata !DIExpression()), !dbg !439 %10 = load ptr, ptr %4, align 8, !dbg !440 %11 = load ptr, ptr %5, align 8, !dbg !441 - %12 = call i32 @"\01_pthread_cond_timedwait"(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !442 + %12 = call i32 @pthread_cond_timedwait(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !442 store i32 %12, ptr %8, align 4, !dbg !439 ret void, !dbg !443 } -declare i32 @"\01_pthread_cond_timedwait"(ptr noundef, ptr noundef, ptr noundef) #2 +declare i32 @pthread_cond_timedwait(ptr noundef, ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define ptr @cond_worker(ptr noundef %0) #0 !dbg !444 { @@ -1044,7 +1044,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { 41: ; preds = %40, %39 %42 = load ptr, ptr %3, align 8, !dbg !555 - %43 = call i32 @"\01_pthread_rwlock_init"(ptr noundef %42, ptr noundef %7), !dbg !556 + %43 = call i32 @pthread_rwlock_init(ptr noundef %42, ptr noundef %7), !dbg !556 store i32 %43, ptr %5, align 4, !dbg !557 %44 = load i32, ptr %5, align 4, !dbg !558 %45 = icmp eq i32 %44, 0, !dbg !558 @@ -1095,7 +1095,7 @@ declare i32 @pthread_rwlockattr_setpshared(ptr noundef, i32 noundef) #2 declare i32 @pthread_rwlockattr_getpshared(ptr noundef, ptr noundef) #2 -declare i32 @"\01_pthread_rwlock_init"(ptr noundef, ptr noundef) #2 +declare i32 @pthread_rwlock_init(ptr noundef, ptr noundef) #2 declare i32 @pthread_rwlockattr_destroy(ptr noundef) #2 @@ -1107,7 +1107,7 @@ define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { call void @llvm.dbg.declare(metadata ptr %2, metadata !566, metadata !DIExpression()), !dbg !567 call void @llvm.dbg.declare(metadata ptr %3, metadata !568, metadata !DIExpression()), !dbg !569 %4 = load ptr, ptr %2, align 8, !dbg !570 - %5 = call i32 @"\01_pthread_rwlock_destroy"(ptr noundef %4), !dbg !571 + %5 = call i32 @pthread_rwlock_destroy(ptr noundef %4), !dbg !571 store i32 %5, ptr %3, align 4, !dbg !569 %6 = load i32, ptr %3, align 4, !dbg !572 %7 = icmp eq i32 %6, 0, !dbg !572 @@ -1131,7 +1131,7 @@ define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { ret void, !dbg !573 } -declare i32 @"\01_pthread_rwlock_destroy"(ptr noundef) #2 +declare i32 @pthread_rwlock_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { @@ -1141,7 +1141,7 @@ define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { call void @llvm.dbg.declare(metadata ptr %2, metadata !575, metadata !DIExpression()), !dbg !576 call void @llvm.dbg.declare(metadata ptr %3, metadata !577, metadata !DIExpression()), !dbg !578 %4 = load ptr, ptr %2, align 8, !dbg !579 - %5 = call i32 @"\01_pthread_rwlock_wrlock"(ptr noundef %4), !dbg !580 + %5 = call i32 @pthread_rwlock_wrlock(ptr noundef %4), !dbg !580 store i32 %5, ptr %3, align 4, !dbg !578 %6 = load i32, ptr %3, align 4, !dbg !581 %7 = icmp eq i32 %6, 0, !dbg !581 @@ -1165,7 +1165,7 @@ define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { ret void, !dbg !582 } -declare i32 @"\01_pthread_rwlock_wrlock"(ptr noundef) #2 +declare i32 @pthread_rwlock_wrlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !583 { @@ -1175,14 +1175,14 @@ define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !583 { call void @llvm.dbg.declare(metadata ptr %2, metadata !586, metadata !DIExpression()), !dbg !587 call void @llvm.dbg.declare(metadata ptr %3, metadata !588, metadata !DIExpression()), !dbg !589 %4 = load ptr, ptr %2, align 8, !dbg !590 - %5 = call i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef %4), !dbg !591 + %5 = call i32 @pthread_rwlock_trywrlock(ptr noundef %4), !dbg !591 store i32 %5, ptr %3, align 4, !dbg !589 %6 = load i32, ptr %3, align 4, !dbg !592 %7 = icmp eq i32 %6, 0, !dbg !593 ret i1 %7, !dbg !594 } -declare i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef) #2 +declare i32 @pthread_rwlock_trywrlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { @@ -1192,7 +1192,7 @@ define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { call void @llvm.dbg.declare(metadata ptr %2, metadata !596, metadata !DIExpression()), !dbg !597 call void @llvm.dbg.declare(metadata ptr %3, metadata !598, metadata !DIExpression()), !dbg !599 %4 = load ptr, ptr %2, align 8, !dbg !600 - %5 = call i32 @"\01_pthread_rwlock_rdlock"(ptr noundef %4), !dbg !601 + %5 = call i32 @pthread_rwlock_rdlock(ptr noundef %4), !dbg !601 store i32 %5, ptr %3, align 4, !dbg !599 %6 = load i32, ptr %3, align 4, !dbg !602 %7 = icmp eq i32 %6, 0, !dbg !602 @@ -1216,7 +1216,7 @@ define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { ret void, !dbg !603 } -declare i32 @"\01_pthread_rwlock_rdlock"(ptr noundef) #2 +declare i32 @pthread_rwlock_rdlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !604 { @@ -1226,14 +1226,14 @@ define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !604 { call void @llvm.dbg.declare(metadata ptr %2, metadata !605, metadata !DIExpression()), !dbg !606 call void @llvm.dbg.declare(metadata ptr %3, metadata !607, metadata !DIExpression()), !dbg !608 %4 = load ptr, ptr %2, align 8, !dbg !609 - %5 = call i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef %4), !dbg !610 + %5 = call i32 @pthread_rwlock_tryrdlock(ptr noundef %4), !dbg !610 store i32 %5, ptr %3, align 4, !dbg !608 %6 = load i32, ptr %3, align 4, !dbg !611 %7 = icmp eq i32 %6, 0, !dbg !612 ret i1 %7, !dbg !613 } -declare i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef) #2 +declare i32 @pthread_rwlock_tryrdlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { @@ -1243,7 +1243,7 @@ define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { call void @llvm.dbg.declare(metadata ptr %2, metadata !615, metadata !DIExpression()), !dbg !616 call void @llvm.dbg.declare(metadata ptr %3, metadata !617, metadata !DIExpression()), !dbg !618 %4 = load ptr, ptr %2, align 8, !dbg !619 - %5 = call i32 @"\01_pthread_rwlock_unlock"(ptr noundef %4), !dbg !620 + %5 = call i32 @pthread_rwlock_unlock(ptr noundef %4), !dbg !620 store i32 %5, ptr %3, align 4, !dbg !618 %6 = load i32, ptr %3, align 4, !dbg !621 %7 = icmp eq i32 %6, 0, !dbg !621 @@ -1267,7 +1267,7 @@ define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { ret void, !dbg !622 } -declare i32 @"\01_pthread_rwlock_unlock"(ptr noundef) #2 +declare i32 @pthread_rwlock_unlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_test() #0 !dbg !623 { From 9aabdf99fbc8622f091d70d881fd1f208769ebc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Mon, 18 Dec 2023 23:25:46 +0100 Subject: [PATCH 18/21] Fixes --- benchmarks/c/miscellaneous/pthread.c | 23 +- .../program/processing/Intrinsics.java | 37 +- .../test/resources/miscellaneous/pthread.ll | 2855 +++++++++-------- 3 files changed, 1476 insertions(+), 1439 deletions(-) diff --git a/benchmarks/c/miscellaneous/pthread.c b/benchmarks/c/miscellaneous/pthread.c index 2b5c5ee51d..f912b50c41 100644 --- a/benchmarks/c/miscellaneous/pthread.c +++ b/benchmarks/c/miscellaneous/pthread.c @@ -1,8 +1,7 @@ #include #include #include -//TODO #include -void __VERIFIER_loop_bound(int); +#include // Test basic support for the pthread library. // Library symbols can be recognized by the `pthread_` prefix. @@ -202,20 +201,28 @@ int phase = 0; void* cond_worker(void* message) { - for (bool idle = true; idle; ) + bool idle = true; { mutex_lock(&cond_mutex); + ++phase; cond_wait(&cond, &cond_mutex); - idle = phase < 1; + ++phase; + idle = phase < 2; mutex_unlock(&cond_mutex); } - for (bool idle = true; idle; ) + if (idle) + return ((char*) message) + 1; + idle = true; { mutex_lock(&cond_mutex); + ++phase; cond_timedwait(&cond, &cond_mutex, 10L); - idle = phase < 2; + ++phase; + idle = phase > 6; mutex_unlock(&cond_mutex); } + if (idle) + return ((char*) message) + 2; return message; } @@ -326,7 +333,7 @@ void rwlock_test() } { - __VERIFIER_loop_bound(test_depth); + __VERIFIER_loop_bound(test_depth + 1); for (int i = 0; i < test_depth; i++) { bool success = rwlock_tryrdlock(&lock); @@ -338,7 +345,7 @@ void rwlock_test() assert(!success); } - __VERIFIER_loop_bound(test_depth); + __VERIFIER_loop_bound(test_depth + 1); for (int i = 0; i < test_depth; i++) { rwlock_unlock(&lock); } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index aa5e336fb6..d51bdb6759 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -45,6 +45,7 @@ * if the input program does not already provide a definition. * Also defines the semantics of most intrinsics, * except some thread-library primitives, which are instead defined in {@link ThreadCreation}. + * TODO due to name mangling schemes, some library calls we treat as intrinsics may have */ @Options public class Intrinsics { @@ -124,12 +125,15 @@ public enum Info { P_THREAD_ATTR_SET(P_THREAD_ATTR.stream().map(a -> "pthread_attr_set" + a).toList(), true, true, true, true, Intrinsics::inlinePthreadAttr), // --------------------------- pthread condition variable --------------------------- - P_THREAD_COND_INIT("pthread_cond_init", true, true, true, true, Intrinsics::inlinePthreadCondInit), + P_THREAD_COND_INIT(List.of("pthread_cond_init", "\"\\01_pthread_cond_init\""), + true, true, true, true, Intrinsics::inlinePthreadCondInit), P_THREAD_COND_DESTROY("pthread_cond_destroy", true, false, true, true, Intrinsics::inlinePthreadCondDestroy), P_THREAD_COND_SIGNAL("pthread_cond_signal", true, false, true, true, Intrinsics::inlinePthreadCondSignal), P_THREAD_COND_BROADCAST("pthread_cond_broadcast", true, false, true, true, Intrinsics::inlinePthreadCondBroadcast), - P_THREAD_COND_WAIT("pthread_cond_wait", false, true, false, true, Intrinsics::inlinePthreadCondWait), - P_THREAD_COND_TIMEDWAIT("pthread_cond_timedwait", false, false, true, true, Intrinsics::inlinePthreadCondTimedwait), + P_THREAD_COND_WAIT(List.of("pthread_cond_wait", "\"\\01_pthread_cond_wait\""), + false, true, false, true, Intrinsics::inlinePthreadCondWait), + P_THREAD_COND_TIMEDWAIT(List.of("pthread_cond_timedwait", "\"\\01_pthread_cond_timedwait\""), + false, false, true, true, Intrinsics::inlinePthreadCondTimedwait), P_THREAD_CONDATTR_INIT("pthread_condattr_init", true, true, true, true, Intrinsics::inlinePthreadCondAttr), P_THREAD_CONDATTR_DESTROY("pthread_condattr_destroy", true, true, true, true, Intrinsics::inlinePthreadCondAttr), // --------------------------- pthread key --------------------------- @@ -144,19 +148,27 @@ public enum Info { P_THREAD_MUTEX_TRYLOCK("pthread_mutex_trylock", true, true, true, true, Intrinsics::inlinePthreadMutexTryLock), P_THREAD_MUTEX_UNLOCK("pthread_mutex_unlock", true, true, true, true, Intrinsics::inlinePthreadMutexUnlock), P_THREAD_MUTEXATTR_INIT("pthread_mutexattr_init", true, true, true, true, Intrinsics::inlinePthreadMutexAttr), - P_THREAD_MUTEXATTR_DESTROY("pthread_mutexattr_destroy", true, true, true, true, Intrinsics::inlinePthreadMutexAttr), + P_THREAD_MUTEXATTR_DESTROY(List.of("pthread_mutexattr_destroy", "\"\\01_pthread_mutexattr_destroy\""), + true, true, true, true, Intrinsics::inlinePthreadMutexAttr), P_THREAD_MUTEXATTR_SET(P_THREAD_MUTEXATTR.stream().map(a -> "pthread_mutexattr_get" + a).toList(), true, true, true, true, Intrinsics::inlinePthreadMutexAttr), P_THREAD_MUTEXATTR_GET(P_THREAD_MUTEXATTR.stream().map(a -> "pthread_mutexattr_set" + a).toList(), true, true, true, true, Intrinsics::inlinePthreadMutexAttr), // --------------------------- pthread read/write lock --------------------------- - P_THREAD_RWLOCK_INIT("pthread_rwlock_init", true, false, true, true, Intrinsics::inlinePthreadRwlockInit), - P_THREAD_RWLOCK_DESTROY("pthread_rwlock_destroy", true, true, true, true, Intrinsics::inlinePthreadRwlockDestroy), - P_THREAD_RWLOCK_WRLOCK("pthread_rwlock_wrlock", true, true, false, true, Intrinsics::inlinePthreadRwlockWrlock), - P_THREAD_RWLOCK_TRYWRLOCK("pthread_rwlock_trywrlock", true, true, true, true, Intrinsics::inlinePthreadRwlockTryWrlock), - P_THREAD_RWLOCK_RDLOCK("pthread_rwlock_rdlock", true, true, false, true, Intrinsics::inlinePthreadRwlockRdlock), - P_THREAD_RWLOCK_TRYRDLOCK("pthread_rwlock_tryrdlock", true, true, true, true, Intrinsics::inlinePthreadRwlockTryRdlock), - P_THREAD_RWLOCK_UNLOCK("pthread_rwlock_unlock", true, false, true, true, Intrinsics::inlinePthreadRwlockUnlock), + P_THREAD_RWLOCK_INIT(List.of("pthread_rwlock_init", "\"\\01_pthread_rwlock_init\""), + true, false, true, true, Intrinsics::inlinePthreadRwlockInit), + P_THREAD_RWLOCK_DESTROY(List.of("pthread_rwlock_destroy", "\"\\01_pthread_rwlock_destroy\""), + true, true, true, true, Intrinsics::inlinePthreadRwlockDestroy), + P_THREAD_RWLOCK_WRLOCK(List.of("pthread_rwlock_wrlock", "\"\\01_pthread_rwlock_wrlock\""), + true, true, false, true, Intrinsics::inlinePthreadRwlockWrlock), + P_THREAD_RWLOCK_TRYWRLOCK(List.of("pthread_rwlock_trywrlock", "\"\\01_pthread_rwlock_trywrlock\""), + true, true, true, true, Intrinsics::inlinePthreadRwlockTryWrlock), + P_THREAD_RWLOCK_RDLOCK(List.of("pthread_rwlock_rdlock", "\"\\01_pthread_rwlock_rdlock\""), + true, true, false, true, Intrinsics::inlinePthreadRwlockRdlock), + P_THREAD_RWLOCK_TRYRDLOCK(List.of("pthread_rwlock_tryrdlock", "\"\\01_pthread_rwlock_tryrdlock\""), + true, true, true, true, Intrinsics::inlinePthreadRwlockTryRdlock), + P_THREAD_RWLOCK_UNLOCK(List.of("pthread_rwlock_unlock", "\"\\01_pthread_rwlock_unlock\""), + true, false, true, true, Intrinsics::inlinePthreadRwlockUnlock), P_THREAD_RWLOCKATTR_INIT("pthread_rwlockattr_init", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), P_THREAD_RWLOCKATTR_DESTROY("pthread_rwlockattr_destroy", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), P_THREAD_RWLOCKATTR_SET("pthread_rwlockattr_setpshared", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), @@ -397,8 +409,9 @@ private List inlinePthreadEqual(FunctionCall call) { final Register resultRegister = getResultRegisterAndCheckArguments(2, call); final Expression leftId = call.getArguments().get(0); final Expression rightId = call.getArguments().get(1); + final Expression equation = expressions.makeEQ(leftId, rightId); return List.of( - EventFactory.newLocal(resultRegister, expressions.makeEQ(leftId, rightId)) + EventFactory.newLocal(resultRegister, expressions.makeCast(equation, resultRegister.getType())) ); } diff --git a/dartagnan/src/test/resources/miscellaneous/pthread.ll b/dartagnan/src/test/resources/miscellaneous/pthread.ll index d86dc5c517..e45283a80c 100644 --- a/dartagnan/src/test/resources/miscellaneous/pthread.ll +++ b/dartagnan/src/test/resources/miscellaneous/pthread.ll @@ -28,64 +28,64 @@ target triple = "arm64-apple-macosx14.0.0" @__func__.cond_signal = private unnamed_addr constant [12 x i8] c"cond_signal\00", align 1, !dbg !52 @__func__.cond_broadcast = private unnamed_addr constant [15 x i8] c"cond_broadcast\00", align 1, !dbg !54 @phase = global i32 0, align 4, !dbg !59 -@cond_mutex = global %struct._opaque_pthread_mutex_t zeroinitializer, align 8, !dbg !99 -@cond = global %struct._opaque_pthread_cond_t zeroinitializer, align 8, !dbg !113 -@__func__.cond_test = private unnamed_addr constant [10 x i8] c"cond_test\00", align 1, !dbg !65 -@.str.4 = private unnamed_addr constant [18 x i8] c"result == message\00", align 1, !dbg !67 -@__func__.rwlock_init = private unnamed_addr constant [12 x i8] c"rwlock_init\00", align 1, !dbg !72 -@__func__.rwlock_destroy = private unnamed_addr constant [15 x i8] c"rwlock_destroy\00", align 1, !dbg !74 -@__func__.rwlock_wrlock = private unnamed_addr constant [14 x i8] c"rwlock_wrlock\00", align 1, !dbg !76 -@__func__.rwlock_rdlock = private unnamed_addr constant [14 x i8] c"rwlock_rdlock\00", align 1, !dbg !78 -@__func__.rwlock_unlock = private unnamed_addr constant [14 x i8] c"rwlock_unlock\00", align 1, !dbg !80 -@__func__.rwlock_test = private unnamed_addr constant [12 x i8] c"rwlock_test\00", align 1, !dbg !82 -@latest_thread = global ptr null, align 8, !dbg !125 -@local_data = global i64 0, align 8, !dbg !148 -@__func__.key_worker = private unnamed_addr constant [11 x i8] c"key_worker\00", align 1, !dbg !84 -@.str.5 = private unnamed_addr constant [28 x i8] c"my_local_data == &my_secret\00", align 1, !dbg !86 -@__func__.key_test = private unnamed_addr constant [9 x i8] c"key_test\00", align 1, !dbg !91 -@.str.6 = private unnamed_addr constant [37 x i8] c"pthread_equal(latest_thread, worker)\00", align 1, !dbg !94 +@cond_mutex = global %struct._opaque_pthread_mutex_t zeroinitializer, align 8, !dbg !100 +@cond = global %struct._opaque_pthread_cond_t zeroinitializer, align 8, !dbg !114 +@__func__.cond_test = private unnamed_addr constant [10 x i8] c"cond_test\00", align 1, !dbg !66 +@.str.4 = private unnamed_addr constant [18 x i8] c"result == message\00", align 1, !dbg !68 +@__func__.rwlock_init = private unnamed_addr constant [12 x i8] c"rwlock_init\00", align 1, !dbg !73 +@__func__.rwlock_destroy = private unnamed_addr constant [15 x i8] c"rwlock_destroy\00", align 1, !dbg !75 +@__func__.rwlock_wrlock = private unnamed_addr constant [14 x i8] c"rwlock_wrlock\00", align 1, !dbg !77 +@__func__.rwlock_rdlock = private unnamed_addr constant [14 x i8] c"rwlock_rdlock\00", align 1, !dbg !79 +@__func__.rwlock_unlock = private unnamed_addr constant [14 x i8] c"rwlock_unlock\00", align 1, !dbg !81 +@__func__.rwlock_test = private unnamed_addr constant [12 x i8] c"rwlock_test\00", align 1, !dbg !83 +@latest_thread = global ptr null, align 8, !dbg !126 +@local_data = global i64 0, align 8, !dbg !149 +@__func__.key_worker = private unnamed_addr constant [11 x i8] c"key_worker\00", align 1, !dbg !85 +@.str.5 = private unnamed_addr constant [28 x i8] c"my_local_data == &my_secret\00", align 1, !dbg !87 +@__func__.key_test = private unnamed_addr constant [9 x i8] c"key_test\00", align 1, !dbg !92 +@.str.6 = private unnamed_addr constant [37 x i8] c"pthread_equal(latest_thread, worker)\00", align 1, !dbg !95 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @thread_create(ptr noundef %0, ptr noundef %1) #0 !dbg !162 { +define ptr @thread_create(ptr noundef %0, ptr noundef %1) #0 !dbg !163 { %3 = alloca ptr, align 8 %4 = alloca ptr, align 8 %5 = alloca ptr, align 8 %6 = alloca %struct._opaque_pthread_attr_t, align 8 %7 = alloca i32, align 4 store ptr %0, ptr %3, align 8 - call void @llvm.dbg.declare(metadata ptr %3, metadata !169, metadata !DIExpression()), !dbg !170 + call void @llvm.dbg.declare(metadata ptr %3, metadata !170, metadata !DIExpression()), !dbg !171 store ptr %1, ptr %4, align 8 - call void @llvm.dbg.declare(metadata ptr %4, metadata !171, metadata !DIExpression()), !dbg !172 - call void @llvm.dbg.declare(metadata ptr %5, metadata !173, metadata !DIExpression()), !dbg !174 - call void @llvm.dbg.declare(metadata ptr %6, metadata !175, metadata !DIExpression()), !dbg !183 - %8 = call i32 @pthread_attr_init(ptr noundef %6), !dbg !184 - call void @llvm.dbg.declare(metadata ptr %7, metadata !185, metadata !DIExpression()), !dbg !186 - %9 = load ptr, ptr %3, align 8, !dbg !187 - %10 = load ptr, ptr %4, align 8, !dbg !188 - %11 = call i32 @pthread_create(ptr noundef %5, ptr noundef %6, ptr noundef %9, ptr noundef %10), !dbg !189 - store i32 %11, ptr %7, align 4, !dbg !186 - %12 = load i32, ptr %7, align 4, !dbg !190 - %13 = icmp eq i32 %12, 0, !dbg !190 - %14 = xor i1 %13, true, !dbg !190 - %15 = zext i1 %14 to i32, !dbg !190 - %16 = sext i32 %15 to i64, !dbg !190 - %17 = icmp ne i64 %16, 0, !dbg !190 - br i1 %17, label %18, label %20, !dbg !190 + call void @llvm.dbg.declare(metadata ptr %4, metadata !172, metadata !DIExpression()), !dbg !173 + call void @llvm.dbg.declare(metadata ptr %5, metadata !174, metadata !DIExpression()), !dbg !175 + call void @llvm.dbg.declare(metadata ptr %6, metadata !176, metadata !DIExpression()), !dbg !184 + %8 = call i32 @pthread_attr_init(ptr noundef %6), !dbg !185 + call void @llvm.dbg.declare(metadata ptr %7, metadata !186, metadata !DIExpression()), !dbg !187 + %9 = load ptr, ptr %3, align 8, !dbg !188 + %10 = load ptr, ptr %4, align 8, !dbg !189 + %11 = call i32 @pthread_create(ptr noundef %5, ptr noundef %6, ptr noundef %9, ptr noundef %10), !dbg !190 + store i32 %11, ptr %7, align 4, !dbg !187 + %12 = load i32, ptr %7, align 4, !dbg !191 + %13 = icmp eq i32 %12, 0, !dbg !191 + %14 = xor i1 %13, true, !dbg !191 + %15 = zext i1 %14 to i32, !dbg !191 + %16 = sext i32 %15 to i64, !dbg !191 + %17 = icmp ne i64 %16, 0, !dbg !191 + br i1 %17, label %18, label %20, !dbg !191 18: ; preds = %2 - call void @__assert_rtn(ptr noundef @__func__.thread_create, ptr noundef @.str, i32 noundef 19, ptr noundef @.str.1) #4, !dbg !190 - unreachable, !dbg !190 + call void @__assert_rtn(ptr noundef @__func__.thread_create, ptr noundef @.str, i32 noundef 18, ptr noundef @.str.1) #4, !dbg !191 + unreachable, !dbg !191 19: ; No predecessors! - br label %21, !dbg !190 + br label %21, !dbg !191 20: ; preds = %2 - br label %21, !dbg !190 + br label %21, !dbg !191 21: ; preds = %20, %19 - %22 = call i32 @pthread_attr_destroy(ptr noundef %6), !dbg !191 - %23 = load ptr, ptr %5, align 8, !dbg !192 - ret ptr %23, !dbg !193 + %22 = call i32 @pthread_attr_destroy(ptr noundef %6), !dbg !192 + %23 = load ptr, ptr %5, align 8, !dbg !193 + ret ptr %23, !dbg !194 } ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn @@ -101,44 +101,44 @@ declare void @__assert_rtn(ptr noundef, ptr noundef, i32 noundef, ptr noundef) # declare i32 @pthread_attr_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @thread_join(ptr noundef %0) #0 !dbg !194 { +define ptr @thread_join(ptr noundef %0) #0 !dbg !195 { %2 = alloca ptr, align 8 %3 = alloca ptr, align 8 %4 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !197, metadata !DIExpression()), !dbg !198 - call void @llvm.dbg.declare(metadata ptr %3, metadata !199, metadata !DIExpression()), !dbg !200 - call void @llvm.dbg.declare(metadata ptr %4, metadata !201, metadata !DIExpression()), !dbg !202 - %5 = load ptr, ptr %2, align 8, !dbg !203 - %6 = call i32 @pthread_join(ptr noundef %5, ptr noundef %3), !dbg !204 - store i32 %6, ptr %4, align 4, !dbg !202 - %7 = load i32, ptr %4, align 4, !dbg !205 - %8 = icmp eq i32 %7, 0, !dbg !205 - %9 = xor i1 %8, true, !dbg !205 - %10 = zext i1 %9 to i32, !dbg !205 - %11 = sext i32 %10 to i64, !dbg !205 - %12 = icmp ne i64 %11, 0, !dbg !205 - br i1 %12, label %13, label %15, !dbg !205 + call void @llvm.dbg.declare(metadata ptr %2, metadata !198, metadata !DIExpression()), !dbg !199 + call void @llvm.dbg.declare(metadata ptr %3, metadata !200, metadata !DIExpression()), !dbg !201 + call void @llvm.dbg.declare(metadata ptr %4, metadata !202, metadata !DIExpression()), !dbg !203 + %5 = load ptr, ptr %2, align 8, !dbg !204 + %6 = call i32 @"\01_pthread_join"(ptr noundef %5, ptr noundef %3), !dbg !205 + store i32 %6, ptr %4, align 4, !dbg !203 + %7 = load i32, ptr %4, align 4, !dbg !206 + %8 = icmp eq i32 %7, 0, !dbg !206 + %9 = xor i1 %8, true, !dbg !206 + %10 = zext i1 %9 to i32, !dbg !206 + %11 = sext i32 %10 to i64, !dbg !206 + %12 = icmp ne i64 %11, 0, !dbg !206 + br i1 %12, label %13, label %15, !dbg !206 13: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.thread_join, ptr noundef @.str, i32 noundef 28, ptr noundef @.str.1) #4, !dbg !205 - unreachable, !dbg !205 + call void @__assert_rtn(ptr noundef @__func__.thread_join, ptr noundef @.str, i32 noundef 27, ptr noundef @.str.1) #4, !dbg !206 + unreachable, !dbg !206 14: ; No predecessors! - br label %16, !dbg !205 + br label %16, !dbg !206 15: ; preds = %1 - br label %16, !dbg !205 + br label %16, !dbg !206 16: ; preds = %15, %14 - %17 = load ptr, ptr %3, align 8, !dbg !206 - ret ptr %17, !dbg !207 + %17 = load ptr, ptr %3, align 8, !dbg !207 + ret ptr %17, !dbg !208 } -declare i32 @pthread_join(ptr noundef, ptr noundef) #2 +declare i32 @"\01_pthread_join"(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 !dbg !208 { +define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 !dbg !209 { %6 = alloca ptr, align 8 %7 = alloca i32, align 4 %8 = alloca i32, align 4 @@ -148,255 +148,255 @@ define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noun %12 = alloca i32, align 4 %13 = alloca %struct._opaque_pthread_mutexattr_t, align 8 store ptr %0, ptr %6, align 8 - call void @llvm.dbg.declare(metadata ptr %6, metadata !212, metadata !DIExpression()), !dbg !213 + call void @llvm.dbg.declare(metadata ptr %6, metadata !213, metadata !DIExpression()), !dbg !214 store i32 %1, ptr %7, align 4 - call void @llvm.dbg.declare(metadata ptr %7, metadata !214, metadata !DIExpression()), !dbg !215 + call void @llvm.dbg.declare(metadata ptr %7, metadata !215, metadata !DIExpression()), !dbg !216 store i32 %2, ptr %8, align 4 - call void @llvm.dbg.declare(metadata ptr %8, metadata !216, metadata !DIExpression()), !dbg !217 + call void @llvm.dbg.declare(metadata ptr %8, metadata !217, metadata !DIExpression()), !dbg !218 store i32 %3, ptr %9, align 4 - call void @llvm.dbg.declare(metadata ptr %9, metadata !218, metadata !DIExpression()), !dbg !219 + call void @llvm.dbg.declare(metadata ptr %9, metadata !219, metadata !DIExpression()), !dbg !220 store i32 %4, ptr %10, align 4 - call void @llvm.dbg.declare(metadata ptr %10, metadata !220, metadata !DIExpression()), !dbg !221 - call void @llvm.dbg.declare(metadata ptr %11, metadata !222, metadata !DIExpression()), !dbg !223 - call void @llvm.dbg.declare(metadata ptr %12, metadata !224, metadata !DIExpression()), !dbg !225 - call void @llvm.dbg.declare(metadata ptr %13, metadata !226, metadata !DIExpression()), !dbg !234 - %14 = call i32 @pthread_mutexattr_init(ptr noundef %13), !dbg !235 - store i32 %14, ptr %11, align 4, !dbg !236 - %15 = load i32, ptr %11, align 4, !dbg !237 - %16 = icmp eq i32 %15, 0, !dbg !237 - %17 = xor i1 %16, true, !dbg !237 - %18 = zext i1 %17 to i32, !dbg !237 - %19 = sext i32 %18 to i64, !dbg !237 - %20 = icmp ne i64 %19, 0, !dbg !237 - br i1 %20, label %21, label %23, !dbg !237 + call void @llvm.dbg.declare(metadata ptr %10, metadata !221, metadata !DIExpression()), !dbg !222 + call void @llvm.dbg.declare(metadata ptr %11, metadata !223, metadata !DIExpression()), !dbg !224 + call void @llvm.dbg.declare(metadata ptr %12, metadata !225, metadata !DIExpression()), !dbg !226 + call void @llvm.dbg.declare(metadata ptr %13, metadata !227, metadata !DIExpression()), !dbg !235 + %14 = call i32 @pthread_mutexattr_init(ptr noundef %13), !dbg !236 + store i32 %14, ptr %11, align 4, !dbg !237 + %15 = load i32, ptr %11, align 4, !dbg !238 + %16 = icmp eq i32 %15, 0, !dbg !238 + %17 = xor i1 %16, true, !dbg !238 + %18 = zext i1 %17 to i32, !dbg !238 + %19 = sext i32 %18 to i64, !dbg !238 + %20 = icmp ne i64 %19, 0, !dbg !238 + br i1 %20, label %21, label %23, !dbg !238 21: ; preds = %5 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 50, ptr noundef @.str.1) #4, !dbg !237 - unreachable, !dbg !237 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 49, ptr noundef @.str.1) #4, !dbg !238 + unreachable, !dbg !238 22: ; No predecessors! - br label %24, !dbg !237 + br label %24, !dbg !238 23: ; preds = %5 - br label %24, !dbg !237 + br label %24, !dbg !238 24: ; preds = %23, %22 - %25 = load i32, ptr %7, align 4, !dbg !238 - %26 = call i32 @pthread_mutexattr_settype(ptr noundef %13, i32 noundef %25), !dbg !239 - store i32 %26, ptr %11, align 4, !dbg !240 - %27 = load i32, ptr %11, align 4, !dbg !241 - %28 = icmp eq i32 %27, 0, !dbg !241 - %29 = xor i1 %28, true, !dbg !241 - %30 = zext i1 %29 to i32, !dbg !241 - %31 = sext i32 %30 to i64, !dbg !241 - %32 = icmp ne i64 %31, 0, !dbg !241 - br i1 %32, label %33, label %35, !dbg !241 + %25 = load i32, ptr %7, align 4, !dbg !239 + %26 = call i32 @pthread_mutexattr_settype(ptr noundef %13, i32 noundef %25), !dbg !240 + store i32 %26, ptr %11, align 4, !dbg !241 + %27 = load i32, ptr %11, align 4, !dbg !242 + %28 = icmp eq i32 %27, 0, !dbg !242 + %29 = xor i1 %28, true, !dbg !242 + %30 = zext i1 %29 to i32, !dbg !242 + %31 = sext i32 %30 to i64, !dbg !242 + %32 = icmp ne i64 %31, 0, !dbg !242 + br i1 %32, label %33, label %35, !dbg !242 33: ; preds = %24 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 53, ptr noundef @.str.1) #4, !dbg !241 - unreachable, !dbg !241 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 52, ptr noundef @.str.1) #4, !dbg !242 + unreachable, !dbg !242 34: ; No predecessors! - br label %36, !dbg !241 + br label %36, !dbg !242 35: ; preds = %24 - br label %36, !dbg !241 + br label %36, !dbg !242 36: ; preds = %35, %34 - %37 = call i32 @pthread_mutexattr_gettype(ptr noundef %13, ptr noundef %12), !dbg !242 - store i32 %37, ptr %11, align 4, !dbg !243 - %38 = load i32, ptr %11, align 4, !dbg !244 - %39 = icmp eq i32 %38, 0, !dbg !244 - %40 = xor i1 %39, true, !dbg !244 - %41 = zext i1 %40 to i32, !dbg !244 - %42 = sext i32 %41 to i64, !dbg !244 - %43 = icmp ne i64 %42, 0, !dbg !244 - br i1 %43, label %44, label %46, !dbg !244 + %37 = call i32 @pthread_mutexattr_gettype(ptr noundef %13, ptr noundef %12), !dbg !243 + store i32 %37, ptr %11, align 4, !dbg !244 + %38 = load i32, ptr %11, align 4, !dbg !245 + %39 = icmp eq i32 %38, 0, !dbg !245 + %40 = xor i1 %39, true, !dbg !245 + %41 = zext i1 %40 to i32, !dbg !245 + %42 = sext i32 %41 to i64, !dbg !245 + %43 = icmp ne i64 %42, 0, !dbg !245 + br i1 %43, label %44, label %46, !dbg !245 44: ; preds = %36 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 55, ptr noundef @.str.1) #4, !dbg !244 - unreachable, !dbg !244 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 54, ptr noundef @.str.1) #4, !dbg !245 + unreachable, !dbg !245 45: ; No predecessors! - br label %47, !dbg !244 + br label %47, !dbg !245 46: ; preds = %36 - br label %47, !dbg !244 + br label %47, !dbg !245 47: ; preds = %46, %45 - %48 = load i32, ptr %8, align 4, !dbg !245 - %49 = call i32 @pthread_mutexattr_setprotocol(ptr noundef %13, i32 noundef %48), !dbg !246 - store i32 %49, ptr %11, align 4, !dbg !247 - %50 = load i32, ptr %11, align 4, !dbg !248 - %51 = icmp eq i32 %50, 0, !dbg !248 - %52 = xor i1 %51, true, !dbg !248 - %53 = zext i1 %52 to i32, !dbg !248 - %54 = sext i32 %53 to i64, !dbg !248 - %55 = icmp ne i64 %54, 0, !dbg !248 - br i1 %55, label %56, label %58, !dbg !248 + %48 = load i32, ptr %8, align 4, !dbg !246 + %49 = call i32 @pthread_mutexattr_setprotocol(ptr noundef %13, i32 noundef %48), !dbg !247 + store i32 %49, ptr %11, align 4, !dbg !248 + %50 = load i32, ptr %11, align 4, !dbg !249 + %51 = icmp eq i32 %50, 0, !dbg !249 + %52 = xor i1 %51, true, !dbg !249 + %53 = zext i1 %52 to i32, !dbg !249 + %54 = sext i32 %53 to i64, !dbg !249 + %55 = icmp ne i64 %54, 0, !dbg !249 + br i1 %55, label %56, label %58, !dbg !249 56: ; preds = %47 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 58, ptr noundef @.str.1) #4, !dbg !248 - unreachable, !dbg !248 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 57, ptr noundef @.str.1) #4, !dbg !249 + unreachable, !dbg !249 57: ; No predecessors! - br label %59, !dbg !248 + br label %59, !dbg !249 58: ; preds = %47 - br label %59, !dbg !248 + br label %59, !dbg !249 59: ; preds = %58, %57 - %60 = call i32 @pthread_mutexattr_getprotocol(ptr noundef %13, ptr noundef %12), !dbg !249 - store i32 %60, ptr %11, align 4, !dbg !250 - %61 = load i32, ptr %11, align 4, !dbg !251 - %62 = icmp eq i32 %61, 0, !dbg !251 - %63 = xor i1 %62, true, !dbg !251 - %64 = zext i1 %63 to i32, !dbg !251 - %65 = sext i32 %64 to i64, !dbg !251 - %66 = icmp ne i64 %65, 0, !dbg !251 - br i1 %66, label %67, label %69, !dbg !251 + %60 = call i32 @pthread_mutexattr_getprotocol(ptr noundef %13, ptr noundef %12), !dbg !250 + store i32 %60, ptr %11, align 4, !dbg !251 + %61 = load i32, ptr %11, align 4, !dbg !252 + %62 = icmp eq i32 %61, 0, !dbg !252 + %63 = xor i1 %62, true, !dbg !252 + %64 = zext i1 %63 to i32, !dbg !252 + %65 = sext i32 %64 to i64, !dbg !252 + %66 = icmp ne i64 %65, 0, !dbg !252 + br i1 %66, label %67, label %69, !dbg !252 67: ; preds = %59 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 60, ptr noundef @.str.1) #4, !dbg !251 - unreachable, !dbg !251 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 59, ptr noundef @.str.1) #4, !dbg !252 + unreachable, !dbg !252 68: ; No predecessors! - br label %70, !dbg !251 + br label %70, !dbg !252 69: ; preds = %59 - br label %70, !dbg !251 + br label %70, !dbg !252 70: ; preds = %69, %68 - %71 = load i32, ptr %9, align 4, !dbg !252 - %72 = call i32 @pthread_mutexattr_setpolicy_np(ptr noundef %13, i32 noundef %71), !dbg !253 - store i32 %72, ptr %11, align 4, !dbg !254 - %73 = load i32, ptr %11, align 4, !dbg !255 - %74 = icmp eq i32 %73, 0, !dbg !255 - %75 = xor i1 %74, true, !dbg !255 - %76 = zext i1 %75 to i32, !dbg !255 - %77 = sext i32 %76 to i64, !dbg !255 - %78 = icmp ne i64 %77, 0, !dbg !255 - br i1 %78, label %79, label %81, !dbg !255 + %71 = load i32, ptr %9, align 4, !dbg !253 + %72 = call i32 @pthread_mutexattr_setpolicy_np(ptr noundef %13, i32 noundef %71), !dbg !254 + store i32 %72, ptr %11, align 4, !dbg !255 + %73 = load i32, ptr %11, align 4, !dbg !256 + %74 = icmp eq i32 %73, 0, !dbg !256 + %75 = xor i1 %74, true, !dbg !256 + %76 = zext i1 %75 to i32, !dbg !256 + %77 = sext i32 %76 to i64, !dbg !256 + %78 = icmp ne i64 %77, 0, !dbg !256 + br i1 %78, label %79, label %81, !dbg !256 79: ; preds = %70 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 63, ptr noundef @.str.1) #4, !dbg !255 - unreachable, !dbg !255 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 62, ptr noundef @.str.1) #4, !dbg !256 + unreachable, !dbg !256 80: ; No predecessors! - br label %82, !dbg !255 + br label %82, !dbg !256 81: ; preds = %70 - br label %82, !dbg !255 + br label %82, !dbg !256 82: ; preds = %81, %80 - %83 = call i32 @pthread_mutexattr_getpolicy_np(ptr noundef %13, ptr noundef %12), !dbg !256 - store i32 %83, ptr %11, align 4, !dbg !257 - %84 = load i32, ptr %11, align 4, !dbg !258 - %85 = icmp eq i32 %84, 0, !dbg !258 - %86 = xor i1 %85, true, !dbg !258 - %87 = zext i1 %86 to i32, !dbg !258 - %88 = sext i32 %87 to i64, !dbg !258 - %89 = icmp ne i64 %88, 0, !dbg !258 - br i1 %89, label %90, label %92, !dbg !258 + %83 = call i32 @pthread_mutexattr_getpolicy_np(ptr noundef %13, ptr noundef %12), !dbg !257 + store i32 %83, ptr %11, align 4, !dbg !258 + %84 = load i32, ptr %11, align 4, !dbg !259 + %85 = icmp eq i32 %84, 0, !dbg !259 + %86 = xor i1 %85, true, !dbg !259 + %87 = zext i1 %86 to i32, !dbg !259 + %88 = sext i32 %87 to i64, !dbg !259 + %89 = icmp ne i64 %88, 0, !dbg !259 + br i1 %89, label %90, label %92, !dbg !259 90: ; preds = %82 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 65, ptr noundef @.str.1) #4, !dbg !258 - unreachable, !dbg !258 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 64, ptr noundef @.str.1) #4, !dbg !259 + unreachable, !dbg !259 91: ; No predecessors! - br label %93, !dbg !258 + br label %93, !dbg !259 92: ; preds = %82 - br label %93, !dbg !258 + br label %93, !dbg !259 93: ; preds = %92, %91 - %94 = load i32, ptr %10, align 4, !dbg !259 - %95 = call i32 @pthread_mutexattr_setprioceiling(ptr noundef %13, i32 noundef %94), !dbg !260 - store i32 %95, ptr %11, align 4, !dbg !261 - %96 = load i32, ptr %11, align 4, !dbg !262 - %97 = icmp eq i32 %96, 0, !dbg !262 - %98 = xor i1 %97, true, !dbg !262 - %99 = zext i1 %98 to i32, !dbg !262 - %100 = sext i32 %99 to i64, !dbg !262 - %101 = icmp ne i64 %100, 0, !dbg !262 - br i1 %101, label %102, label %104, !dbg !262 + %94 = load i32, ptr %10, align 4, !dbg !260 + %95 = call i32 @pthread_mutexattr_setprioceiling(ptr noundef %13, i32 noundef %94), !dbg !261 + store i32 %95, ptr %11, align 4, !dbg !262 + %96 = load i32, ptr %11, align 4, !dbg !263 + %97 = icmp eq i32 %96, 0, !dbg !263 + %98 = xor i1 %97, true, !dbg !263 + %99 = zext i1 %98 to i32, !dbg !263 + %100 = sext i32 %99 to i64, !dbg !263 + %101 = icmp ne i64 %100, 0, !dbg !263 + br i1 %101, label %102, label %104, !dbg !263 102: ; preds = %93 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 68, ptr noundef @.str.1) #4, !dbg !262 - unreachable, !dbg !262 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 67, ptr noundef @.str.1) #4, !dbg !263 + unreachable, !dbg !263 103: ; No predecessors! - br label %105, !dbg !262 + br label %105, !dbg !263 104: ; preds = %93 - br label %105, !dbg !262 + br label %105, !dbg !263 105: ; preds = %104, %103 - %106 = call i32 @pthread_mutexattr_getprioceiling(ptr noundef %13, ptr noundef %12), !dbg !263 - store i32 %106, ptr %11, align 4, !dbg !264 - %107 = load i32, ptr %11, align 4, !dbg !265 - %108 = icmp eq i32 %107, 0, !dbg !265 - %109 = xor i1 %108, true, !dbg !265 - %110 = zext i1 %109 to i32, !dbg !265 - %111 = sext i32 %110 to i64, !dbg !265 - %112 = icmp ne i64 %111, 0, !dbg !265 - br i1 %112, label %113, label %115, !dbg !265 + %106 = call i32 @pthread_mutexattr_getprioceiling(ptr noundef %13, ptr noundef %12), !dbg !264 + store i32 %106, ptr %11, align 4, !dbg !265 + %107 = load i32, ptr %11, align 4, !dbg !266 + %108 = icmp eq i32 %107, 0, !dbg !266 + %109 = xor i1 %108, true, !dbg !266 + %110 = zext i1 %109 to i32, !dbg !266 + %111 = sext i32 %110 to i64, !dbg !266 + %112 = icmp ne i64 %111, 0, !dbg !266 + br i1 %112, label %113, label %115, !dbg !266 113: ; preds = %105 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 70, ptr noundef @.str.1) #4, !dbg !265 - unreachable, !dbg !265 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 69, ptr noundef @.str.1) #4, !dbg !266 + unreachable, !dbg !266 114: ; No predecessors! - br label %116, !dbg !265 + br label %116, !dbg !266 115: ; preds = %105 - br label %116, !dbg !265 + br label %116, !dbg !266 116: ; preds = %115, %114 - %117 = load ptr, ptr %6, align 8, !dbg !266 - %118 = call i32 @pthread_mutex_init(ptr noundef %117, ptr noundef %13), !dbg !267 - store i32 %118, ptr %11, align 4, !dbg !268 - %119 = load i32, ptr %11, align 4, !dbg !269 - %120 = icmp eq i32 %119, 0, !dbg !269 - %121 = xor i1 %120, true, !dbg !269 - %122 = zext i1 %121 to i32, !dbg !269 - %123 = sext i32 %122 to i64, !dbg !269 - %124 = icmp ne i64 %123, 0, !dbg !269 - br i1 %124, label %125, label %127, !dbg !269 + %117 = load ptr, ptr %6, align 8, !dbg !267 + %118 = call i32 @pthread_mutex_init(ptr noundef %117, ptr noundef %13), !dbg !268 + store i32 %118, ptr %11, align 4, !dbg !269 + %119 = load i32, ptr %11, align 4, !dbg !270 + %120 = icmp eq i32 %119, 0, !dbg !270 + %121 = xor i1 %120, true, !dbg !270 + %122 = zext i1 %121 to i32, !dbg !270 + %123 = sext i32 %122 to i64, !dbg !270 + %124 = icmp ne i64 %123, 0, !dbg !270 + br i1 %124, label %125, label %127, !dbg !270 125: ; preds = %116 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 73, ptr noundef @.str.1) #4, !dbg !269 - unreachable, !dbg !269 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 72, ptr noundef @.str.1) #4, !dbg !270 + unreachable, !dbg !270 126: ; No predecessors! - br label %128, !dbg !269 + br label %128, !dbg !270 127: ; preds = %116 - br label %128, !dbg !269 + br label %128, !dbg !270 128: ; preds = %127, %126 - %129 = call i32 @pthread_mutexattr_destroy(ptr noundef %13), !dbg !270 - store i32 %129, ptr %11, align 4, !dbg !271 - %130 = load i32, ptr %11, align 4, !dbg !272 - %131 = icmp eq i32 %130, 0, !dbg !272 - %132 = xor i1 %131, true, !dbg !272 - %133 = zext i1 %132 to i32, !dbg !272 - %134 = sext i32 %133 to i64, !dbg !272 - %135 = icmp ne i64 %134, 0, !dbg !272 - br i1 %135, label %136, label %138, !dbg !272 + %129 = call i32 @"\01_pthread_mutexattr_destroy"(ptr noundef %13), !dbg !271 + store i32 %129, ptr %11, align 4, !dbg !272 + %130 = load i32, ptr %11, align 4, !dbg !273 + %131 = icmp eq i32 %130, 0, !dbg !273 + %132 = xor i1 %131, true, !dbg !273 + %133 = zext i1 %132 to i32, !dbg !273 + %134 = sext i32 %133 to i64, !dbg !273 + %135 = icmp ne i64 %134, 0, !dbg !273 + br i1 %135, label %136, label %138, !dbg !273 136: ; preds = %128 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 75, ptr noundef @.str.1) #4, !dbg !272 - unreachable, !dbg !272 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 74, ptr noundef @.str.1) #4, !dbg !273 + unreachable, !dbg !273 137: ; No predecessors! - br label %139, !dbg !272 + br label %139, !dbg !273 138: ; preds = %128 - br label %139, !dbg !272 + br label %139, !dbg !273 139: ; preds = %138, %137 - ret void, !dbg !273 + ret void, !dbg !274 } declare i32 @pthread_mutexattr_init(ptr noundef) #2 @@ -419,496 +419,512 @@ declare i32 @pthread_mutexattr_getprioceiling(ptr noundef, ptr noundef) #2 declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) #2 -declare i32 @pthread_mutexattr_destroy(ptr noundef) #2 +declare i32 @"\01_pthread_mutexattr_destroy"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_destroy(ptr noundef %0) #0 !dbg !274 { +define void @mutex_destroy(ptr noundef %0) #0 !dbg !275 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !277, metadata !DIExpression()), !dbg !278 - call void @llvm.dbg.declare(metadata ptr %3, metadata !279, metadata !DIExpression()), !dbg !280 - %4 = load ptr, ptr %2, align 8, !dbg !281 - %5 = call i32 @pthread_mutex_destroy(ptr noundef %4), !dbg !282 - store i32 %5, ptr %3, align 4, !dbg !280 - %6 = load i32, ptr %3, align 4, !dbg !283 - %7 = icmp eq i32 %6, 0, !dbg !283 - %8 = xor i1 %7, true, !dbg !283 - %9 = zext i1 %8 to i32, !dbg !283 - %10 = sext i32 %9 to i64, !dbg !283 - %11 = icmp ne i64 %10, 0, !dbg !283 - br i1 %11, label %12, label %14, !dbg !283 + call void @llvm.dbg.declare(metadata ptr %2, metadata !278, metadata !DIExpression()), !dbg !279 + call void @llvm.dbg.declare(metadata ptr %3, metadata !280, metadata !DIExpression()), !dbg !281 + %4 = load ptr, ptr %2, align 8, !dbg !282 + %5 = call i32 @pthread_mutex_destroy(ptr noundef %4), !dbg !283 + store i32 %5, ptr %3, align 4, !dbg !281 + %6 = load i32, ptr %3, align 4, !dbg !284 + %7 = icmp eq i32 %6, 0, !dbg !284 + %8 = xor i1 %7, true, !dbg !284 + %9 = zext i1 %8 to i32, !dbg !284 + %10 = sext i32 %9 to i64, !dbg !284 + %11 = icmp ne i64 %10, 0, !dbg !284 + br i1 %11, label %12, label %14, !dbg !284 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.mutex_destroy, ptr noundef @.str, i32 noundef 81, ptr noundef @.str.1) #4, !dbg !283 - unreachable, !dbg !283 + call void @__assert_rtn(ptr noundef @__func__.mutex_destroy, ptr noundef @.str, i32 noundef 80, ptr noundef @.str.1) #4, !dbg !284 + unreachable, !dbg !284 13: ; No predecessors! - br label %15, !dbg !283 + br label %15, !dbg !284 14: ; preds = %1 - br label %15, !dbg !283 + br label %15, !dbg !284 15: ; preds = %14, %13 - ret void, !dbg !284 + ret void, !dbg !285 } declare i32 @pthread_mutex_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_lock(ptr noundef %0) #0 !dbg !285 { +define void @mutex_lock(ptr noundef %0) #0 !dbg !286 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !286, metadata !DIExpression()), !dbg !287 - call void @llvm.dbg.declare(metadata ptr %3, metadata !288, metadata !DIExpression()), !dbg !289 - %4 = load ptr, ptr %2, align 8, !dbg !290 - %5 = call i32 @pthread_mutex_lock(ptr noundef %4), !dbg !291 - store i32 %5, ptr %3, align 4, !dbg !289 - %6 = load i32, ptr %3, align 4, !dbg !292 - %7 = icmp eq i32 %6, 0, !dbg !292 - %8 = xor i1 %7, true, !dbg !292 - %9 = zext i1 %8 to i32, !dbg !292 - %10 = sext i32 %9 to i64, !dbg !292 - %11 = icmp ne i64 %10, 0, !dbg !292 - br i1 %11, label %12, label %14, !dbg !292 + call void @llvm.dbg.declare(metadata ptr %2, metadata !287, metadata !DIExpression()), !dbg !288 + call void @llvm.dbg.declare(metadata ptr %3, metadata !289, metadata !DIExpression()), !dbg !290 + %4 = load ptr, ptr %2, align 8, !dbg !291 + %5 = call i32 @pthread_mutex_lock(ptr noundef %4), !dbg !292 + store i32 %5, ptr %3, align 4, !dbg !290 + %6 = load i32, ptr %3, align 4, !dbg !293 + %7 = icmp eq i32 %6, 0, !dbg !293 + %8 = xor i1 %7, true, !dbg !293 + %9 = zext i1 %8 to i32, !dbg !293 + %10 = sext i32 %9 to i64, !dbg !293 + %11 = icmp ne i64 %10, 0, !dbg !293 + br i1 %11, label %12, label %14, !dbg !293 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.mutex_lock, ptr noundef @.str, i32 noundef 87, ptr noundef @.str.1) #4, !dbg !292 - unreachable, !dbg !292 + call void @__assert_rtn(ptr noundef @__func__.mutex_lock, ptr noundef @.str, i32 noundef 86, ptr noundef @.str.1) #4, !dbg !293 + unreachable, !dbg !293 13: ; No predecessors! - br label %15, !dbg !292 + br label %15, !dbg !293 14: ; preds = %1 - br label %15, !dbg !292 + br label %15, !dbg !293 15: ; preds = %14, %13 - ret void, !dbg !293 + ret void, !dbg !294 } declare i32 @pthread_mutex_lock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define zeroext i1 @mutex_trylock(ptr noundef %0) #0 !dbg !294 { +define zeroext i1 @mutex_trylock(ptr noundef %0) #0 !dbg !295 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !298, metadata !DIExpression()), !dbg !299 - call void @llvm.dbg.declare(metadata ptr %3, metadata !300, metadata !DIExpression()), !dbg !301 - %4 = load ptr, ptr %2, align 8, !dbg !302 - %5 = call i32 @pthread_mutex_trylock(ptr noundef %4), !dbg !303 - store i32 %5, ptr %3, align 4, !dbg !301 - %6 = load i32, ptr %3, align 4, !dbg !304 - %7 = icmp eq i32 %6, 0, !dbg !305 - ret i1 %7, !dbg !306 + call void @llvm.dbg.declare(metadata ptr %2, metadata !299, metadata !DIExpression()), !dbg !300 + call void @llvm.dbg.declare(metadata ptr %3, metadata !301, metadata !DIExpression()), !dbg !302 + %4 = load ptr, ptr %2, align 8, !dbg !303 + %5 = call i32 @pthread_mutex_trylock(ptr noundef %4), !dbg !304 + store i32 %5, ptr %3, align 4, !dbg !302 + %6 = load i32, ptr %3, align 4, !dbg !305 + %7 = icmp eq i32 %6, 0, !dbg !306 + ret i1 %7, !dbg !307 } declare i32 @pthread_mutex_trylock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_unlock(ptr noundef %0) #0 !dbg !307 { +define void @mutex_unlock(ptr noundef %0) #0 !dbg !308 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !308, metadata !DIExpression()), !dbg !309 - call void @llvm.dbg.declare(metadata ptr %3, metadata !310, metadata !DIExpression()), !dbg !311 - %4 = load ptr, ptr %2, align 8, !dbg !312 - %5 = call i32 @pthread_mutex_unlock(ptr noundef %4), !dbg !313 - store i32 %5, ptr %3, align 4, !dbg !311 - %6 = load i32, ptr %3, align 4, !dbg !314 - %7 = icmp eq i32 %6, 0, !dbg !314 - %8 = xor i1 %7, true, !dbg !314 - %9 = zext i1 %8 to i32, !dbg !314 - %10 = sext i32 %9 to i64, !dbg !314 - %11 = icmp ne i64 %10, 0, !dbg !314 - br i1 %11, label %12, label %14, !dbg !314 + call void @llvm.dbg.declare(metadata ptr %2, metadata !309, metadata !DIExpression()), !dbg !310 + call void @llvm.dbg.declare(metadata ptr %3, metadata !311, metadata !DIExpression()), !dbg !312 + %4 = load ptr, ptr %2, align 8, !dbg !313 + %5 = call i32 @pthread_mutex_unlock(ptr noundef %4), !dbg !314 + store i32 %5, ptr %3, align 4, !dbg !312 + %6 = load i32, ptr %3, align 4, !dbg !315 + %7 = icmp eq i32 %6, 0, !dbg !315 + %8 = xor i1 %7, true, !dbg !315 + %9 = zext i1 %8 to i32, !dbg !315 + %10 = sext i32 %9 to i64, !dbg !315 + %11 = icmp ne i64 %10, 0, !dbg !315 + br i1 %11, label %12, label %14, !dbg !315 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.mutex_unlock, ptr noundef @.str, i32 noundef 100, ptr noundef @.str.1) #4, !dbg !314 - unreachable, !dbg !314 + call void @__assert_rtn(ptr noundef @__func__.mutex_unlock, ptr noundef @.str, i32 noundef 99, ptr noundef @.str.1) #4, !dbg !315 + unreachable, !dbg !315 13: ; No predecessors! - br label %15, !dbg !314 + br label %15, !dbg !315 14: ; preds = %1 - br label %15, !dbg !314 + br label %15, !dbg !315 15: ; preds = %14, %13 - ret void, !dbg !315 + ret void, !dbg !316 } declare i32 @pthread_mutex_unlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_test() #0 !dbg !316 { +define void @mutex_test() #0 !dbg !317 { %1 = alloca %struct._opaque_pthread_mutex_t, align 8 %2 = alloca %struct._opaque_pthread_mutex_t, align 8 %3 = alloca i8, align 1 %4 = alloca i8, align 1 %5 = alloca i8, align 1 - call void @llvm.dbg.declare(metadata ptr %1, metadata !319, metadata !DIExpression()), !dbg !320 - call void @llvm.dbg.declare(metadata ptr %2, metadata !321, metadata !DIExpression()), !dbg !322 - call void @mutex_init(ptr noundef %1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1), !dbg !323 - call void @mutex_init(ptr noundef %2, i32 noundef 2, i32 noundef 2, i32 noundef 3, i32 noundef 2), !dbg !324 - call void @mutex_lock(ptr noundef %1), !dbg !325 - call void @llvm.dbg.declare(metadata ptr %3, metadata !327, metadata !DIExpression()), !dbg !328 - %6 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !329 - %7 = zext i1 %6 to i8, !dbg !328 - store i8 %7, ptr %3, align 1, !dbg !328 - %8 = load i8, ptr %3, align 1, !dbg !330 - %9 = trunc i8 %8 to i1, !dbg !330 - %10 = xor i1 %9, true, !dbg !330 - %11 = xor i1 %10, true, !dbg !330 - %12 = zext i1 %11 to i32, !dbg !330 - %13 = sext i32 %12 to i64, !dbg !330 - %14 = icmp ne i64 %13, 0, !dbg !330 - br i1 %14, label %15, label %17, !dbg !330 + call void @llvm.dbg.declare(metadata ptr %1, metadata !320, metadata !DIExpression()), !dbg !321 + call void @llvm.dbg.declare(metadata ptr %2, metadata !322, metadata !DIExpression()), !dbg !323 + call void @mutex_init(ptr noundef %1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1), !dbg !324 + call void @mutex_init(ptr noundef %2, i32 noundef 2, i32 noundef 2, i32 noundef 3, i32 noundef 2), !dbg !325 + call void @mutex_lock(ptr noundef %1), !dbg !326 + call void @llvm.dbg.declare(metadata ptr %3, metadata !328, metadata !DIExpression()), !dbg !329 + %6 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !330 + %7 = zext i1 %6 to i8, !dbg !329 + store i8 %7, ptr %3, align 1, !dbg !329 + %8 = load i8, ptr %3, align 1, !dbg !331 + %9 = trunc i8 %8 to i1, !dbg !331 + %10 = xor i1 %9, true, !dbg !331 + %11 = xor i1 %10, true, !dbg !331 + %12 = zext i1 %11 to i32, !dbg !331 + %13 = sext i32 %12 to i64, !dbg !331 + %14 = icmp ne i64 %13, 0, !dbg !331 + br i1 %14, label %15, label %17, !dbg !331 15: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 114, ptr noundef @.str.2) #4, !dbg !330 - unreachable, !dbg !330 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 113, ptr noundef @.str.2) #4, !dbg !331 + unreachable, !dbg !331 16: ; No predecessors! - br label %18, !dbg !330 + br label %18, !dbg !331 17: ; preds = %0 - br label %18, !dbg !330 + br label %18, !dbg !331 18: ; preds = %17, %16 - call void @mutex_unlock(ptr noundef %1), !dbg !331 - call void @mutex_lock(ptr noundef %2), !dbg !332 - call void @llvm.dbg.declare(metadata ptr %4, metadata !334, metadata !DIExpression()), !dbg !336 - %19 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !337 - %20 = zext i1 %19 to i8, !dbg !336 - store i8 %20, ptr %4, align 1, !dbg !336 - %21 = load i8, ptr %4, align 1, !dbg !338 - %22 = trunc i8 %21 to i1, !dbg !338 - %23 = xor i1 %22, true, !dbg !338 - %24 = zext i1 %23 to i32, !dbg !338 - %25 = sext i32 %24 to i64, !dbg !338 - %26 = icmp ne i64 %25, 0, !dbg !338 - br i1 %26, label %27, label %29, !dbg !338 + call void @mutex_unlock(ptr noundef %1), !dbg !332 + call void @mutex_lock(ptr noundef %2), !dbg !333 + call void @llvm.dbg.declare(metadata ptr %4, metadata !335, metadata !DIExpression()), !dbg !337 + %19 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !338 + %20 = zext i1 %19 to i8, !dbg !337 + store i8 %20, ptr %4, align 1, !dbg !337 + %21 = load i8, ptr %4, align 1, !dbg !339 + %22 = trunc i8 %21 to i1, !dbg !339 + %23 = xor i1 %22, true, !dbg !339 + %24 = zext i1 %23 to i32, !dbg !339 + %25 = sext i32 %24 to i64, !dbg !339 + %26 = icmp ne i64 %25, 0, !dbg !339 + br i1 %26, label %27, label %29, !dbg !339 27: ; preds = %18 - call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 123, ptr noundef @.str.3) #4, !dbg !338 - unreachable, !dbg !338 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 122, ptr noundef @.str.3) #4, !dbg !339 + unreachable, !dbg !339 28: ; No predecessors! - br label %30, !dbg !338 + br label %30, !dbg !339 29: ; preds = %18 - br label %30, !dbg !338 + br label %30, !dbg !339 30: ; preds = %29, %28 - call void @mutex_unlock(ptr noundef %1), !dbg !339 - call void @llvm.dbg.declare(metadata ptr %5, metadata !340, metadata !DIExpression()), !dbg !342 - %31 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !343 - %32 = zext i1 %31 to i8, !dbg !342 - store i8 %32, ptr %5, align 1, !dbg !342 - %33 = load i8, ptr %5, align 1, !dbg !344 - %34 = trunc i8 %33 to i1, !dbg !344 - %35 = xor i1 %34, true, !dbg !344 - %36 = zext i1 %35 to i32, !dbg !344 - %37 = sext i32 %36 to i64, !dbg !344 - %38 = icmp ne i64 %37, 0, !dbg !344 - br i1 %38, label %39, label %41, !dbg !344 + call void @mutex_unlock(ptr noundef %1), !dbg !340 + call void @llvm.dbg.declare(metadata ptr %5, metadata !341, metadata !DIExpression()), !dbg !343 + %31 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !344 + %32 = zext i1 %31 to i8, !dbg !343 + store i8 %32, ptr %5, align 1, !dbg !343 + %33 = load i8, ptr %5, align 1, !dbg !345 + %34 = trunc i8 %33 to i1, !dbg !345 + %35 = xor i1 %34, true, !dbg !345 + %36 = zext i1 %35 to i32, !dbg !345 + %37 = sext i32 %36 to i64, !dbg !345 + %38 = icmp ne i64 %37, 0, !dbg !345 + br i1 %38, label %39, label %41, !dbg !345 39: ; preds = %30 - call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 129, ptr noundef @.str.3) #4, !dbg !344 - unreachable, !dbg !344 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 128, ptr noundef @.str.3) #4, !dbg !345 + unreachable, !dbg !345 40: ; No predecessors! - br label %42, !dbg !344 + br label %42, !dbg !345 41: ; preds = %30 - br label %42, !dbg !344 + br label %42, !dbg !345 42: ; preds = %41, %40 - call void @mutex_unlock(ptr noundef %1), !dbg !345 - call void @mutex_unlock(ptr noundef %2), !dbg !346 - call void @mutex_destroy(ptr noundef %2), !dbg !347 - call void @mutex_destroy(ptr noundef %1), !dbg !348 - ret void, !dbg !349 + call void @mutex_unlock(ptr noundef %1), !dbg !346 + call void @mutex_unlock(ptr noundef %2), !dbg !347 + call void @mutex_destroy(ptr noundef %2), !dbg !348 + call void @mutex_destroy(ptr noundef %1), !dbg !349 + ret void, !dbg !350 } ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_init(ptr noundef %0) #0 !dbg !350 { +define void @cond_init(ptr noundef %0) #0 !dbg !351 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 %4 = alloca %struct._opaque_pthread_condattr_t, align 8 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !354, metadata !DIExpression()), !dbg !355 - call void @llvm.dbg.declare(metadata ptr %3, metadata !356, metadata !DIExpression()), !dbg !357 - call void @llvm.dbg.declare(metadata ptr %4, metadata !358, metadata !DIExpression()), !dbg !366 - %5 = call i32 @pthread_condattr_init(ptr noundef %4), !dbg !367 - store i32 %5, ptr %3, align 4, !dbg !368 - %6 = load i32, ptr %3, align 4, !dbg !369 - %7 = icmp eq i32 %6, 0, !dbg !369 - %8 = xor i1 %7, true, !dbg !369 - %9 = zext i1 %8 to i32, !dbg !369 - %10 = sext i32 %9 to i64, !dbg !369 - %11 = icmp ne i64 %10, 0, !dbg !369 - br i1 %11, label %12, label %14, !dbg !369 + call void @llvm.dbg.declare(metadata ptr %2, metadata !355, metadata !DIExpression()), !dbg !356 + call void @llvm.dbg.declare(metadata ptr %3, metadata !357, metadata !DIExpression()), !dbg !358 + call void @llvm.dbg.declare(metadata ptr %4, metadata !359, metadata !DIExpression()), !dbg !367 + %5 = call i32 @pthread_condattr_init(ptr noundef %4), !dbg !368 + store i32 %5, ptr %3, align 4, !dbg !369 + %6 = load i32, ptr %3, align 4, !dbg !370 + %7 = icmp eq i32 %6, 0, !dbg !370 + %8 = xor i1 %7, true, !dbg !370 + %9 = zext i1 %8 to i32, !dbg !370 + %10 = sext i32 %9 to i64, !dbg !370 + %11 = icmp ne i64 %10, 0, !dbg !370 + br i1 %11, label %12, label %14, !dbg !370 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 155, ptr noundef @.str.1) #4, !dbg !369 - unreachable, !dbg !369 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 154, ptr noundef @.str.1) #4, !dbg !370 + unreachable, !dbg !370 13: ; No predecessors! - br label %15, !dbg !369 + br label %15, !dbg !370 14: ; preds = %1 - br label %15, !dbg !369 + br label %15, !dbg !370 15: ; preds = %14, %13 - %16 = load ptr, ptr %2, align 8, !dbg !370 - %17 = call i32 @pthread_cond_init(ptr noundef %16, ptr noundef %4), !dbg !371 - store i32 %17, ptr %3, align 4, !dbg !372 - %18 = load i32, ptr %3, align 4, !dbg !373 - %19 = icmp eq i32 %18, 0, !dbg !373 - %20 = xor i1 %19, true, !dbg !373 - %21 = zext i1 %20 to i32, !dbg !373 - %22 = sext i32 %21 to i64, !dbg !373 - %23 = icmp ne i64 %22, 0, !dbg !373 - br i1 %23, label %24, label %26, !dbg !373 + %16 = load ptr, ptr %2, align 8, !dbg !371 + %17 = call i32 @"\01_pthread_cond_init"(ptr noundef %16, ptr noundef %4), !dbg !372 + store i32 %17, ptr %3, align 4, !dbg !373 + %18 = load i32, ptr %3, align 4, !dbg !374 + %19 = icmp eq i32 %18, 0, !dbg !374 + %20 = xor i1 %19, true, !dbg !374 + %21 = zext i1 %20 to i32, !dbg !374 + %22 = sext i32 %21 to i64, !dbg !374 + %23 = icmp ne i64 %22, 0, !dbg !374 + br i1 %23, label %24, label %26, !dbg !374 24: ; preds = %15 - call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 158, ptr noundef @.str.1) #4, !dbg !373 - unreachable, !dbg !373 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 157, ptr noundef @.str.1) #4, !dbg !374 + unreachable, !dbg !374 25: ; No predecessors! - br label %27, !dbg !373 + br label %27, !dbg !374 26: ; preds = %15 - br label %27, !dbg !373 + br label %27, !dbg !374 27: ; preds = %26, %25 - %28 = call i32 @pthread_condattr_destroy(ptr noundef %4), !dbg !374 - store i32 %28, ptr %3, align 4, !dbg !375 - %29 = load i32, ptr %3, align 4, !dbg !376 - %30 = icmp eq i32 %29, 0, !dbg !376 - %31 = xor i1 %30, true, !dbg !376 - %32 = zext i1 %31 to i32, !dbg !376 - %33 = sext i32 %32 to i64, !dbg !376 - %34 = icmp ne i64 %33, 0, !dbg !376 - br i1 %34, label %35, label %37, !dbg !376 + %28 = call i32 @pthread_condattr_destroy(ptr noundef %4), !dbg !375 + store i32 %28, ptr %3, align 4, !dbg !376 + %29 = load i32, ptr %3, align 4, !dbg !377 + %30 = icmp eq i32 %29, 0, !dbg !377 + %31 = xor i1 %30, true, !dbg !377 + %32 = zext i1 %31 to i32, !dbg !377 + %33 = sext i32 %32 to i64, !dbg !377 + %34 = icmp ne i64 %33, 0, !dbg !377 + br i1 %34, label %35, label %37, !dbg !377 35: ; preds = %27 - call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 161, ptr noundef @.str.1) #4, !dbg !376 - unreachable, !dbg !376 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 160, ptr noundef @.str.1) #4, !dbg !377 + unreachable, !dbg !377 36: ; No predecessors! - br label %38, !dbg !376 + br label %38, !dbg !377 37: ; preds = %27 - br label %38, !dbg !376 + br label %38, !dbg !377 38: ; preds = %37, %36 - ret void, !dbg !377 + ret void, !dbg !378 } declare i32 @pthread_condattr_init(ptr noundef) #2 -declare i32 @pthread_cond_init(ptr noundef, ptr noundef) #2 +declare i32 @"\01_pthread_cond_init"(ptr noundef, ptr noundef) #2 declare i32 @pthread_condattr_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_destroy(ptr noundef %0) #0 !dbg !378 { +define void @cond_destroy(ptr noundef %0) #0 !dbg !379 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !379, metadata !DIExpression()), !dbg !380 - call void @llvm.dbg.declare(metadata ptr %3, metadata !381, metadata !DIExpression()), !dbg !382 - %4 = load ptr, ptr %2, align 8, !dbg !383 - %5 = call i32 @pthread_cond_destroy(ptr noundef %4), !dbg !384 - store i32 %5, ptr %3, align 4, !dbg !382 - %6 = load i32, ptr %3, align 4, !dbg !385 - %7 = icmp eq i32 %6, 0, !dbg !385 - %8 = xor i1 %7, true, !dbg !385 - %9 = zext i1 %8 to i32, !dbg !385 - %10 = sext i32 %9 to i64, !dbg !385 - %11 = icmp ne i64 %10, 0, !dbg !385 - br i1 %11, label %12, label %14, !dbg !385 + call void @llvm.dbg.declare(metadata ptr %2, metadata !380, metadata !DIExpression()), !dbg !381 + call void @llvm.dbg.declare(metadata ptr %3, metadata !382, metadata !DIExpression()), !dbg !383 + %4 = load ptr, ptr %2, align 8, !dbg !384 + %5 = call i32 @pthread_cond_destroy(ptr noundef %4), !dbg !385 + store i32 %5, ptr %3, align 4, !dbg !383 + %6 = load i32, ptr %3, align 4, !dbg !386 + %7 = icmp eq i32 %6, 0, !dbg !386 + %8 = xor i1 %7, true, !dbg !386 + %9 = zext i1 %8 to i32, !dbg !386 + %10 = sext i32 %9 to i64, !dbg !386 + %11 = icmp ne i64 %10, 0, !dbg !386 + br i1 %11, label %12, label %14, !dbg !386 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_destroy, ptr noundef @.str, i32 noundef 167, ptr noundef @.str.1) #4, !dbg !385 - unreachable, !dbg !385 + call void @__assert_rtn(ptr noundef @__func__.cond_destroy, ptr noundef @.str, i32 noundef 166, ptr noundef @.str.1) #4, !dbg !386 + unreachable, !dbg !386 13: ; No predecessors! - br label %15, !dbg !385 + br label %15, !dbg !386 14: ; preds = %1 - br label %15, !dbg !385 + br label %15, !dbg !386 15: ; preds = %14, %13 - ret void, !dbg !386 + ret void, !dbg !387 } declare i32 @pthread_cond_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_signal(ptr noundef %0) #0 !dbg !387 { +define void @cond_signal(ptr noundef %0) #0 !dbg !388 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !388, metadata !DIExpression()), !dbg !389 - call void @llvm.dbg.declare(metadata ptr %3, metadata !390, metadata !DIExpression()), !dbg !391 - %4 = load ptr, ptr %2, align 8, !dbg !392 - %5 = call i32 @pthread_cond_signal(ptr noundef %4), !dbg !393 - store i32 %5, ptr %3, align 4, !dbg !391 - %6 = load i32, ptr %3, align 4, !dbg !394 - %7 = icmp eq i32 %6, 0, !dbg !394 - %8 = xor i1 %7, true, !dbg !394 - %9 = zext i1 %8 to i32, !dbg !394 - %10 = sext i32 %9 to i64, !dbg !394 - %11 = icmp ne i64 %10, 0, !dbg !394 - br i1 %11, label %12, label %14, !dbg !394 + call void @llvm.dbg.declare(metadata ptr %2, metadata !389, metadata !DIExpression()), !dbg !390 + call void @llvm.dbg.declare(metadata ptr %3, metadata !391, metadata !DIExpression()), !dbg !392 + %4 = load ptr, ptr %2, align 8, !dbg !393 + %5 = call i32 @pthread_cond_signal(ptr noundef %4), !dbg !394 + store i32 %5, ptr %3, align 4, !dbg !392 + %6 = load i32, ptr %3, align 4, !dbg !395 + %7 = icmp eq i32 %6, 0, !dbg !395 + %8 = xor i1 %7, true, !dbg !395 + %9 = zext i1 %8 to i32, !dbg !395 + %10 = sext i32 %9 to i64, !dbg !395 + %11 = icmp ne i64 %10, 0, !dbg !395 + br i1 %11, label %12, label %14, !dbg !395 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_signal, ptr noundef @.str, i32 noundef 173, ptr noundef @.str.1) #4, !dbg !394 - unreachable, !dbg !394 + call void @__assert_rtn(ptr noundef @__func__.cond_signal, ptr noundef @.str, i32 noundef 172, ptr noundef @.str.1) #4, !dbg !395 + unreachable, !dbg !395 13: ; No predecessors! - br label %15, !dbg !394 + br label %15, !dbg !395 14: ; preds = %1 - br label %15, !dbg !394 + br label %15, !dbg !395 15: ; preds = %14, %13 - ret void, !dbg !395 + ret void, !dbg !396 } declare i32 @pthread_cond_signal(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_broadcast(ptr noundef %0) #0 !dbg !396 { +define void @cond_broadcast(ptr noundef %0) #0 !dbg !397 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !397, metadata !DIExpression()), !dbg !398 - call void @llvm.dbg.declare(metadata ptr %3, metadata !399, metadata !DIExpression()), !dbg !400 - %4 = load ptr, ptr %2, align 8, !dbg !401 - %5 = call i32 @pthread_cond_broadcast(ptr noundef %4), !dbg !402 - store i32 %5, ptr %3, align 4, !dbg !400 - %6 = load i32, ptr %3, align 4, !dbg !403 - %7 = icmp eq i32 %6, 0, !dbg !403 - %8 = xor i1 %7, true, !dbg !403 - %9 = zext i1 %8 to i32, !dbg !403 - %10 = sext i32 %9 to i64, !dbg !403 - %11 = icmp ne i64 %10, 0, !dbg !403 - br i1 %11, label %12, label %14, !dbg !403 + call void @llvm.dbg.declare(metadata ptr %2, metadata !398, metadata !DIExpression()), !dbg !399 + call void @llvm.dbg.declare(metadata ptr %3, metadata !400, metadata !DIExpression()), !dbg !401 + %4 = load ptr, ptr %2, align 8, !dbg !402 + %5 = call i32 @pthread_cond_broadcast(ptr noundef %4), !dbg !403 + store i32 %5, ptr %3, align 4, !dbg !401 + %6 = load i32, ptr %3, align 4, !dbg !404 + %7 = icmp eq i32 %6, 0, !dbg !404 + %8 = xor i1 %7, true, !dbg !404 + %9 = zext i1 %8 to i32, !dbg !404 + %10 = sext i32 %9 to i64, !dbg !404 + %11 = icmp ne i64 %10, 0, !dbg !404 + br i1 %11, label %12, label %14, !dbg !404 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_broadcast, ptr noundef @.str, i32 noundef 179, ptr noundef @.str.1) #4, !dbg !403 - unreachable, !dbg !403 + call void @__assert_rtn(ptr noundef @__func__.cond_broadcast, ptr noundef @.str, i32 noundef 178, ptr noundef @.str.1) #4, !dbg !404 + unreachable, !dbg !404 13: ; No predecessors! - br label %15, !dbg !403 + br label %15, !dbg !404 14: ; preds = %1 - br label %15, !dbg !403 + br label %15, !dbg !404 15: ; preds = %14, %13 - ret void, !dbg !404 + ret void, !dbg !405 } declare i32 @pthread_cond_broadcast(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_wait(ptr noundef %0, ptr noundef %1) #0 !dbg !405 { +define void @cond_wait(ptr noundef %0, ptr noundef %1) #0 !dbg !406 { %3 = alloca ptr, align 8 %4 = alloca ptr, align 8 %5 = alloca i32, align 4 store ptr %0, ptr %3, align 8 - call void @llvm.dbg.declare(metadata ptr %3, metadata !408, metadata !DIExpression()), !dbg !409 + call void @llvm.dbg.declare(metadata ptr %3, metadata !409, metadata !DIExpression()), !dbg !410 store ptr %1, ptr %4, align 8 - call void @llvm.dbg.declare(metadata ptr %4, metadata !410, metadata !DIExpression()), !dbg !411 - call void @llvm.dbg.declare(metadata ptr %5, metadata !412, metadata !DIExpression()), !dbg !413 - %6 = load ptr, ptr %3, align 8, !dbg !414 - %7 = load ptr, ptr %4, align 8, !dbg !415 - %8 = call i32 @pthread_cond_wait(ptr noundef %6, ptr noundef %7), !dbg !416 - store i32 %8, ptr %5, align 4, !dbg !413 - ret void, !dbg !417 + call void @llvm.dbg.declare(metadata ptr %4, metadata !411, metadata !DIExpression()), !dbg !412 + call void @llvm.dbg.declare(metadata ptr %5, metadata !413, metadata !DIExpression()), !dbg !414 + %6 = load ptr, ptr %3, align 8, !dbg !415 + %7 = load ptr, ptr %4, align 8, !dbg !416 + %8 = call i32 @"\01_pthread_cond_wait"(ptr noundef %6, ptr noundef %7), !dbg !417 + store i32 %8, ptr %5, align 4, !dbg !414 + ret void, !dbg !418 } -declare i32 @pthread_cond_wait(ptr noundef, ptr noundef) #2 +declare i32 @"\01_pthread_cond_wait"(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 !dbg !418 { +define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 !dbg !419 { %4 = alloca ptr, align 8 %5 = alloca ptr, align 8 %6 = alloca i64, align 8 %7 = alloca %struct.timespec, align 8 %8 = alloca i32, align 4 store ptr %0, ptr %4, align 8 - call void @llvm.dbg.declare(metadata ptr %4, metadata !422, metadata !DIExpression()), !dbg !423 + call void @llvm.dbg.declare(metadata ptr %4, metadata !423, metadata !DIExpression()), !dbg !424 store ptr %1, ptr %5, align 8 - call void @llvm.dbg.declare(metadata ptr %5, metadata !424, metadata !DIExpression()), !dbg !425 + call void @llvm.dbg.declare(metadata ptr %5, metadata !425, metadata !DIExpression()), !dbg !426 store i64 %2, ptr %6, align 8 - call void @llvm.dbg.declare(metadata ptr %6, metadata !426, metadata !DIExpression()), !dbg !427 - call void @llvm.dbg.declare(metadata ptr %7, metadata !428, metadata !DIExpression()), !dbg !436 - %9 = load i64, ptr %6, align 8, !dbg !437 - call void @llvm.dbg.declare(metadata ptr %8, metadata !438, metadata !DIExpression()), !dbg !439 - %10 = load ptr, ptr %4, align 8, !dbg !440 - %11 = load ptr, ptr %5, align 8, !dbg !441 - %12 = call i32 @pthread_cond_timedwait(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !442 - store i32 %12, ptr %8, align 4, !dbg !439 - ret void, !dbg !443 + call void @llvm.dbg.declare(metadata ptr %6, metadata !427, metadata !DIExpression()), !dbg !428 + call void @llvm.dbg.declare(metadata ptr %7, metadata !429, metadata !DIExpression()), !dbg !437 + %9 = load i64, ptr %6, align 8, !dbg !438 + call void @llvm.dbg.declare(metadata ptr %8, metadata !439, metadata !DIExpression()), !dbg !440 + %10 = load ptr, ptr %4, align 8, !dbg !441 + %11 = load ptr, ptr %5, align 8, !dbg !442 + %12 = call i32 @"\01_pthread_cond_timedwait"(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !443 + store i32 %12, ptr %8, align 4, !dbg !440 + ret void, !dbg !444 } -declare i32 @pthread_cond_timedwait(ptr noundef, ptr noundef, ptr noundef) #2 +declare i32 @"\01_pthread_cond_timedwait"(ptr noundef, ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @cond_worker(ptr noundef %0) #0 !dbg !444 { +define ptr @cond_worker(ptr noundef %0) #0 !dbg !445 { %2 = alloca ptr, align 8 - %3 = alloca i8, align 1 + %3 = alloca ptr, align 8 %4 = alloca i8, align 1 - store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !445, metadata !DIExpression()), !dbg !446 - call void @llvm.dbg.declare(metadata ptr %3, metadata !447, metadata !DIExpression()), !dbg !449 - store i8 1, ptr %3, align 1, !dbg !449 - br label %5, !dbg !450 - -5: ; preds = %8, %1 - %6 = load i8, ptr %3, align 1, !dbg !451 - %7 = trunc i8 %6 to i1, !dbg !451 - br i1 %7, label %8, label %12, !dbg !453 - -8: ; preds = %5 - call void @mutex_lock(ptr noundef @cond_mutex), !dbg !454 - call void @cond_wait(ptr noundef @cond, ptr noundef @cond_mutex), !dbg !456 - %9 = load i32, ptr @phase, align 4, !dbg !457 - %10 = icmp slt i32 %9, 1, !dbg !458 - %11 = zext i1 %10 to i8, !dbg !459 - store i8 %11, ptr %3, align 1, !dbg !459 - call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !460 - br label %5, !dbg !461, !llvm.loop !462 - -12: ; preds = %5 - call void @llvm.dbg.declare(metadata ptr %4, metadata !465, metadata !DIExpression()), !dbg !467 - store i8 1, ptr %4, align 1, !dbg !467 - br label %13, !dbg !468 - -13: ; preds = %16, %12 - %14 = load i8, ptr %4, align 1, !dbg !469 - %15 = trunc i8 %14 to i1, !dbg !469 - br i1 %15, label %16, label %20, !dbg !471 - -16: ; preds = %13 - call void @mutex_lock(ptr noundef @cond_mutex), !dbg !472 - call void @cond_timedwait(ptr noundef @cond, ptr noundef @cond_mutex, i64 noundef 10), !dbg !474 - %17 = load i32, ptr @phase, align 4, !dbg !475 - %18 = icmp slt i32 %17, 2, !dbg !476 - %19 = zext i1 %18 to i8, !dbg !477 - store i8 %19, ptr %4, align 1, !dbg !477 - call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !478 - br label %13, !dbg !479, !llvm.loop !480 - -20: ; preds = %13 - %21 = load ptr, ptr %2, align 8, !dbg !482 - ret ptr %21, !dbg !483 + store ptr %0, ptr %3, align 8 + call void @llvm.dbg.declare(metadata ptr %3, metadata !446, metadata !DIExpression()), !dbg !447 + call void @llvm.dbg.declare(metadata ptr %4, metadata !448, metadata !DIExpression()), !dbg !449 + store i8 1, ptr %4, align 1, !dbg !449 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !450 + %5 = load i32, ptr @phase, align 4, !dbg !452 + %6 = add nsw i32 %5, 1, !dbg !452 + store i32 %6, ptr @phase, align 4, !dbg !452 + call void @cond_wait(ptr noundef @cond, ptr noundef @cond_mutex), !dbg !453 + %7 = load i32, ptr @phase, align 4, !dbg !454 + %8 = add nsw i32 %7, 1, !dbg !454 + store i32 %8, ptr @phase, align 4, !dbg !454 + %9 = load i32, ptr @phase, align 4, !dbg !455 + %10 = icmp slt i32 %9, 2, !dbg !456 + %11 = zext i1 %10 to i8, !dbg !457 + store i8 %11, ptr %4, align 1, !dbg !457 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !458 + %12 = load i8, ptr %4, align 1, !dbg !459 + %13 = trunc i8 %12 to i1, !dbg !459 + br i1 %13, label %14, label %17, !dbg !461 + +14: ; preds = %1 + %15 = load ptr, ptr %3, align 8, !dbg !462 + %16 = getelementptr inbounds i8, ptr %15, i64 1, !dbg !463 + store ptr %16, ptr %2, align 8, !dbg !464 + br label %32, !dbg !464 + +17: ; preds = %1 + store i8 1, ptr %4, align 1, !dbg !465 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !466 + %18 = load i32, ptr @phase, align 4, !dbg !468 + %19 = add nsw i32 %18, 1, !dbg !468 + store i32 %19, ptr @phase, align 4, !dbg !468 + call void @cond_timedwait(ptr noundef @cond, ptr noundef @cond_mutex, i64 noundef 10), !dbg !469 + %20 = load i32, ptr @phase, align 4, !dbg !470 + %21 = add nsw i32 %20, 1, !dbg !470 + store i32 %21, ptr @phase, align 4, !dbg !470 + %22 = load i32, ptr @phase, align 4, !dbg !471 + %23 = icmp sgt i32 %22, 6, !dbg !472 + %24 = zext i1 %23 to i8, !dbg !473 + store i8 %24, ptr %4, align 1, !dbg !473 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !474 + %25 = load i8, ptr %4, align 1, !dbg !475 + %26 = trunc i8 %25 to i1, !dbg !475 + br i1 %26, label %27, label %30, !dbg !477 + +27: ; preds = %17 + %28 = load ptr, ptr %3, align 8, !dbg !478 + %29 = getelementptr inbounds i8, ptr %28, i64 2, !dbg !479 + store ptr %29, ptr %2, align 8, !dbg !480 + br label %32, !dbg !480 + +30: ; preds = %17 + %31 = load ptr, ptr %3, align 8, !dbg !481 + store ptr %31, ptr %2, align 8, !dbg !482 + br label %32, !dbg !482 + +32: ; preds = %30, %27, %14 + %33 = load ptr, ptr %2, align 8, !dbg !483 + ret ptr %33, !dbg !483 } ; Function Attrs: noinline nounwind ssp uwtable @@ -950,7 +966,7 @@ define void @cond_test() #0 !dbg !484 { br i1 %18, label %19, label %21, !dbg !507 19: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.cond_test, ptr noundef @.str, i32 noundef 245, ptr noundef @.str.4) #4, !dbg !507 + call void @__assert_rtn(ptr noundef @__func__.cond_test, ptr noundef @.str, i32 noundef 252, ptr noundef @.str.4) #4, !dbg !507 unreachable, !dbg !507 20: ; No predecessors! @@ -990,7 +1006,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { br i1 %14, label %15, label %17, !dbg !547 15: ; preds = %2 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 262, ptr noundef @.str.1) #4, !dbg !547 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 269, ptr noundef @.str.1) #4, !dbg !547 unreachable, !dbg !547 16: ; No predecessors! @@ -1012,7 +1028,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { br i1 %26, label %27, label %29, !dbg !551 27: ; preds = %18 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 265, ptr noundef @.str.1) #4, !dbg !551 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 272, ptr noundef @.str.1) #4, !dbg !551 unreachable, !dbg !551 28: ; No predecessors! @@ -1033,7 +1049,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { br i1 %37, label %38, label %40, !dbg !554 38: ; preds = %30 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 267, ptr noundef @.str.1) #4, !dbg !554 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 274, ptr noundef @.str.1) #4, !dbg !554 unreachable, !dbg !554 39: ; No predecessors! @@ -1044,7 +1060,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { 41: ; preds = %40, %39 %42 = load ptr, ptr %3, align 8, !dbg !555 - %43 = call i32 @pthread_rwlock_init(ptr noundef %42, ptr noundef %7), !dbg !556 + %43 = call i32 @"\01_pthread_rwlock_init"(ptr noundef %42, ptr noundef %7), !dbg !556 store i32 %43, ptr %5, align 4, !dbg !557 %44 = load i32, ptr %5, align 4, !dbg !558 %45 = icmp eq i32 %44, 0, !dbg !558 @@ -1055,7 +1071,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { br i1 %49, label %50, label %52, !dbg !558 50: ; preds = %41 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 270, ptr noundef @.str.1) #4, !dbg !558 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 277, ptr noundef @.str.1) #4, !dbg !558 unreachable, !dbg !558 51: ; No predecessors! @@ -1076,7 +1092,7 @@ define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { br i1 %60, label %61, label %63, !dbg !561 61: ; preds = %53 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 272, ptr noundef @.str.1) #4, !dbg !561 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 279, ptr noundef @.str.1) #4, !dbg !561 unreachable, !dbg !561 62: ; No predecessors! @@ -1095,7 +1111,7 @@ declare i32 @pthread_rwlockattr_setpshared(ptr noundef, i32 noundef) #2 declare i32 @pthread_rwlockattr_getpshared(ptr noundef, ptr noundef) #2 -declare i32 @pthread_rwlock_init(ptr noundef, ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_init"(ptr noundef, ptr noundef) #2 declare i32 @pthread_rwlockattr_destroy(ptr noundef) #2 @@ -1107,7 +1123,7 @@ define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { call void @llvm.dbg.declare(metadata ptr %2, metadata !566, metadata !DIExpression()), !dbg !567 call void @llvm.dbg.declare(metadata ptr %3, metadata !568, metadata !DIExpression()), !dbg !569 %4 = load ptr, ptr %2, align 8, !dbg !570 - %5 = call i32 @pthread_rwlock_destroy(ptr noundef %4), !dbg !571 + %5 = call i32 @"\01_pthread_rwlock_destroy"(ptr noundef %4), !dbg !571 store i32 %5, ptr %3, align 4, !dbg !569 %6 = load i32, ptr %3, align 4, !dbg !572 %7 = icmp eq i32 %6, 0, !dbg !572 @@ -1118,7 +1134,7 @@ define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { br i1 %11, label %12, label %14, !dbg !572 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_destroy, ptr noundef @.str, i32 noundef 278, ptr noundef @.str.1) #4, !dbg !572 + call void @__assert_rtn(ptr noundef @__func__.rwlock_destroy, ptr noundef @.str, i32 noundef 285, ptr noundef @.str.1) #4, !dbg !572 unreachable, !dbg !572 13: ; No predecessors! @@ -1131,7 +1147,7 @@ define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { ret void, !dbg !573 } -declare i32 @pthread_rwlock_destroy(ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_destroy"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { @@ -1141,7 +1157,7 @@ define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { call void @llvm.dbg.declare(metadata ptr %2, metadata !575, metadata !DIExpression()), !dbg !576 call void @llvm.dbg.declare(metadata ptr %3, metadata !577, metadata !DIExpression()), !dbg !578 %4 = load ptr, ptr %2, align 8, !dbg !579 - %5 = call i32 @pthread_rwlock_wrlock(ptr noundef %4), !dbg !580 + %5 = call i32 @"\01_pthread_rwlock_wrlock"(ptr noundef %4), !dbg !580 store i32 %5, ptr %3, align 4, !dbg !578 %6 = load i32, ptr %3, align 4, !dbg !581 %7 = icmp eq i32 %6, 0, !dbg !581 @@ -1152,7 +1168,7 @@ define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { br i1 %11, label %12, label %14, !dbg !581 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_wrlock, ptr noundef @.str, i32 noundef 284, ptr noundef @.str.1) #4, !dbg !581 + call void @__assert_rtn(ptr noundef @__func__.rwlock_wrlock, ptr noundef @.str, i32 noundef 291, ptr noundef @.str.1) #4, !dbg !581 unreachable, !dbg !581 13: ; No predecessors! @@ -1165,7 +1181,7 @@ define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { ret void, !dbg !582 } -declare i32 @pthread_rwlock_wrlock(ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_wrlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !583 { @@ -1175,14 +1191,14 @@ define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !583 { call void @llvm.dbg.declare(metadata ptr %2, metadata !586, metadata !DIExpression()), !dbg !587 call void @llvm.dbg.declare(metadata ptr %3, metadata !588, metadata !DIExpression()), !dbg !589 %4 = load ptr, ptr %2, align 8, !dbg !590 - %5 = call i32 @pthread_rwlock_trywrlock(ptr noundef %4), !dbg !591 + %5 = call i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef %4), !dbg !591 store i32 %5, ptr %3, align 4, !dbg !589 %6 = load i32, ptr %3, align 4, !dbg !592 %7 = icmp eq i32 %6, 0, !dbg !593 ret i1 %7, !dbg !594 } -declare i32 @pthread_rwlock_trywrlock(ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { @@ -1192,7 +1208,7 @@ define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { call void @llvm.dbg.declare(metadata ptr %2, metadata !596, metadata !DIExpression()), !dbg !597 call void @llvm.dbg.declare(metadata ptr %3, metadata !598, metadata !DIExpression()), !dbg !599 %4 = load ptr, ptr %2, align 8, !dbg !600 - %5 = call i32 @pthread_rwlock_rdlock(ptr noundef %4), !dbg !601 + %5 = call i32 @"\01_pthread_rwlock_rdlock"(ptr noundef %4), !dbg !601 store i32 %5, ptr %3, align 4, !dbg !599 %6 = load i32, ptr %3, align 4, !dbg !602 %7 = icmp eq i32 %6, 0, !dbg !602 @@ -1203,7 +1219,7 @@ define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { br i1 %11, label %12, label %14, !dbg !602 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_rdlock, ptr noundef @.str, i32 noundef 297, ptr noundef @.str.1) #4, !dbg !602 + call void @__assert_rtn(ptr noundef @__func__.rwlock_rdlock, ptr noundef @.str, i32 noundef 304, ptr noundef @.str.1) #4, !dbg !602 unreachable, !dbg !602 13: ; No predecessors! @@ -1216,7 +1232,7 @@ define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { ret void, !dbg !603 } -declare i32 @pthread_rwlock_rdlock(ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_rdlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !604 { @@ -1226,14 +1242,14 @@ define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !604 { call void @llvm.dbg.declare(metadata ptr %2, metadata !605, metadata !DIExpression()), !dbg !606 call void @llvm.dbg.declare(metadata ptr %3, metadata !607, metadata !DIExpression()), !dbg !608 %4 = load ptr, ptr %2, align 8, !dbg !609 - %5 = call i32 @pthread_rwlock_tryrdlock(ptr noundef %4), !dbg !610 + %5 = call i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef %4), !dbg !610 store i32 %5, ptr %3, align 4, !dbg !608 %6 = load i32, ptr %3, align 4, !dbg !611 %7 = icmp eq i32 %6, 0, !dbg !612 ret i1 %7, !dbg !613 } -declare i32 @pthread_rwlock_tryrdlock(ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { @@ -1243,7 +1259,7 @@ define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { call void @llvm.dbg.declare(metadata ptr %2, metadata !615, metadata !DIExpression()), !dbg !616 call void @llvm.dbg.declare(metadata ptr %3, metadata !617, metadata !DIExpression()), !dbg !618 %4 = load ptr, ptr %2, align 8, !dbg !619 - %5 = call i32 @pthread_rwlock_unlock(ptr noundef %4), !dbg !620 + %5 = call i32 @"\01_pthread_rwlock_unlock"(ptr noundef %4), !dbg !620 store i32 %5, ptr %3, align 4, !dbg !618 %6 = load i32, ptr %3, align 4, !dbg !621 %7 = icmp eq i32 %6, 0, !dbg !621 @@ -1254,7 +1270,7 @@ define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { br i1 %11, label %12, label %14, !dbg !621 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_unlock, ptr noundef @.str, i32 noundef 310, ptr noundef @.str.1) #4, !dbg !621 + call void @__assert_rtn(ptr noundef @__func__.rwlock_unlock, ptr noundef @.str, i32 noundef 317, ptr noundef @.str.1) #4, !dbg !621 unreachable, !dbg !621 13: ; No predecessors! @@ -1267,7 +1283,7 @@ define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { ret void, !dbg !622 } -declare i32 @pthread_rwlock_unlock(ptr noundef) #2 +declare i32 @"\01_pthread_rwlock_unlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable define void @rwlock_test() #0 !dbg !623 { @@ -1298,7 +1314,7 @@ define void @rwlock_test() #0 !dbg !623 { br i1 %17, label %18, label %20, !dbg !635 18: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 322, ptr noundef @.str.2) #4, !dbg !635 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 329, ptr noundef @.str.2) #4, !dbg !635 unreachable, !dbg !635 19: ; No predecessors! @@ -1321,7 +1337,7 @@ define void @rwlock_test() #0 !dbg !623 { br i1 %30, label %31, label %33, !dbg !638 31: ; preds = %21 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 324, ptr noundef @.str.2) #4, !dbg !638 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 331, ptr noundef @.str.2) #4, !dbg !638 unreachable, !dbg !638 32: ; No predecessors! @@ -1332,7 +1348,7 @@ define void @rwlock_test() #0 !dbg !623 { 34: ; preds = %33, %32 call void @rwlock_unlock(ptr noundef %1), !dbg !639 - call void @__VERIFIER_loop_bound(i32 noundef 4), !dbg !640 + call void @__VERIFIER_loop_bound(i32 noundef 5), !dbg !640 call void @llvm.dbg.declare(metadata ptr %4, metadata !642, metadata !DIExpression()), !dbg !644 store i32 0, ptr %4, align 4, !dbg !644 br label %35, !dbg !645 @@ -1356,7 +1372,7 @@ define void @rwlock_test() #0 !dbg !623 { br i1 %46, label %47, label %49, !dbg !654 47: ; preds = %38 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 333, ptr noundef @.str.3) #4, !dbg !654 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 340, ptr noundef @.str.3) #4, !dbg !654 unreachable, !dbg !654 48: ; No predecessors! @@ -1375,133 +1391,133 @@ define void @rwlock_test() #0 !dbg !623 { br label %35, !dbg !657, !llvm.loop !658 54: ; preds = %35 - call void @llvm.dbg.declare(metadata ptr %6, metadata !660, metadata !DIExpression()), !dbg !662 - %55 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !663 - %56 = zext i1 %55 to i8, !dbg !662 - store i8 %56, ptr %6, align 1, !dbg !662 - %57 = load i8, ptr %6, align 1, !dbg !664 - %58 = trunc i8 %57 to i1, !dbg !664 - %59 = xor i1 %58, true, !dbg !664 - %60 = xor i1 %59, true, !dbg !664 - %61 = zext i1 %60 to i32, !dbg !664 - %62 = sext i32 %61 to i64, !dbg !664 - %63 = icmp ne i64 %62, 0, !dbg !664 - br i1 %63, label %64, label %66, !dbg !664 + call void @llvm.dbg.declare(metadata ptr %6, metadata !661, metadata !DIExpression()), !dbg !663 + %55 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !664 + %56 = zext i1 %55 to i8, !dbg !663 + store i8 %56, ptr %6, align 1, !dbg !663 + %57 = load i8, ptr %6, align 1, !dbg !665 + %58 = trunc i8 %57 to i1, !dbg !665 + %59 = xor i1 %58, true, !dbg !665 + %60 = xor i1 %59, true, !dbg !665 + %61 = zext i1 %60 to i32, !dbg !665 + %62 = sext i32 %61 to i64, !dbg !665 + %63 = icmp ne i64 %62, 0, !dbg !665 + br i1 %63, label %64, label %66, !dbg !665 64: ; preds = %54 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 338, ptr noundef @.str.2) #4, !dbg !664 - unreachable, !dbg !664 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 345, ptr noundef @.str.2) #4, !dbg !665 + unreachable, !dbg !665 65: ; No predecessors! - br label %67, !dbg !664 + br label %67, !dbg !665 66: ; preds = %54 - br label %67, !dbg !664 + br label %67, !dbg !665 67: ; preds = %66, %65 - call void @__VERIFIER_loop_bound(i32 noundef 4), !dbg !665 - call void @llvm.dbg.declare(metadata ptr %7, metadata !666, metadata !DIExpression()), !dbg !668 - store i32 0, ptr %7, align 4, !dbg !668 - br label %68, !dbg !669 + call void @__VERIFIER_loop_bound(i32 noundef 5), !dbg !666 + call void @llvm.dbg.declare(metadata ptr %7, metadata !667, metadata !DIExpression()), !dbg !669 + store i32 0, ptr %7, align 4, !dbg !669 + br label %68, !dbg !670 68: ; preds = %72, %67 - %69 = load i32, ptr %7, align 4, !dbg !670 - %70 = icmp slt i32 %69, 4, !dbg !672 - br i1 %70, label %71, label %75, !dbg !673 + %69 = load i32, ptr %7, align 4, !dbg !671 + %70 = icmp slt i32 %69, 4, !dbg !673 + br i1 %70, label %71, label %75, !dbg !674 71: ; preds = %68 - call void @rwlock_unlock(ptr noundef %1), !dbg !674 - br label %72, !dbg !676 + call void @rwlock_unlock(ptr noundef %1), !dbg !675 + br label %72, !dbg !677 72: ; preds = %71 - %73 = load i32, ptr %7, align 4, !dbg !677 - %74 = add nsw i32 %73, 1, !dbg !677 - store i32 %74, ptr %7, align 4, !dbg !677 - br label %68, !dbg !678, !llvm.loop !679 + %73 = load i32, ptr %7, align 4, !dbg !678 + %74 = add nsw i32 %73, 1, !dbg !678 + store i32 %74, ptr %7, align 4, !dbg !678 + br label %68, !dbg !679, !llvm.loop !680 75: ; preds = %68 - call void @rwlock_wrlock(ptr noundef %1), !dbg !681 - call void @llvm.dbg.declare(metadata ptr %8, metadata !683, metadata !DIExpression()), !dbg !684 - %76 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !685 - %77 = zext i1 %76 to i8, !dbg !684 - store i8 %77, ptr %8, align 1, !dbg !684 - call void @rwlock_unlock(ptr noundef %1), !dbg !686 - call void @rwlock_destroy(ptr noundef %1), !dbg !687 - ret void, !dbg !688 + call void @rwlock_wrlock(ptr noundef %1), !dbg !682 + call void @llvm.dbg.declare(metadata ptr %8, metadata !684, metadata !DIExpression()), !dbg !685 + %76 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !686 + %77 = zext i1 %76 to i8, !dbg !685 + store i8 %77, ptr %8, align 1, !dbg !685 + call void @rwlock_unlock(ptr noundef %1), !dbg !687 + call void @rwlock_destroy(ptr noundef %1), !dbg !688 + ret void, !dbg !689 } declare void @__VERIFIER_loop_bound(i32 noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @key_destroy(ptr noundef %0) #0 !dbg !689 { +define void @key_destroy(ptr noundef %0) #0 !dbg !690 { %2 = alloca ptr, align 8 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !690, metadata !DIExpression()), !dbg !691 - %3 = call ptr @pthread_self(), !dbg !692 - store ptr %3, ptr @latest_thread, align 8, !dbg !693 - ret void, !dbg !694 + call void @llvm.dbg.declare(metadata ptr %2, metadata !691, metadata !DIExpression()), !dbg !692 + %3 = call ptr @pthread_self(), !dbg !693 + store ptr %3, ptr @latest_thread, align 8, !dbg !694 + ret void, !dbg !695 } declare ptr @pthread_self() #2 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @key_worker(ptr noundef %0) #0 !dbg !695 { +define ptr @key_worker(ptr noundef %0) #0 !dbg !696 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 %4 = alloca i32, align 4 %5 = alloca ptr, align 8 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !696, metadata !DIExpression()), !dbg !697 - call void @llvm.dbg.declare(metadata ptr %3, metadata !698, metadata !DIExpression()), !dbg !699 - store i32 1, ptr %3, align 4, !dbg !699 - call void @llvm.dbg.declare(metadata ptr %4, metadata !700, metadata !DIExpression()), !dbg !701 - %6 = load i64, ptr @local_data, align 8, !dbg !702 - %7 = call i32 @pthread_setspecific(i64 noundef %6, ptr noundef %3), !dbg !703 - store i32 %7, ptr %4, align 4, !dbg !701 - %8 = load i32, ptr %4, align 4, !dbg !704 - %9 = icmp eq i32 %8, 0, !dbg !704 - %10 = xor i1 %9, true, !dbg !704 - %11 = zext i1 %10 to i32, !dbg !704 - %12 = sext i32 %11 to i64, !dbg !704 - %13 = icmp ne i64 %12, 0, !dbg !704 - br i1 %13, label %14, label %16, !dbg !704 + call void @llvm.dbg.declare(metadata ptr %2, metadata !697, metadata !DIExpression()), !dbg !698 + call void @llvm.dbg.declare(metadata ptr %3, metadata !699, metadata !DIExpression()), !dbg !700 + store i32 1, ptr %3, align 4, !dbg !700 + call void @llvm.dbg.declare(metadata ptr %4, metadata !701, metadata !DIExpression()), !dbg !702 + %6 = load i64, ptr @local_data, align 8, !dbg !703 + %7 = call i32 @pthread_setspecific(i64 noundef %6, ptr noundef %3), !dbg !704 + store i32 %7, ptr %4, align 4, !dbg !702 + %8 = load i32, ptr %4, align 4, !dbg !705 + %9 = icmp eq i32 %8, 0, !dbg !705 + %10 = xor i1 %9, true, !dbg !705 + %11 = zext i1 %10 to i32, !dbg !705 + %12 = sext i32 %11 to i64, !dbg !705 + %13 = icmp ne i64 %12, 0, !dbg !705 + br i1 %13, label %14, label %16, !dbg !705 14: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 371, ptr noundef @.str.1) #4, !dbg !704 - unreachable, !dbg !704 + call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 378, ptr noundef @.str.1) #4, !dbg !705 + unreachable, !dbg !705 15: ; No predecessors! - br label %17, !dbg !704 + br label %17, !dbg !705 16: ; preds = %1 - br label %17, !dbg !704 + br label %17, !dbg !705 17: ; preds = %16, %15 - call void @llvm.dbg.declare(metadata ptr %5, metadata !705, metadata !DIExpression()), !dbg !706 - %18 = load i64, ptr @local_data, align 8, !dbg !707 - %19 = call ptr @pthread_getspecific(i64 noundef %18), !dbg !708 - store ptr %19, ptr %5, align 8, !dbg !706 - %20 = load ptr, ptr %5, align 8, !dbg !709 - %21 = icmp eq ptr %20, %3, !dbg !709 - %22 = xor i1 %21, true, !dbg !709 - %23 = zext i1 %22 to i32, !dbg !709 - %24 = sext i32 %23 to i64, !dbg !709 - %25 = icmp ne i64 %24, 0, !dbg !709 - br i1 %25, label %26, label %28, !dbg !709 + call void @llvm.dbg.declare(metadata ptr %5, metadata !706, metadata !DIExpression()), !dbg !707 + %18 = load i64, ptr @local_data, align 8, !dbg !708 + %19 = call ptr @pthread_getspecific(i64 noundef %18), !dbg !709 + store ptr %19, ptr %5, align 8, !dbg !707 + %20 = load ptr, ptr %5, align 8, !dbg !710 + %21 = icmp eq ptr %20, %3, !dbg !710 + %22 = xor i1 %21, true, !dbg !710 + %23 = zext i1 %22 to i32, !dbg !710 + %24 = sext i32 %23 to i64, !dbg !710 + %25 = icmp ne i64 %24, 0, !dbg !710 + br i1 %25, label %26, label %28, !dbg !710 26: ; preds = %17 - call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 374, ptr noundef @.str.5) #4, !dbg !709 - unreachable, !dbg !709 + call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 381, ptr noundef @.str.5) #4, !dbg !710 + unreachable, !dbg !710 27: ; No predecessors! - br label %29, !dbg !709 + br label %29, !dbg !710 28: ; preds = %17 - br label %29, !dbg !709 + br label %29, !dbg !710 29: ; preds = %28, %27 - %30 = load ptr, ptr %2, align 8, !dbg !710 - ret ptr %30, !dbg !711 + %30 = load ptr, ptr %2, align 8, !dbg !711 + ret ptr %30, !dbg !712 } declare i32 @pthread_setspecific(i64 noundef, ptr noundef) #2 @@ -1509,158 +1525,158 @@ declare i32 @pthread_setspecific(i64 noundef, ptr noundef) #2 declare ptr @pthread_getspecific(i64 noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @key_test() #0 !dbg !712 { +define void @key_test() #0 !dbg !713 { %1 = alloca i32, align 4 %2 = alloca ptr, align 8 %3 = alloca i32, align 4 %4 = alloca ptr, align 8 %5 = alloca ptr, align 8 %6 = alloca ptr, align 8 - call void @llvm.dbg.declare(metadata ptr %1, metadata !713, metadata !DIExpression()), !dbg !714 - store i32 2, ptr %1, align 4, !dbg !714 - call void @llvm.dbg.declare(metadata ptr %2, metadata !715, metadata !DIExpression()), !dbg !716 - store ptr inttoptr (i64 41 to ptr), ptr %2, align 8, !dbg !716 - call void @llvm.dbg.declare(metadata ptr %3, metadata !717, metadata !DIExpression()), !dbg !718 - %7 = call i32 @pthread_key_create(ptr noundef @local_data, ptr noundef @key_destroy), !dbg !719 - call void @llvm.dbg.declare(metadata ptr %4, metadata !720, metadata !DIExpression()), !dbg !721 - %8 = load ptr, ptr %2, align 8, !dbg !722 - %9 = call ptr @thread_create(ptr noundef @key_worker, ptr noundef %8), !dbg !723 - store ptr %9, ptr %4, align 8, !dbg !721 - %10 = load i64, ptr @local_data, align 8, !dbg !724 - %11 = call i32 @pthread_setspecific(i64 noundef %10, ptr noundef %1), !dbg !725 - store i32 %11, ptr %3, align 4, !dbg !726 - %12 = load i32, ptr %3, align 4, !dbg !727 - %13 = icmp eq i32 %12, 0, !dbg !727 - %14 = xor i1 %13, true, !dbg !727 - %15 = zext i1 %14 to i32, !dbg !727 - %16 = sext i32 %15 to i64, !dbg !727 - %17 = icmp ne i64 %16, 0, !dbg !727 - br i1 %17, label %18, label %20, !dbg !727 + call void @llvm.dbg.declare(metadata ptr %1, metadata !714, metadata !DIExpression()), !dbg !715 + store i32 2, ptr %1, align 4, !dbg !715 + call void @llvm.dbg.declare(metadata ptr %2, metadata !716, metadata !DIExpression()), !dbg !717 + store ptr inttoptr (i64 41 to ptr), ptr %2, align 8, !dbg !717 + call void @llvm.dbg.declare(metadata ptr %3, metadata !718, metadata !DIExpression()), !dbg !719 + %7 = call i32 @pthread_key_create(ptr noundef @local_data, ptr noundef @key_destroy), !dbg !720 + call void @llvm.dbg.declare(metadata ptr %4, metadata !721, metadata !DIExpression()), !dbg !722 + %8 = load ptr, ptr %2, align 8, !dbg !723 + %9 = call ptr @thread_create(ptr noundef @key_worker, ptr noundef %8), !dbg !724 + store ptr %9, ptr %4, align 8, !dbg !722 + %10 = load i64, ptr @local_data, align 8, !dbg !725 + %11 = call i32 @pthread_setspecific(i64 noundef %10, ptr noundef %1), !dbg !726 + store i32 %11, ptr %3, align 4, !dbg !727 + %12 = load i32, ptr %3, align 4, !dbg !728 + %13 = icmp eq i32 %12, 0, !dbg !728 + %14 = xor i1 %13, true, !dbg !728 + %15 = zext i1 %14 to i32, !dbg !728 + %16 = sext i32 %15 to i64, !dbg !728 + %17 = icmp ne i64 %16, 0, !dbg !728 + br i1 %17, label %18, label %20, !dbg !728 18: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 390, ptr noundef @.str.1) #4, !dbg !727 - unreachable, !dbg !727 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 397, ptr noundef @.str.1) #4, !dbg !728 + unreachable, !dbg !728 19: ; No predecessors! - br label %21, !dbg !727 + br label %21, !dbg !728 20: ; preds = %0 - br label %21, !dbg !727 + br label %21, !dbg !728 21: ; preds = %20, %19 - call void @llvm.dbg.declare(metadata ptr %5, metadata !728, metadata !DIExpression()), !dbg !729 - %22 = load i64, ptr @local_data, align 8, !dbg !730 - %23 = call ptr @pthread_getspecific(i64 noundef %22), !dbg !731 - store ptr %23, ptr %5, align 8, !dbg !729 - %24 = load ptr, ptr %5, align 8, !dbg !732 - %25 = icmp eq ptr %24, %1, !dbg !732 - %26 = xor i1 %25, true, !dbg !732 - %27 = zext i1 %26 to i32, !dbg !732 - %28 = sext i32 %27 to i64, !dbg !732 - %29 = icmp ne i64 %28, 0, !dbg !732 - br i1 %29, label %30, label %32, !dbg !732 + call void @llvm.dbg.declare(metadata ptr %5, metadata !729, metadata !DIExpression()), !dbg !730 + %22 = load i64, ptr @local_data, align 8, !dbg !731 + %23 = call ptr @pthread_getspecific(i64 noundef %22), !dbg !732 + store ptr %23, ptr %5, align 8, !dbg !730 + %24 = load ptr, ptr %5, align 8, !dbg !733 + %25 = icmp eq ptr %24, %1, !dbg !733 + %26 = xor i1 %25, true, !dbg !733 + %27 = zext i1 %26 to i32, !dbg !733 + %28 = sext i32 %27 to i64, !dbg !733 + %29 = icmp ne i64 %28, 0, !dbg !733 + br i1 %29, label %30, label %32, !dbg !733 30: ; preds = %21 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 393, ptr noundef @.str.5) #4, !dbg !732 - unreachable, !dbg !732 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 400, ptr noundef @.str.5) #4, !dbg !733 + unreachable, !dbg !733 31: ; No predecessors! - br label %33, !dbg !732 + br label %33, !dbg !733 32: ; preds = %21 - br label %33, !dbg !732 + br label %33, !dbg !733 33: ; preds = %32, %31 - %34 = load i64, ptr @local_data, align 8, !dbg !733 - %35 = call i32 @pthread_setspecific(i64 noundef %34, ptr noundef null), !dbg !734 - store i32 %35, ptr %3, align 4, !dbg !735 - %36 = load i32, ptr %3, align 4, !dbg !736 - %37 = icmp eq i32 %36, 0, !dbg !736 - %38 = xor i1 %37, true, !dbg !736 - %39 = zext i1 %38 to i32, !dbg !736 - %40 = sext i32 %39 to i64, !dbg !736 - %41 = icmp ne i64 %40, 0, !dbg !736 - br i1 %41, label %42, label %44, !dbg !736 + %34 = load i64, ptr @local_data, align 8, !dbg !734 + %35 = call i32 @pthread_setspecific(i64 noundef %34, ptr noundef null), !dbg !735 + store i32 %35, ptr %3, align 4, !dbg !736 + %36 = load i32, ptr %3, align 4, !dbg !737 + %37 = icmp eq i32 %36, 0, !dbg !737 + %38 = xor i1 %37, true, !dbg !737 + %39 = zext i1 %38 to i32, !dbg !737 + %40 = sext i32 %39 to i64, !dbg !737 + %41 = icmp ne i64 %40, 0, !dbg !737 + br i1 %41, label %42, label %44, !dbg !737 42: ; preds = %33 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 396, ptr noundef @.str.1) #4, !dbg !736 - unreachable, !dbg !736 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 403, ptr noundef @.str.1) #4, !dbg !737 + unreachable, !dbg !737 43: ; No predecessors! - br label %45, !dbg !736 + br label %45, !dbg !737 44: ; preds = %33 - br label %45, !dbg !736 + br label %45, !dbg !737 45: ; preds = %44, %43 - call void @llvm.dbg.declare(metadata ptr %6, metadata !737, metadata !DIExpression()), !dbg !738 - %46 = load ptr, ptr %4, align 8, !dbg !739 - %47 = call ptr @thread_join(ptr noundef %46), !dbg !740 - store ptr %47, ptr %6, align 8, !dbg !738 - %48 = load ptr, ptr %6, align 8, !dbg !741 - %49 = load ptr, ptr %2, align 8, !dbg !741 - %50 = icmp eq ptr %48, %49, !dbg !741 - %51 = xor i1 %50, true, !dbg !741 - %52 = zext i1 %51 to i32, !dbg !741 - %53 = sext i32 %52 to i64, !dbg !741 - %54 = icmp ne i64 %53, 0, !dbg !741 - br i1 %54, label %55, label %57, !dbg !741 + call void @llvm.dbg.declare(metadata ptr %6, metadata !738, metadata !DIExpression()), !dbg !739 + %46 = load ptr, ptr %4, align 8, !dbg !740 + %47 = call ptr @thread_join(ptr noundef %46), !dbg !741 + store ptr %47, ptr %6, align 8, !dbg !739 + %48 = load ptr, ptr %6, align 8, !dbg !742 + %49 = load ptr, ptr %2, align 8, !dbg !742 + %50 = icmp eq ptr %48, %49, !dbg !742 + %51 = xor i1 %50, true, !dbg !742 + %52 = zext i1 %51 to i32, !dbg !742 + %53 = sext i32 %52 to i64, !dbg !742 + %54 = icmp ne i64 %53, 0, !dbg !742 + br i1 %54, label %55, label %57, !dbg !742 55: ; preds = %45 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 399, ptr noundef @.str.4) #4, !dbg !741 - unreachable, !dbg !741 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 406, ptr noundef @.str.4) #4, !dbg !742 + unreachable, !dbg !742 56: ; No predecessors! - br label %58, !dbg !741 + br label %58, !dbg !742 57: ; preds = %45 - br label %58, !dbg !741 + br label %58, !dbg !742 58: ; preds = %57, %56 - %59 = load i64, ptr @local_data, align 8, !dbg !742 - %60 = call i32 @pthread_key_delete(i64 noundef %59), !dbg !743 - store i32 %60, ptr %3, align 4, !dbg !744 - %61 = load i32, ptr %3, align 4, !dbg !745 - %62 = icmp eq i32 %61, 0, !dbg !745 - %63 = xor i1 %62, true, !dbg !745 - %64 = zext i1 %63 to i32, !dbg !745 - %65 = sext i32 %64 to i64, !dbg !745 - %66 = icmp ne i64 %65, 0, !dbg !745 - br i1 %66, label %67, label %69, !dbg !745 + %59 = load i64, ptr @local_data, align 8, !dbg !743 + %60 = call i32 @pthread_key_delete(i64 noundef %59), !dbg !744 + store i32 %60, ptr %3, align 4, !dbg !745 + %61 = load i32, ptr %3, align 4, !dbg !746 + %62 = icmp eq i32 %61, 0, !dbg !746 + %63 = xor i1 %62, true, !dbg !746 + %64 = zext i1 %63 to i32, !dbg !746 + %65 = sext i32 %64 to i64, !dbg !746 + %66 = icmp ne i64 %65, 0, !dbg !746 + br i1 %66, label %67, label %69, !dbg !746 67: ; preds = %58 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 402, ptr noundef @.str.1) #4, !dbg !745 - unreachable, !dbg !745 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 409, ptr noundef @.str.1) #4, !dbg !746 + unreachable, !dbg !746 68: ; No predecessors! - br label %70, !dbg !745 + br label %70, !dbg !746 69: ; preds = %58 - br label %70, !dbg !745 + br label %70, !dbg !746 70: ; preds = %69, %68 - %71 = load ptr, ptr @latest_thread, align 8, !dbg !746 - %72 = load ptr, ptr %4, align 8, !dbg !746 - %73 = call i32 @pthread_equal(ptr noundef %71, ptr noundef %72), !dbg !746 - %74 = icmp ne i32 %73, 0, !dbg !746 - %75 = xor i1 %74, true, !dbg !746 - %76 = zext i1 %75 to i32, !dbg !746 - %77 = sext i32 %76 to i64, !dbg !746 - %78 = icmp ne i64 %77, 0, !dbg !746 - br i1 %78, label %79, label %81, !dbg !746 + %71 = load ptr, ptr @latest_thread, align 8, !dbg !747 + %72 = load ptr, ptr %4, align 8, !dbg !747 + %73 = call i32 @pthread_equal(ptr noundef %71, ptr noundef %72), !dbg !747 + %74 = icmp ne i32 %73, 0, !dbg !747 + %75 = xor i1 %74, true, !dbg !747 + %76 = zext i1 %75 to i32, !dbg !747 + %77 = sext i32 %76 to i64, !dbg !747 + %78 = icmp ne i64 %77, 0, !dbg !747 + br i1 %78, label %79, label %81, !dbg !747 79: ; preds = %70 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 404, ptr noundef @.str.6) #4, !dbg !746 - unreachable, !dbg !746 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 411, ptr noundef @.str.6) #4, !dbg !747 + unreachable, !dbg !747 80: ; No predecessors! - br label %82, !dbg !746 + br label %82, !dbg !747 81: ; preds = %70 - br label %82, !dbg !746 + br label %82, !dbg !747 82: ; preds = %81, %80 - ret void, !dbg !747 + ret void, !dbg !748 } declare i32 @pthread_key_create(ptr noundef, ptr noundef) #2 @@ -1670,12 +1686,12 @@ declare i32 @pthread_key_delete(i64 noundef) #2 declare i32 @pthread_equal(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define i32 @main() #0 !dbg !748 { - call void @mutex_test(), !dbg !751 - call void @cond_test(), !dbg !752 - call void @rwlock_test(), !dbg !753 - call void @key_test(), !dbg !754 - ret i32 0, !dbg !755 +define i32 @main() #0 !dbg !749 { + call void @mutex_test(), !dbg !752 + call void @cond_test(), !dbg !753 + call void @rwlock_test(), !dbg !754 + call void @key_test(), !dbg !755 + ret i32 0, !dbg !756 } attributes #0 = { noinline nounwind ssp uwtable "frame-pointer"="non-leaf" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.5a,+zcm,+zcz" } @@ -1685,11 +1701,11 @@ attributes #3 = { cold noreturn "disable-tail-calls"="true" "frame-pointer"="non attributes #4 = { cold noreturn } !llvm.dbg.cu = !{!61} -!llvm.module.flags = !{!155, !156, !157, !158, !159, !160} -!llvm.ident = !{!161} +!llvm.module.flags = !{!156, !157, !158, !159, !160, !161} +!llvm.ident = !{!162} !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) -!1 = distinct !DIGlobalVariable(scope: null, file: !2, line: 19, type: !3, isLocal: true, isDefinition: true) +!1 = distinct !DIGlobalVariable(scope: null, file: !2, line: 18, type: !3, isLocal: true, isDefinition: true) !2 = !DIFile(filename: "benchmarks/c/miscellaneous/pthread.c", directory: "/Users/r/Documents/Dat3M") !3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 112, elements: !6) !4 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5) @@ -1697,750 +1713,751 @@ attributes #4 = { cold noreturn } !6 = !{!7} !7 = !DISubrange(count: 14) !8 = !DIGlobalVariableExpression(var: !9, expr: !DIExpression()) -!9 = distinct !DIGlobalVariable(scope: null, file: !2, line: 19, type: !10, isLocal: true, isDefinition: true) +!9 = distinct !DIGlobalVariable(scope: null, file: !2, line: 18, type: !10, isLocal: true, isDefinition: true) !10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 80, elements: !11) !11 = !{!12} !12 = !DISubrange(count: 10) !13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression()) -!14 = distinct !DIGlobalVariable(scope: null, file: !2, line: 19, type: !15, isLocal: true, isDefinition: true) +!14 = distinct !DIGlobalVariable(scope: null, file: !2, line: 18, type: !15, isLocal: true, isDefinition: true) !15 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 96, elements: !16) !16 = !{!17} !17 = !DISubrange(count: 12) !18 = !DIGlobalVariableExpression(var: !19, expr: !DIExpression()) -!19 = distinct !DIGlobalVariable(scope: null, file: !2, line: 28, type: !20, isLocal: true, isDefinition: true) +!19 = distinct !DIGlobalVariable(scope: null, file: !2, line: 27, type: !20, isLocal: true, isDefinition: true) !20 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 96, elements: !16) !21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression()) -!22 = distinct !DIGlobalVariable(scope: null, file: !2, line: 50, type: !23, isLocal: true, isDefinition: true) +!22 = distinct !DIGlobalVariable(scope: null, file: !2, line: 49, type: !23, isLocal: true, isDefinition: true) !23 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 88, elements: !24) !24 = !{!25} !25 = !DISubrange(count: 11) !26 = !DIGlobalVariableExpression(var: !27, expr: !DIExpression()) -!27 = distinct !DIGlobalVariable(scope: null, file: !2, line: 81, type: !3, isLocal: true, isDefinition: true) +!27 = distinct !DIGlobalVariable(scope: null, file: !2, line: 80, type: !3, isLocal: true, isDefinition: true) !28 = !DIGlobalVariableExpression(var: !29, expr: !DIExpression()) -!29 = distinct !DIGlobalVariable(scope: null, file: !2, line: 87, type: !23, isLocal: true, isDefinition: true) +!29 = distinct !DIGlobalVariable(scope: null, file: !2, line: 86, type: !23, isLocal: true, isDefinition: true) !30 = !DIGlobalVariableExpression(var: !31, expr: !DIExpression()) -!31 = distinct !DIGlobalVariable(scope: null, file: !2, line: 100, type: !32, isLocal: true, isDefinition: true) +!31 = distinct !DIGlobalVariable(scope: null, file: !2, line: 99, type: !32, isLocal: true, isDefinition: true) !32 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 104, elements: !33) !33 = !{!34} !34 = !DISubrange(count: 13) !35 = !DIGlobalVariableExpression(var: !36, expr: !DIExpression()) -!36 = distinct !DIGlobalVariable(scope: null, file: !2, line: 114, type: !23, isLocal: true, isDefinition: true) +!36 = distinct !DIGlobalVariable(scope: null, file: !2, line: 113, type: !23, isLocal: true, isDefinition: true) !37 = !DIGlobalVariableExpression(var: !38, expr: !DIExpression()) -!38 = distinct !DIGlobalVariable(scope: null, file: !2, line: 114, type: !39, isLocal: true, isDefinition: true) +!38 = distinct !DIGlobalVariable(scope: null, file: !2, line: 113, type: !39, isLocal: true, isDefinition: true) !39 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 72, elements: !40) !40 = !{!41} !41 = !DISubrange(count: 9) !42 = !DIGlobalVariableExpression(var: !43, expr: !DIExpression()) -!43 = distinct !DIGlobalVariable(scope: null, file: !2, line: 123, type: !44, isLocal: true, isDefinition: true) +!43 = distinct !DIGlobalVariable(scope: null, file: !2, line: 122, type: !44, isLocal: true, isDefinition: true) !44 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 64, elements: !45) !45 = !{!46} !46 = !DISubrange(count: 8) !47 = !DIGlobalVariableExpression(var: !48, expr: !DIExpression()) -!48 = distinct !DIGlobalVariable(scope: null, file: !2, line: 155, type: !49, isLocal: true, isDefinition: true) +!48 = distinct !DIGlobalVariable(scope: null, file: !2, line: 154, type: !49, isLocal: true, isDefinition: true) !49 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 80, elements: !11) !50 = !DIGlobalVariableExpression(var: !51, expr: !DIExpression()) -!51 = distinct !DIGlobalVariable(scope: null, file: !2, line: 167, type: !32, isLocal: true, isDefinition: true) +!51 = distinct !DIGlobalVariable(scope: null, file: !2, line: 166, type: !32, isLocal: true, isDefinition: true) !52 = !DIGlobalVariableExpression(var: !53, expr: !DIExpression()) -!53 = distinct !DIGlobalVariable(scope: null, file: !2, line: 173, type: !20, isLocal: true, isDefinition: true) +!53 = distinct !DIGlobalVariable(scope: null, file: !2, line: 172, type: !20, isLocal: true, isDefinition: true) !54 = !DIGlobalVariableExpression(var: !55, expr: !DIExpression()) -!55 = distinct !DIGlobalVariable(scope: null, file: !2, line: 179, type: !56, isLocal: true, isDefinition: true) +!55 = distinct !DIGlobalVariable(scope: null, file: !2, line: 178, type: !56, isLocal: true, isDefinition: true) !56 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 120, elements: !57) !57 = !{!58} !58 = !DISubrange(count: 15) !59 = !DIGlobalVariableExpression(var: !60, expr: !DIExpression()) -!60 = distinct !DIGlobalVariable(name: "phase", scope: !61, file: !2, line: 201, type: !154, isLocal: false, isDefinition: true) -!61 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "Homebrew clang version 15.0.7", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !62, globals: !64, splitDebugInlining: false, nameTableKind: None, sysroot: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk", sdk: "MacOSX13.sdk") -!62 = !{!63} -!63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -!64 = !{!0, !8, !13, !18, !21, !26, !28, !30, !35, !37, !42, !47, !50, !52, !54, !59, !65, !67, !72, !74, !76, !78, !80, !82, !84, !86, !91, !94, !99, !113, !125, !148} -!65 = !DIGlobalVariableExpression(var: !66, expr: !DIExpression()) -!66 = distinct !DIGlobalVariable(scope: null, file: !2, line: 245, type: !49, isLocal: true, isDefinition: true) -!67 = !DIGlobalVariableExpression(var: !68, expr: !DIExpression()) -!68 = distinct !DIGlobalVariable(scope: null, file: !2, line: 245, type: !69, isLocal: true, isDefinition: true) -!69 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 144, elements: !70) -!70 = !{!71} -!71 = !DISubrange(count: 18) -!72 = !DIGlobalVariableExpression(var: !73, expr: !DIExpression()) -!73 = distinct !DIGlobalVariable(scope: null, file: !2, line: 262, type: !20, isLocal: true, isDefinition: true) -!74 = !DIGlobalVariableExpression(var: !75, expr: !DIExpression()) -!75 = distinct !DIGlobalVariable(scope: null, file: !2, line: 278, type: !56, isLocal: true, isDefinition: true) -!76 = !DIGlobalVariableExpression(var: !77, expr: !DIExpression()) -!77 = distinct !DIGlobalVariable(scope: null, file: !2, line: 284, type: !3, isLocal: true, isDefinition: true) -!78 = !DIGlobalVariableExpression(var: !79, expr: !DIExpression()) -!79 = distinct !DIGlobalVariable(scope: null, file: !2, line: 297, type: !3, isLocal: true, isDefinition: true) -!80 = !DIGlobalVariableExpression(var: !81, expr: !DIExpression()) -!81 = distinct !DIGlobalVariable(scope: null, file: !2, line: 310, type: !3, isLocal: true, isDefinition: true) -!82 = !DIGlobalVariableExpression(var: !83, expr: !DIExpression()) -!83 = distinct !DIGlobalVariable(scope: null, file: !2, line: 322, type: !20, isLocal: true, isDefinition: true) -!84 = !DIGlobalVariableExpression(var: !85, expr: !DIExpression()) -!85 = distinct !DIGlobalVariable(scope: null, file: !2, line: 371, type: !23, isLocal: true, isDefinition: true) -!86 = !DIGlobalVariableExpression(var: !87, expr: !DIExpression()) -!87 = distinct !DIGlobalVariable(scope: null, file: !2, line: 374, type: !88, isLocal: true, isDefinition: true) -!88 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 224, elements: !89) -!89 = !{!90} -!90 = !DISubrange(count: 28) -!91 = !DIGlobalVariableExpression(var: !92, expr: !DIExpression()) -!92 = distinct !DIGlobalVariable(scope: null, file: !2, line: 390, type: !93, isLocal: true, isDefinition: true) -!93 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 72, elements: !40) -!94 = !DIGlobalVariableExpression(var: !95, expr: !DIExpression()) -!95 = distinct !DIGlobalVariable(scope: null, file: !2, line: 404, type: !96, isLocal: true, isDefinition: true) -!96 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 296, elements: !97) -!97 = !{!98} -!98 = !DISubrange(count: 37) -!99 = !DIGlobalVariableExpression(var: !100, expr: !DIExpression()) -!100 = distinct !DIGlobalVariable(name: "cond_mutex", scope: !61, file: !2, line: 199, type: !101, isLocal: false, isDefinition: true) -!101 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutex_t", file: !102, line: 31, baseType: !103) -!102 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h", directory: "") -!103 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutex_t", file: !104, line: 113, baseType: !105) -!104 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_types.h", directory: "") -!105 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutex_t", file: !104, line: 78, size: 512, elements: !106) -!106 = !{!107, !109} -!107 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !105, file: !104, line: 79, baseType: !108, size: 64) -!108 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed) -!109 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !105, file: !104, line: 80, baseType: !110, size: 448, offset: 64) -!110 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 448, elements: !111) -!111 = !{!112} -!112 = !DISubrange(count: 56) -!113 = !DIGlobalVariableExpression(var: !114, expr: !DIExpression()) -!114 = distinct !DIGlobalVariable(name: "cond", scope: !61, file: !2, line: 200, type: !115, isLocal: false, isDefinition: true) -!115 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_cond_t", file: !116, line: 31, baseType: !117) -!116 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_cond_t.h", directory: "") -!117 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_cond_t", file: !104, line: 110, baseType: !118) -!118 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_cond_t", file: !104, line: 68, size: 384, elements: !119) -!119 = !{!120, !121} -!120 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !118, file: !104, line: 69, baseType: !108, size: 64) -!121 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !118, file: !104, line: 70, baseType: !122, size: 320, offset: 64) -!122 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 320, elements: !123) -!123 = !{!124} -!124 = !DISubrange(count: 40) -!125 = !DIGlobalVariableExpression(var: !126, expr: !DIExpression()) -!126 = distinct !DIGlobalVariable(name: "latest_thread", scope: !61, file: !2, line: 358, type: !127, isLocal: false, isDefinition: true) -!127 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_t", file: !128, line: 31, baseType: !129) -!128 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_t.h", directory: "") -!129 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_t", file: !104, line: 118, baseType: !130) -!130 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !131, size: 64) -!131 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_t", file: !104, line: 103, size: 65536, elements: !132) -!132 = !{!133, !134, !144} -!133 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !131, file: !104, line: 104, baseType: !108, size: 64) -!134 = !DIDerivedType(tag: DW_TAG_member, name: "__cleanup_stack", scope: !131, file: !104, line: 105, baseType: !135, size: 64, offset: 64) -!135 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !136, size: 64) -!136 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__darwin_pthread_handler_rec", file: !104, line: 57, size: 192, elements: !137) -!137 = !{!138, !142, !143} -!138 = !DIDerivedType(tag: DW_TAG_member, name: "__routine", scope: !136, file: !104, line: 58, baseType: !139, size: 64) -!139 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !140, size: 64) -!140 = !DISubroutineType(types: !141) -!141 = !{null, !63} -!142 = !DIDerivedType(tag: DW_TAG_member, name: "__arg", scope: !136, file: !104, line: 59, baseType: !63, size: 64, offset: 64) -!143 = !DIDerivedType(tag: DW_TAG_member, name: "__next", scope: !136, file: !104, line: 60, baseType: !135, size: 64, offset: 128) -!144 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !131, file: !104, line: 106, baseType: !145, size: 65408, offset: 128) -!145 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 65408, elements: !146) -!146 = !{!147} -!147 = !DISubrange(count: 8176) -!148 = !DIGlobalVariableExpression(var: !149, expr: !DIExpression()) -!149 = distinct !DIGlobalVariable(name: "local_data", scope: !61, file: !2, line: 359, type: !150, isLocal: false, isDefinition: true) -!150 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_key_t", file: !151, line: 31, baseType: !152) -!151 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_key_t.h", directory: "") -!152 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_key_t", file: !104, line: 112, baseType: !153) -!153 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned) -!154 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -!155 = !{i32 7, !"Dwarf Version", i32 4} -!156 = !{i32 2, !"Debug Info Version", i32 3} -!157 = !{i32 1, !"wchar_size", i32 4} -!158 = !{i32 7, !"PIC Level", i32 2} -!159 = !{i32 7, !"uwtable", i32 2} -!160 = !{i32 7, !"frame-pointer", i32 1} -!161 = !{!"Homebrew clang version 15.0.7"} -!162 = distinct !DISubprogram(name: "thread_create", scope: !2, file: !2, line: 13, type: !163, scopeLine: 14, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!163 = !DISubroutineType(types: !164) -!164 = !{!127, !165, !63} -!165 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !166, size: 64) -!166 = !DISubroutineType(types: !167) -!167 = !{!63, !63} -!168 = !{} -!169 = !DILocalVariable(name: "runner", arg: 1, scope: !162, file: !2, line: 13, type: !165) -!170 = !DILocation(line: 13, column: 32, scope: !162) -!171 = !DILocalVariable(name: "data", arg: 2, scope: !162, file: !2, line: 13, type: !63) -!172 = !DILocation(line: 13, column: 54, scope: !162) -!173 = !DILocalVariable(name: "id", scope: !162, file: !2, line: 15, type: !127) -!174 = !DILocation(line: 15, column: 15, scope: !162) -!175 = !DILocalVariable(name: "attr", scope: !162, file: !2, line: 16, type: !176) -!176 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_attr_t", file: !177, line: 31, baseType: !178) -!177 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_attr_t.h", directory: "") -!178 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_attr_t", file: !104, line: 109, baseType: !179) -!179 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_attr_t", file: !104, line: 63, size: 512, elements: !180) -!180 = !{!181, !182} -!181 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !179, file: !104, line: 64, baseType: !108, size: 64) -!182 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !179, file: !104, line: 65, baseType: !110, size: 448, offset: 64) -!183 = !DILocation(line: 16, column: 20, scope: !162) -!184 = !DILocation(line: 17, column: 5, scope: !162) -!185 = !DILocalVariable(name: "status", scope: !162, file: !2, line: 18, type: !154) -!186 = !DILocation(line: 18, column: 9, scope: !162) -!187 = !DILocation(line: 18, column: 45, scope: !162) -!188 = !DILocation(line: 18, column: 53, scope: !162) -!189 = !DILocation(line: 18, column: 18, scope: !162) -!190 = !DILocation(line: 19, column: 5, scope: !162) -!191 = !DILocation(line: 20, column: 5, scope: !162) -!192 = !DILocation(line: 21, column: 12, scope: !162) -!193 = !DILocation(line: 21, column: 5, scope: !162) -!194 = distinct !DISubprogram(name: "thread_join", scope: !2, file: !2, line: 24, type: !195, scopeLine: 25, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!195 = !DISubroutineType(types: !196) -!196 = !{!63, !127} -!197 = !DILocalVariable(name: "id", arg: 1, scope: !194, file: !2, line: 24, type: !127) -!198 = !DILocation(line: 24, column: 29, scope: !194) -!199 = !DILocalVariable(name: "result", scope: !194, file: !2, line: 26, type: !63) -!200 = !DILocation(line: 26, column: 11, scope: !194) -!201 = !DILocalVariable(name: "status", scope: !194, file: !2, line: 27, type: !154) -!202 = !DILocation(line: 27, column: 9, scope: !194) -!203 = !DILocation(line: 27, column: 31, scope: !194) -!204 = !DILocation(line: 27, column: 18, scope: !194) -!205 = !DILocation(line: 28, column: 5, scope: !194) -!206 = !DILocation(line: 29, column: 12, scope: !194) -!207 = !DILocation(line: 29, column: 5, scope: !194) -!208 = distinct !DISubprogram(name: "mutex_init", scope: !2, file: !2, line: 44, type: !209, scopeLine: 45, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!209 = !DISubroutineType(types: !210) -!210 = !{null, !211, !154, !154, !154, !154} -!211 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !101, size: 64) -!212 = !DILocalVariable(name: "lock", arg: 1, scope: !208, file: !2, line: 44, type: !211) -!213 = !DILocation(line: 44, column: 34, scope: !208) -!214 = !DILocalVariable(name: "type", arg: 2, scope: !208, file: !2, line: 44, type: !154) -!215 = !DILocation(line: 44, column: 44, scope: !208) -!216 = !DILocalVariable(name: "protocol", arg: 3, scope: !208, file: !2, line: 44, type: !154) -!217 = !DILocation(line: 44, column: 54, scope: !208) -!218 = !DILocalVariable(name: "policy", arg: 4, scope: !208, file: !2, line: 44, type: !154) -!219 = !DILocation(line: 44, column: 68, scope: !208) -!220 = !DILocalVariable(name: "prioceiling", arg: 5, scope: !208, file: !2, line: 44, type: !154) -!221 = !DILocation(line: 44, column: 80, scope: !208) -!222 = !DILocalVariable(name: "status", scope: !208, file: !2, line: 46, type: !154) -!223 = !DILocation(line: 46, column: 9, scope: !208) -!224 = !DILocalVariable(name: "value", scope: !208, file: !2, line: 47, type: !154) -!225 = !DILocation(line: 47, column: 9, scope: !208) -!226 = !DILocalVariable(name: "attributes", scope: !208, file: !2, line: 48, type: !227) -!227 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutexattr_t", file: !228, line: 31, baseType: !229) -!228 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h", directory: "") -!229 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutexattr_t", file: !104, line: 114, baseType: !230) -!230 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutexattr_t", file: !104, line: 83, size: 128, elements: !231) -!231 = !{!232, !233} -!232 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !230, file: !104, line: 84, baseType: !108, size: 64) -!233 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !230, file: !104, line: 85, baseType: !44, size: 64, offset: 64) -!234 = !DILocation(line: 48, column: 25, scope: !208) -!235 = !DILocation(line: 49, column: 14, scope: !208) -!236 = !DILocation(line: 49, column: 12, scope: !208) -!237 = !DILocation(line: 50, column: 5, scope: !208) -!238 = !DILocation(line: 52, column: 53, scope: !208) -!239 = !DILocation(line: 52, column: 14, scope: !208) -!240 = !DILocation(line: 52, column: 12, scope: !208) -!241 = !DILocation(line: 53, column: 5, scope: !208) -!242 = !DILocation(line: 54, column: 14, scope: !208) -!243 = !DILocation(line: 54, column: 12, scope: !208) -!244 = !DILocation(line: 55, column: 5, scope: !208) -!245 = !DILocation(line: 57, column: 57, scope: !208) -!246 = !DILocation(line: 57, column: 14, scope: !208) -!247 = !DILocation(line: 57, column: 12, scope: !208) -!248 = !DILocation(line: 58, column: 5, scope: !208) -!249 = !DILocation(line: 59, column: 14, scope: !208) -!250 = !DILocation(line: 59, column: 12, scope: !208) -!251 = !DILocation(line: 60, column: 5, scope: !208) -!252 = !DILocation(line: 62, column: 58, scope: !208) -!253 = !DILocation(line: 62, column: 14, scope: !208) -!254 = !DILocation(line: 62, column: 12, scope: !208) -!255 = !DILocation(line: 63, column: 5, scope: !208) -!256 = !DILocation(line: 64, column: 14, scope: !208) -!257 = !DILocation(line: 64, column: 12, scope: !208) -!258 = !DILocation(line: 65, column: 5, scope: !208) -!259 = !DILocation(line: 67, column: 60, scope: !208) -!260 = !DILocation(line: 67, column: 14, scope: !208) -!261 = !DILocation(line: 67, column: 12, scope: !208) -!262 = !DILocation(line: 68, column: 5, scope: !208) -!263 = !DILocation(line: 69, column: 14, scope: !208) -!264 = !DILocation(line: 69, column: 12, scope: !208) -!265 = !DILocation(line: 70, column: 5, scope: !208) -!266 = !DILocation(line: 72, column: 33, scope: !208) -!267 = !DILocation(line: 72, column: 14, scope: !208) -!268 = !DILocation(line: 72, column: 12, scope: !208) -!269 = !DILocation(line: 73, column: 5, scope: !208) -!270 = !DILocation(line: 74, column: 14, scope: !208) -!271 = !DILocation(line: 74, column: 12, scope: !208) -!272 = !DILocation(line: 75, column: 5, scope: !208) -!273 = !DILocation(line: 76, column: 1, scope: !208) -!274 = distinct !DISubprogram(name: "mutex_destroy", scope: !2, file: !2, line: 78, type: !275, scopeLine: 79, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!275 = !DISubroutineType(types: !276) -!276 = !{null, !211} -!277 = !DILocalVariable(name: "lock", arg: 1, scope: !274, file: !2, line: 78, type: !211) -!278 = !DILocation(line: 78, column: 37, scope: !274) -!279 = !DILocalVariable(name: "status", scope: !274, file: !2, line: 80, type: !154) -!280 = !DILocation(line: 80, column: 9, scope: !274) -!281 = !DILocation(line: 80, column: 40, scope: !274) -!282 = !DILocation(line: 80, column: 18, scope: !274) -!283 = !DILocation(line: 81, column: 5, scope: !274) -!284 = !DILocation(line: 82, column: 1, scope: !274) -!285 = distinct !DISubprogram(name: "mutex_lock", scope: !2, file: !2, line: 84, type: !275, scopeLine: 85, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!286 = !DILocalVariable(name: "lock", arg: 1, scope: !285, file: !2, line: 84, type: !211) -!287 = !DILocation(line: 84, column: 34, scope: !285) -!288 = !DILocalVariable(name: "status", scope: !285, file: !2, line: 86, type: !154) -!289 = !DILocation(line: 86, column: 9, scope: !285) -!290 = !DILocation(line: 86, column: 37, scope: !285) -!291 = !DILocation(line: 86, column: 18, scope: !285) -!292 = !DILocation(line: 87, column: 5, scope: !285) -!293 = !DILocation(line: 88, column: 1, scope: !285) -!294 = distinct !DISubprogram(name: "mutex_trylock", scope: !2, file: !2, line: 90, type: !295, scopeLine: 91, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!295 = !DISubroutineType(types: !296) -!296 = !{!297, !211} -!297 = !DIBasicType(name: "_Bool", size: 8, encoding: DW_ATE_boolean) -!298 = !DILocalVariable(name: "lock", arg: 1, scope: !294, file: !2, line: 90, type: !211) -!299 = !DILocation(line: 90, column: 37, scope: !294) -!300 = !DILocalVariable(name: "status", scope: !294, file: !2, line: 92, type: !154) -!301 = !DILocation(line: 92, column: 9, scope: !294) -!302 = !DILocation(line: 92, column: 40, scope: !294) -!303 = !DILocation(line: 92, column: 18, scope: !294) -!304 = !DILocation(line: 94, column: 12, scope: !294) -!305 = !DILocation(line: 94, column: 19, scope: !294) -!306 = !DILocation(line: 94, column: 5, scope: !294) -!307 = distinct !DISubprogram(name: "mutex_unlock", scope: !2, file: !2, line: 97, type: !275, scopeLine: 98, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!308 = !DILocalVariable(name: "lock", arg: 1, scope: !307, file: !2, line: 97, type: !211) -!309 = !DILocation(line: 97, column: 36, scope: !307) -!310 = !DILocalVariable(name: "status", scope: !307, file: !2, line: 99, type: !154) -!311 = !DILocation(line: 99, column: 9, scope: !307) -!312 = !DILocation(line: 99, column: 39, scope: !307) -!313 = !DILocation(line: 99, column: 18, scope: !307) -!314 = !DILocation(line: 100, column: 5, scope: !307) -!315 = !DILocation(line: 101, column: 1, scope: !307) -!316 = distinct !DISubprogram(name: "mutex_test", scope: !2, file: !2, line: 103, type: !317, scopeLine: 104, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!317 = !DISubroutineType(types: !318) -!318 = !{null} -!319 = !DILocalVariable(name: "mutex0", scope: !316, file: !2, line: 105, type: !101) -!320 = !DILocation(line: 105, column: 21, scope: !316) -!321 = !DILocalVariable(name: "mutex1", scope: !316, file: !2, line: 106, type: !101) -!322 = !DILocation(line: 106, column: 21, scope: !316) -!323 = !DILocation(line: 108, column: 5, scope: !316) -!324 = !DILocation(line: 109, column: 5, scope: !316) -!325 = !DILocation(line: 112, column: 9, scope: !326) -!326 = distinct !DILexicalBlock(scope: !316, file: !2, line: 111, column: 5) -!327 = !DILocalVariable(name: "success", scope: !326, file: !2, line: 113, type: !297) -!328 = !DILocation(line: 113, column: 14, scope: !326) -!329 = !DILocation(line: 113, column: 24, scope: !326) -!330 = !DILocation(line: 114, column: 9, scope: !326) -!331 = !DILocation(line: 115, column: 9, scope: !326) -!332 = !DILocation(line: 119, column: 9, scope: !333) -!333 = distinct !DILexicalBlock(scope: !316, file: !2, line: 118, column: 5) -!334 = !DILocalVariable(name: "success", scope: !335, file: !2, line: 122, type: !297) -!335 = distinct !DILexicalBlock(scope: !333, file: !2, line: 121, column: 9) -!336 = !DILocation(line: 122, column: 18, scope: !335) -!337 = !DILocation(line: 122, column: 28, scope: !335) -!338 = !DILocation(line: 123, column: 13, scope: !335) -!339 = !DILocation(line: 124, column: 13, scope: !335) -!340 = !DILocalVariable(name: "success", scope: !341, file: !2, line: 128, type: !297) -!341 = distinct !DILexicalBlock(scope: !333, file: !2, line: 127, column: 9) -!342 = !DILocation(line: 128, column: 18, scope: !341) -!343 = !DILocation(line: 128, column: 28, scope: !341) -!344 = !DILocation(line: 129, column: 13, scope: !341) -!345 = !DILocation(line: 130, column: 13, scope: !341) -!346 = !DILocation(line: 140, column: 9, scope: !333) -!347 = !DILocation(line: 143, column: 5, scope: !316) -!348 = !DILocation(line: 144, column: 5, scope: !316) -!349 = !DILocation(line: 145, column: 1, scope: !316) -!350 = distinct !DISubprogram(name: "cond_init", scope: !2, file: !2, line: 149, type: !351, scopeLine: 150, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!351 = !DISubroutineType(types: !352) -!352 = !{null, !353} -!353 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !115, size: 64) -!354 = !DILocalVariable(name: "cond", arg: 1, scope: !350, file: !2, line: 149, type: !353) -!355 = !DILocation(line: 149, column: 32, scope: !350) -!356 = !DILocalVariable(name: "status", scope: !350, file: !2, line: 151, type: !154) -!357 = !DILocation(line: 151, column: 9, scope: !350) -!358 = !DILocalVariable(name: "attr", scope: !350, file: !2, line: 152, type: !359) -!359 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_condattr_t", file: !360, line: 31, baseType: !361) -!360 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h", directory: "") -!361 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_condattr_t", file: !104, line: 111, baseType: !362) -!362 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_condattr_t", file: !104, line: 73, size: 128, elements: !363) -!363 = !{!364, !365} -!364 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !362, file: !104, line: 74, baseType: !108, size: 64) -!365 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !362, file: !104, line: 75, baseType: !44, size: 64, offset: 64) -!366 = !DILocation(line: 152, column: 24, scope: !350) -!367 = !DILocation(line: 154, column: 14, scope: !350) -!368 = !DILocation(line: 154, column: 12, scope: !350) -!369 = !DILocation(line: 155, column: 5, scope: !350) -!370 = !DILocation(line: 157, column: 32, scope: !350) -!371 = !DILocation(line: 157, column: 14, scope: !350) -!372 = !DILocation(line: 157, column: 12, scope: !350) -!373 = !DILocation(line: 158, column: 5, scope: !350) -!374 = !DILocation(line: 160, column: 14, scope: !350) -!375 = !DILocation(line: 160, column: 12, scope: !350) -!376 = !DILocation(line: 161, column: 5, scope: !350) -!377 = !DILocation(line: 162, column: 1, scope: !350) -!378 = distinct !DISubprogram(name: "cond_destroy", scope: !2, file: !2, line: 164, type: !351, scopeLine: 165, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!379 = !DILocalVariable(name: "cond", arg: 1, scope: !378, file: !2, line: 164, type: !353) -!380 = !DILocation(line: 164, column: 35, scope: !378) -!381 = !DILocalVariable(name: "status", scope: !378, file: !2, line: 166, type: !154) -!382 = !DILocation(line: 166, column: 9, scope: !378) -!383 = !DILocation(line: 166, column: 39, scope: !378) -!384 = !DILocation(line: 166, column: 18, scope: !378) -!385 = !DILocation(line: 167, column: 5, scope: !378) -!386 = !DILocation(line: 168, column: 1, scope: !378) -!387 = distinct !DISubprogram(name: "cond_signal", scope: !2, file: !2, line: 170, type: !351, scopeLine: 171, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!388 = !DILocalVariable(name: "cond", arg: 1, scope: !387, file: !2, line: 170, type: !353) -!389 = !DILocation(line: 170, column: 34, scope: !387) -!390 = !DILocalVariable(name: "status", scope: !387, file: !2, line: 172, type: !154) -!391 = !DILocation(line: 172, column: 9, scope: !387) -!392 = !DILocation(line: 172, column: 38, scope: !387) -!393 = !DILocation(line: 172, column: 18, scope: !387) -!394 = !DILocation(line: 173, column: 5, scope: !387) -!395 = !DILocation(line: 174, column: 1, scope: !387) -!396 = distinct !DISubprogram(name: "cond_broadcast", scope: !2, file: !2, line: 176, type: !351, scopeLine: 177, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!397 = !DILocalVariable(name: "cond", arg: 1, scope: !396, file: !2, line: 176, type: !353) -!398 = !DILocation(line: 176, column: 37, scope: !396) -!399 = !DILocalVariable(name: "status", scope: !396, file: !2, line: 178, type: !154) -!400 = !DILocation(line: 178, column: 9, scope: !396) -!401 = !DILocation(line: 178, column: 41, scope: !396) -!402 = !DILocation(line: 178, column: 18, scope: !396) -!403 = !DILocation(line: 179, column: 5, scope: !396) -!404 = !DILocation(line: 180, column: 1, scope: !396) -!405 = distinct !DISubprogram(name: "cond_wait", scope: !2, file: !2, line: 182, type: !406, scopeLine: 183, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!406 = !DISubroutineType(types: !407) -!407 = !{null, !353, !211} -!408 = !DILocalVariable(name: "cond", arg: 1, scope: !405, file: !2, line: 182, type: !353) -!409 = !DILocation(line: 182, column: 32, scope: !405) -!410 = !DILocalVariable(name: "lock", arg: 2, scope: !405, file: !2, line: 182, type: !211) -!411 = !DILocation(line: 182, column: 55, scope: !405) -!412 = !DILocalVariable(name: "status", scope: !405, file: !2, line: 184, type: !154) -!413 = !DILocation(line: 184, column: 9, scope: !405) -!414 = !DILocation(line: 184, column: 36, scope: !405) -!415 = !DILocation(line: 184, column: 42, scope: !405) -!416 = !DILocation(line: 184, column: 18, scope: !405) -!417 = !DILocation(line: 186, column: 1, scope: !405) -!418 = distinct !DISubprogram(name: "cond_timedwait", scope: !2, file: !2, line: 188, type: !419, scopeLine: 189, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!419 = !DISubroutineType(types: !420) -!420 = !{null, !353, !211, !421} -!421 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed) -!422 = !DILocalVariable(name: "cond", arg: 1, scope: !418, file: !2, line: 188, type: !353) -!423 = !DILocation(line: 188, column: 37, scope: !418) -!424 = !DILocalVariable(name: "lock", arg: 2, scope: !418, file: !2, line: 188, type: !211) -!425 = !DILocation(line: 188, column: 60, scope: !418) -!426 = !DILocalVariable(name: "millis", arg: 3, scope: !418, file: !2, line: 188, type: !421) -!427 = !DILocation(line: 188, column: 76, scope: !418) -!428 = !DILocalVariable(name: "ts", scope: !418, file: !2, line: 191, type: !429) -!429 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "timespec", file: !430, line: 33, size: 128, elements: !431) -!430 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_timespec.h", directory: "") -!431 = !{!432, !435} -!432 = !DIDerivedType(tag: DW_TAG_member, name: "tv_sec", scope: !429, file: !430, line: 35, baseType: !433, size: 64) -!433 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_time_t", file: !434, line: 98, baseType: !108) -!434 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/arm/_types.h", directory: "") -!435 = !DIDerivedType(tag: DW_TAG_member, name: "tv_nsec", scope: !429, file: !430, line: 36, baseType: !108, size: 64, offset: 64) -!436 = !DILocation(line: 191, column: 21, scope: !418) -!437 = !DILocation(line: 195, column: 11, scope: !418) -!438 = !DILocalVariable(name: "status", scope: !418, file: !2, line: 196, type: !154) -!439 = !DILocation(line: 196, column: 9, scope: !418) -!440 = !DILocation(line: 196, column: 41, scope: !418) -!441 = !DILocation(line: 196, column: 47, scope: !418) -!442 = !DILocation(line: 196, column: 18, scope: !418) -!443 = !DILocation(line: 197, column: 1, scope: !418) -!444 = distinct !DISubprogram(name: "cond_worker", scope: !2, file: !2, line: 203, type: !166, scopeLine: 204, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!445 = !DILocalVariable(name: "message", arg: 1, scope: !444, file: !2, line: 203, type: !63) -!446 = !DILocation(line: 203, column: 25, scope: !444) -!447 = !DILocalVariable(name: "idle", scope: !448, file: !2, line: 205, type: !297) -!448 = distinct !DILexicalBlock(scope: !444, file: !2, line: 205, column: 5) -!449 = !DILocation(line: 205, column: 15, scope: !448) -!450 = !DILocation(line: 205, column: 10, scope: !448) -!451 = !DILocation(line: 205, column: 28, scope: !452) -!452 = distinct !DILexicalBlock(scope: !448, file: !2, line: 205, column: 5) -!453 = !DILocation(line: 205, column: 5, scope: !448) -!454 = !DILocation(line: 207, column: 9, scope: !455) -!455 = distinct !DILexicalBlock(scope: !452, file: !2, line: 206, column: 5) -!456 = !DILocation(line: 208, column: 9, scope: !455) -!457 = !DILocation(line: 209, column: 16, scope: !455) -!458 = !DILocation(line: 209, column: 22, scope: !455) -!459 = !DILocation(line: 209, column: 14, scope: !455) -!460 = !DILocation(line: 210, column: 9, scope: !455) -!461 = !DILocation(line: 205, column: 5, scope: !452) -!462 = distinct !{!462, !453, !463, !464} -!463 = !DILocation(line: 211, column: 5, scope: !448) -!464 = !{!"llvm.loop.mustprogress"} -!465 = !DILocalVariable(name: "idle", scope: !466, file: !2, line: 212, type: !297) -!466 = distinct !DILexicalBlock(scope: !444, file: !2, line: 212, column: 5) -!467 = !DILocation(line: 212, column: 15, scope: !466) -!468 = !DILocation(line: 212, column: 10, scope: !466) -!469 = !DILocation(line: 212, column: 28, scope: !470) -!470 = distinct !DILexicalBlock(scope: !466, file: !2, line: 212, column: 5) -!471 = !DILocation(line: 212, column: 5, scope: !466) -!472 = !DILocation(line: 214, column: 9, scope: !473) -!473 = distinct !DILexicalBlock(scope: !470, file: !2, line: 213, column: 5) -!474 = !DILocation(line: 215, column: 9, scope: !473) -!475 = !DILocation(line: 216, column: 16, scope: !473) -!476 = !DILocation(line: 216, column: 22, scope: !473) -!477 = !DILocation(line: 216, column: 14, scope: !473) -!478 = !DILocation(line: 217, column: 9, scope: !473) -!479 = !DILocation(line: 212, column: 5, scope: !470) -!480 = distinct !{!480, !471, !481, !464} -!481 = !DILocation(line: 218, column: 5, scope: !466) -!482 = !DILocation(line: 219, column: 12, scope: !444) -!483 = !DILocation(line: 219, column: 5, scope: !444) -!484 = distinct !DISubprogram(name: "cond_test", scope: !2, file: !2, line: 222, type: !317, scopeLine: 223, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!485 = !DILocalVariable(name: "message", scope: !484, file: !2, line: 224, type: !63) -!486 = !DILocation(line: 224, column: 11, scope: !484) -!487 = !DILocation(line: 225, column: 5, scope: !484) -!488 = !DILocation(line: 226, column: 5, scope: !484) -!489 = !DILocalVariable(name: "worker", scope: !484, file: !2, line: 228, type: !127) -!490 = !DILocation(line: 228, column: 15, scope: !484) -!491 = !DILocation(line: 228, column: 51, scope: !484) -!492 = !DILocation(line: 228, column: 24, scope: !484) -!493 = !DILocation(line: 231, column: 9, scope: !494) -!494 = distinct !DILexicalBlock(scope: !484, file: !2, line: 230, column: 5) -!495 = !DILocation(line: 232, column: 9, scope: !494) -!496 = !DILocation(line: 233, column: 9, scope: !494) -!497 = !DILocation(line: 234, column: 9, scope: !494) -!498 = !DILocation(line: 238, column: 9, scope: !499) -!499 = distinct !DILexicalBlock(scope: !484, file: !2, line: 237, column: 5) -!500 = !DILocation(line: 239, column: 9, scope: !499) -!501 = !DILocation(line: 240, column: 9, scope: !499) -!502 = !DILocation(line: 241, column: 9, scope: !499) -!503 = !DILocalVariable(name: "result", scope: !484, file: !2, line: 244, type: !63) -!504 = !DILocation(line: 244, column: 11, scope: !484) -!505 = !DILocation(line: 244, column: 32, scope: !484) -!506 = !DILocation(line: 244, column: 20, scope: !484) -!507 = !DILocation(line: 245, column: 5, scope: !484) -!508 = !DILocation(line: 247, column: 5, scope: !484) -!509 = !DILocation(line: 248, column: 5, scope: !484) -!510 = !DILocation(line: 249, column: 1, scope: !484) -!511 = distinct !DISubprogram(name: "rwlock_init", scope: !2, file: !2, line: 256, type: !512, scopeLine: 257, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!60 = distinct !DIGlobalVariable(name: "phase", scope: !61, file: !2, line: 200, type: !155, isLocal: false, isDefinition: true) +!61 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "Homebrew clang version 15.0.7", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !62, globals: !65, splitDebugInlining: false, nameTableKind: None, sysroot: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk", sdk: "MacOSX13.sdk") +!62 = !{!63, !64} +!63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64) +!64 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +!65 = !{!0, !8, !13, !18, !21, !26, !28, !30, !35, !37, !42, !47, !50, !52, !54, !59, !66, !68, !73, !75, !77, !79, !81, !83, !85, !87, !92, !95, !100, !114, !126, !149} +!66 = !DIGlobalVariableExpression(var: !67, expr: !DIExpression()) +!67 = distinct !DIGlobalVariable(scope: null, file: !2, line: 252, type: !49, isLocal: true, isDefinition: true) +!68 = !DIGlobalVariableExpression(var: !69, expr: !DIExpression()) +!69 = distinct !DIGlobalVariable(scope: null, file: !2, line: 252, type: !70, isLocal: true, isDefinition: true) +!70 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 144, elements: !71) +!71 = !{!72} +!72 = !DISubrange(count: 18) +!73 = !DIGlobalVariableExpression(var: !74, expr: !DIExpression()) +!74 = distinct !DIGlobalVariable(scope: null, file: !2, line: 269, type: !20, isLocal: true, isDefinition: true) +!75 = !DIGlobalVariableExpression(var: !76, expr: !DIExpression()) +!76 = distinct !DIGlobalVariable(scope: null, file: !2, line: 285, type: !56, isLocal: true, isDefinition: true) +!77 = !DIGlobalVariableExpression(var: !78, expr: !DIExpression()) +!78 = distinct !DIGlobalVariable(scope: null, file: !2, line: 291, type: !3, isLocal: true, isDefinition: true) +!79 = !DIGlobalVariableExpression(var: !80, expr: !DIExpression()) +!80 = distinct !DIGlobalVariable(scope: null, file: !2, line: 304, type: !3, isLocal: true, isDefinition: true) +!81 = !DIGlobalVariableExpression(var: !82, expr: !DIExpression()) +!82 = distinct !DIGlobalVariable(scope: null, file: !2, line: 317, type: !3, isLocal: true, isDefinition: true) +!83 = !DIGlobalVariableExpression(var: !84, expr: !DIExpression()) +!84 = distinct !DIGlobalVariable(scope: null, file: !2, line: 329, type: !20, isLocal: true, isDefinition: true) +!85 = !DIGlobalVariableExpression(var: !86, expr: !DIExpression()) +!86 = distinct !DIGlobalVariable(scope: null, file: !2, line: 378, type: !23, isLocal: true, isDefinition: true) +!87 = !DIGlobalVariableExpression(var: !88, expr: !DIExpression()) +!88 = distinct !DIGlobalVariable(scope: null, file: !2, line: 381, type: !89, isLocal: true, isDefinition: true) +!89 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 224, elements: !90) +!90 = !{!91} +!91 = !DISubrange(count: 28) +!92 = !DIGlobalVariableExpression(var: !93, expr: !DIExpression()) +!93 = distinct !DIGlobalVariable(scope: null, file: !2, line: 397, type: !94, isLocal: true, isDefinition: true) +!94 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 72, elements: !40) +!95 = !DIGlobalVariableExpression(var: !96, expr: !DIExpression()) +!96 = distinct !DIGlobalVariable(scope: null, file: !2, line: 411, type: !97, isLocal: true, isDefinition: true) +!97 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 296, elements: !98) +!98 = !{!99} +!99 = !DISubrange(count: 37) +!100 = !DIGlobalVariableExpression(var: !101, expr: !DIExpression()) +!101 = distinct !DIGlobalVariable(name: "cond_mutex", scope: !61, file: !2, line: 198, type: !102, isLocal: false, isDefinition: true) +!102 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutex_t", file: !103, line: 31, baseType: !104) +!103 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h", directory: "") +!104 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutex_t", file: !105, line: 113, baseType: !106) +!105 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_types.h", directory: "") +!106 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutex_t", file: !105, line: 78, size: 512, elements: !107) +!107 = !{!108, !110} +!108 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !106, file: !105, line: 79, baseType: !109, size: 64) +!109 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed) +!110 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !106, file: !105, line: 80, baseType: !111, size: 448, offset: 64) +!111 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 448, elements: !112) +!112 = !{!113} +!113 = !DISubrange(count: 56) +!114 = !DIGlobalVariableExpression(var: !115, expr: !DIExpression()) +!115 = distinct !DIGlobalVariable(name: "cond", scope: !61, file: !2, line: 199, type: !116, isLocal: false, isDefinition: true) +!116 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_cond_t", file: !117, line: 31, baseType: !118) +!117 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_cond_t.h", directory: "") +!118 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_cond_t", file: !105, line: 110, baseType: !119) +!119 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_cond_t", file: !105, line: 68, size: 384, elements: !120) +!120 = !{!121, !122} +!121 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !119, file: !105, line: 69, baseType: !109, size: 64) +!122 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !119, file: !105, line: 70, baseType: !123, size: 320, offset: 64) +!123 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 320, elements: !124) +!124 = !{!125} +!125 = !DISubrange(count: 40) +!126 = !DIGlobalVariableExpression(var: !127, expr: !DIExpression()) +!127 = distinct !DIGlobalVariable(name: "latest_thread", scope: !61, file: !2, line: 365, type: !128, isLocal: false, isDefinition: true) +!128 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_t", file: !129, line: 31, baseType: !130) +!129 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_t.h", directory: "") +!130 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_t", file: !105, line: 118, baseType: !131) +!131 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !132, size: 64) +!132 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_t", file: !105, line: 103, size: 65536, elements: !133) +!133 = !{!134, !135, !145} +!134 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !132, file: !105, line: 104, baseType: !109, size: 64) +!135 = !DIDerivedType(tag: DW_TAG_member, name: "__cleanup_stack", scope: !132, file: !105, line: 105, baseType: !136, size: 64, offset: 64) +!136 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !137, size: 64) +!137 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__darwin_pthread_handler_rec", file: !105, line: 57, size: 192, elements: !138) +!138 = !{!139, !143, !144} +!139 = !DIDerivedType(tag: DW_TAG_member, name: "__routine", scope: !137, file: !105, line: 58, baseType: !140, size: 64) +!140 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !141, size: 64) +!141 = !DISubroutineType(types: !142) +!142 = !{null, !64} +!143 = !DIDerivedType(tag: DW_TAG_member, name: "__arg", scope: !137, file: !105, line: 59, baseType: !64, size: 64, offset: 64) +!144 = !DIDerivedType(tag: DW_TAG_member, name: "__next", scope: !137, file: !105, line: 60, baseType: !136, size: 64, offset: 128) +!145 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !132, file: !105, line: 106, baseType: !146, size: 65408, offset: 128) +!146 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 65408, elements: !147) +!147 = !{!148} +!148 = !DISubrange(count: 8176) +!149 = !DIGlobalVariableExpression(var: !150, expr: !DIExpression()) +!150 = distinct !DIGlobalVariable(name: "local_data", scope: !61, file: !2, line: 366, type: !151, isLocal: false, isDefinition: true) +!151 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_key_t", file: !152, line: 31, baseType: !153) +!152 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_key_t.h", directory: "") +!153 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_key_t", file: !105, line: 112, baseType: !154) +!154 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned) +!155 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!156 = !{i32 7, !"Dwarf Version", i32 4} +!157 = !{i32 2, !"Debug Info Version", i32 3} +!158 = !{i32 1, !"wchar_size", i32 4} +!159 = !{i32 7, !"PIC Level", i32 2} +!160 = !{i32 7, !"uwtable", i32 2} +!161 = !{i32 7, !"frame-pointer", i32 1} +!162 = !{!"Homebrew clang version 15.0.7"} +!163 = distinct !DISubprogram(name: "thread_create", scope: !2, file: !2, line: 12, type: !164, scopeLine: 13, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!164 = !DISubroutineType(types: !165) +!165 = !{!128, !166, !64} +!166 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !167, size: 64) +!167 = !DISubroutineType(types: !168) +!168 = !{!64, !64} +!169 = !{} +!170 = !DILocalVariable(name: "runner", arg: 1, scope: !163, file: !2, line: 12, type: !166) +!171 = !DILocation(line: 12, column: 32, scope: !163) +!172 = !DILocalVariable(name: "data", arg: 2, scope: !163, file: !2, line: 12, type: !64) +!173 = !DILocation(line: 12, column: 54, scope: !163) +!174 = !DILocalVariable(name: "id", scope: !163, file: !2, line: 14, type: !128) +!175 = !DILocation(line: 14, column: 15, scope: !163) +!176 = !DILocalVariable(name: "attr", scope: !163, file: !2, line: 15, type: !177) +!177 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_attr_t", file: !178, line: 31, baseType: !179) +!178 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_attr_t.h", directory: "") +!179 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_attr_t", file: !105, line: 109, baseType: !180) +!180 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_attr_t", file: !105, line: 63, size: 512, elements: !181) +!181 = !{!182, !183} +!182 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !180, file: !105, line: 64, baseType: !109, size: 64) +!183 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !180, file: !105, line: 65, baseType: !111, size: 448, offset: 64) +!184 = !DILocation(line: 15, column: 20, scope: !163) +!185 = !DILocation(line: 16, column: 5, scope: !163) +!186 = !DILocalVariable(name: "status", scope: !163, file: !2, line: 17, type: !155) +!187 = !DILocation(line: 17, column: 9, scope: !163) +!188 = !DILocation(line: 17, column: 45, scope: !163) +!189 = !DILocation(line: 17, column: 53, scope: !163) +!190 = !DILocation(line: 17, column: 18, scope: !163) +!191 = !DILocation(line: 18, column: 5, scope: !163) +!192 = !DILocation(line: 19, column: 5, scope: !163) +!193 = !DILocation(line: 20, column: 12, scope: !163) +!194 = !DILocation(line: 20, column: 5, scope: !163) +!195 = distinct !DISubprogram(name: "thread_join", scope: !2, file: !2, line: 23, type: !196, scopeLine: 24, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!196 = !DISubroutineType(types: !197) +!197 = !{!64, !128} +!198 = !DILocalVariable(name: "id", arg: 1, scope: !195, file: !2, line: 23, type: !128) +!199 = !DILocation(line: 23, column: 29, scope: !195) +!200 = !DILocalVariable(name: "result", scope: !195, file: !2, line: 25, type: !64) +!201 = !DILocation(line: 25, column: 11, scope: !195) +!202 = !DILocalVariable(name: "status", scope: !195, file: !2, line: 26, type: !155) +!203 = !DILocation(line: 26, column: 9, scope: !195) +!204 = !DILocation(line: 26, column: 31, scope: !195) +!205 = !DILocation(line: 26, column: 18, scope: !195) +!206 = !DILocation(line: 27, column: 5, scope: !195) +!207 = !DILocation(line: 28, column: 12, scope: !195) +!208 = !DILocation(line: 28, column: 5, scope: !195) +!209 = distinct !DISubprogram(name: "mutex_init", scope: !2, file: !2, line: 43, type: !210, scopeLine: 44, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!210 = !DISubroutineType(types: !211) +!211 = !{null, !212, !155, !155, !155, !155} +!212 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !102, size: 64) +!213 = !DILocalVariable(name: "lock", arg: 1, scope: !209, file: !2, line: 43, type: !212) +!214 = !DILocation(line: 43, column: 34, scope: !209) +!215 = !DILocalVariable(name: "type", arg: 2, scope: !209, file: !2, line: 43, type: !155) +!216 = !DILocation(line: 43, column: 44, scope: !209) +!217 = !DILocalVariable(name: "protocol", arg: 3, scope: !209, file: !2, line: 43, type: !155) +!218 = !DILocation(line: 43, column: 54, scope: !209) +!219 = !DILocalVariable(name: "policy", arg: 4, scope: !209, file: !2, line: 43, type: !155) +!220 = !DILocation(line: 43, column: 68, scope: !209) +!221 = !DILocalVariable(name: "prioceiling", arg: 5, scope: !209, file: !2, line: 43, type: !155) +!222 = !DILocation(line: 43, column: 80, scope: !209) +!223 = !DILocalVariable(name: "status", scope: !209, file: !2, line: 45, type: !155) +!224 = !DILocation(line: 45, column: 9, scope: !209) +!225 = !DILocalVariable(name: "value", scope: !209, file: !2, line: 46, type: !155) +!226 = !DILocation(line: 46, column: 9, scope: !209) +!227 = !DILocalVariable(name: "attributes", scope: !209, file: !2, line: 47, type: !228) +!228 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutexattr_t", file: !229, line: 31, baseType: !230) +!229 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h", directory: "") +!230 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutexattr_t", file: !105, line: 114, baseType: !231) +!231 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutexattr_t", file: !105, line: 83, size: 128, elements: !232) +!232 = !{!233, !234} +!233 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !231, file: !105, line: 84, baseType: !109, size: 64) +!234 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !231, file: !105, line: 85, baseType: !44, size: 64, offset: 64) +!235 = !DILocation(line: 47, column: 25, scope: !209) +!236 = !DILocation(line: 48, column: 14, scope: !209) +!237 = !DILocation(line: 48, column: 12, scope: !209) +!238 = !DILocation(line: 49, column: 5, scope: !209) +!239 = !DILocation(line: 51, column: 53, scope: !209) +!240 = !DILocation(line: 51, column: 14, scope: !209) +!241 = !DILocation(line: 51, column: 12, scope: !209) +!242 = !DILocation(line: 52, column: 5, scope: !209) +!243 = !DILocation(line: 53, column: 14, scope: !209) +!244 = !DILocation(line: 53, column: 12, scope: !209) +!245 = !DILocation(line: 54, column: 5, scope: !209) +!246 = !DILocation(line: 56, column: 57, scope: !209) +!247 = !DILocation(line: 56, column: 14, scope: !209) +!248 = !DILocation(line: 56, column: 12, scope: !209) +!249 = !DILocation(line: 57, column: 5, scope: !209) +!250 = !DILocation(line: 58, column: 14, scope: !209) +!251 = !DILocation(line: 58, column: 12, scope: !209) +!252 = !DILocation(line: 59, column: 5, scope: !209) +!253 = !DILocation(line: 61, column: 58, scope: !209) +!254 = !DILocation(line: 61, column: 14, scope: !209) +!255 = !DILocation(line: 61, column: 12, scope: !209) +!256 = !DILocation(line: 62, column: 5, scope: !209) +!257 = !DILocation(line: 63, column: 14, scope: !209) +!258 = !DILocation(line: 63, column: 12, scope: !209) +!259 = !DILocation(line: 64, column: 5, scope: !209) +!260 = !DILocation(line: 66, column: 60, scope: !209) +!261 = !DILocation(line: 66, column: 14, scope: !209) +!262 = !DILocation(line: 66, column: 12, scope: !209) +!263 = !DILocation(line: 67, column: 5, scope: !209) +!264 = !DILocation(line: 68, column: 14, scope: !209) +!265 = !DILocation(line: 68, column: 12, scope: !209) +!266 = !DILocation(line: 69, column: 5, scope: !209) +!267 = !DILocation(line: 71, column: 33, scope: !209) +!268 = !DILocation(line: 71, column: 14, scope: !209) +!269 = !DILocation(line: 71, column: 12, scope: !209) +!270 = !DILocation(line: 72, column: 5, scope: !209) +!271 = !DILocation(line: 73, column: 14, scope: !209) +!272 = !DILocation(line: 73, column: 12, scope: !209) +!273 = !DILocation(line: 74, column: 5, scope: !209) +!274 = !DILocation(line: 75, column: 1, scope: !209) +!275 = distinct !DISubprogram(name: "mutex_destroy", scope: !2, file: !2, line: 77, type: !276, scopeLine: 78, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!276 = !DISubroutineType(types: !277) +!277 = !{null, !212} +!278 = !DILocalVariable(name: "lock", arg: 1, scope: !275, file: !2, line: 77, type: !212) +!279 = !DILocation(line: 77, column: 37, scope: !275) +!280 = !DILocalVariable(name: "status", scope: !275, file: !2, line: 79, type: !155) +!281 = !DILocation(line: 79, column: 9, scope: !275) +!282 = !DILocation(line: 79, column: 40, scope: !275) +!283 = !DILocation(line: 79, column: 18, scope: !275) +!284 = !DILocation(line: 80, column: 5, scope: !275) +!285 = !DILocation(line: 81, column: 1, scope: !275) +!286 = distinct !DISubprogram(name: "mutex_lock", scope: !2, file: !2, line: 83, type: !276, scopeLine: 84, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!287 = !DILocalVariable(name: "lock", arg: 1, scope: !286, file: !2, line: 83, type: !212) +!288 = !DILocation(line: 83, column: 34, scope: !286) +!289 = !DILocalVariable(name: "status", scope: !286, file: !2, line: 85, type: !155) +!290 = !DILocation(line: 85, column: 9, scope: !286) +!291 = !DILocation(line: 85, column: 37, scope: !286) +!292 = !DILocation(line: 85, column: 18, scope: !286) +!293 = !DILocation(line: 86, column: 5, scope: !286) +!294 = !DILocation(line: 87, column: 1, scope: !286) +!295 = distinct !DISubprogram(name: "mutex_trylock", scope: !2, file: !2, line: 89, type: !296, scopeLine: 90, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!296 = !DISubroutineType(types: !297) +!297 = !{!298, !212} +!298 = !DIBasicType(name: "_Bool", size: 8, encoding: DW_ATE_boolean) +!299 = !DILocalVariable(name: "lock", arg: 1, scope: !295, file: !2, line: 89, type: !212) +!300 = !DILocation(line: 89, column: 37, scope: !295) +!301 = !DILocalVariable(name: "status", scope: !295, file: !2, line: 91, type: !155) +!302 = !DILocation(line: 91, column: 9, scope: !295) +!303 = !DILocation(line: 91, column: 40, scope: !295) +!304 = !DILocation(line: 91, column: 18, scope: !295) +!305 = !DILocation(line: 93, column: 12, scope: !295) +!306 = !DILocation(line: 93, column: 19, scope: !295) +!307 = !DILocation(line: 93, column: 5, scope: !295) +!308 = distinct !DISubprogram(name: "mutex_unlock", scope: !2, file: !2, line: 96, type: !276, scopeLine: 97, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!309 = !DILocalVariable(name: "lock", arg: 1, scope: !308, file: !2, line: 96, type: !212) +!310 = !DILocation(line: 96, column: 36, scope: !308) +!311 = !DILocalVariable(name: "status", scope: !308, file: !2, line: 98, type: !155) +!312 = !DILocation(line: 98, column: 9, scope: !308) +!313 = !DILocation(line: 98, column: 39, scope: !308) +!314 = !DILocation(line: 98, column: 18, scope: !308) +!315 = !DILocation(line: 99, column: 5, scope: !308) +!316 = !DILocation(line: 100, column: 1, scope: !308) +!317 = distinct !DISubprogram(name: "mutex_test", scope: !2, file: !2, line: 102, type: !318, scopeLine: 103, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!318 = !DISubroutineType(types: !319) +!319 = !{null} +!320 = !DILocalVariable(name: "mutex0", scope: !317, file: !2, line: 104, type: !102) +!321 = !DILocation(line: 104, column: 21, scope: !317) +!322 = !DILocalVariable(name: "mutex1", scope: !317, file: !2, line: 105, type: !102) +!323 = !DILocation(line: 105, column: 21, scope: !317) +!324 = !DILocation(line: 107, column: 5, scope: !317) +!325 = !DILocation(line: 108, column: 5, scope: !317) +!326 = !DILocation(line: 111, column: 9, scope: !327) +!327 = distinct !DILexicalBlock(scope: !317, file: !2, line: 110, column: 5) +!328 = !DILocalVariable(name: "success", scope: !327, file: !2, line: 112, type: !298) +!329 = !DILocation(line: 112, column: 14, scope: !327) +!330 = !DILocation(line: 112, column: 24, scope: !327) +!331 = !DILocation(line: 113, column: 9, scope: !327) +!332 = !DILocation(line: 114, column: 9, scope: !327) +!333 = !DILocation(line: 118, column: 9, scope: !334) +!334 = distinct !DILexicalBlock(scope: !317, file: !2, line: 117, column: 5) +!335 = !DILocalVariable(name: "success", scope: !336, file: !2, line: 121, type: !298) +!336 = distinct !DILexicalBlock(scope: !334, file: !2, line: 120, column: 9) +!337 = !DILocation(line: 121, column: 18, scope: !336) +!338 = !DILocation(line: 121, column: 28, scope: !336) +!339 = !DILocation(line: 122, column: 13, scope: !336) +!340 = !DILocation(line: 123, column: 13, scope: !336) +!341 = !DILocalVariable(name: "success", scope: !342, file: !2, line: 127, type: !298) +!342 = distinct !DILexicalBlock(scope: !334, file: !2, line: 126, column: 9) +!343 = !DILocation(line: 127, column: 18, scope: !342) +!344 = !DILocation(line: 127, column: 28, scope: !342) +!345 = !DILocation(line: 128, column: 13, scope: !342) +!346 = !DILocation(line: 129, column: 13, scope: !342) +!347 = !DILocation(line: 139, column: 9, scope: !334) +!348 = !DILocation(line: 142, column: 5, scope: !317) +!349 = !DILocation(line: 143, column: 5, scope: !317) +!350 = !DILocation(line: 144, column: 1, scope: !317) +!351 = distinct !DISubprogram(name: "cond_init", scope: !2, file: !2, line: 148, type: !352, scopeLine: 149, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!352 = !DISubroutineType(types: !353) +!353 = !{null, !354} +!354 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !116, size: 64) +!355 = !DILocalVariable(name: "cond", arg: 1, scope: !351, file: !2, line: 148, type: !354) +!356 = !DILocation(line: 148, column: 32, scope: !351) +!357 = !DILocalVariable(name: "status", scope: !351, file: !2, line: 150, type: !155) +!358 = !DILocation(line: 150, column: 9, scope: !351) +!359 = !DILocalVariable(name: "attr", scope: !351, file: !2, line: 151, type: !360) +!360 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_condattr_t", file: !361, line: 31, baseType: !362) +!361 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h", directory: "") +!362 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_condattr_t", file: !105, line: 111, baseType: !363) +!363 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_condattr_t", file: !105, line: 73, size: 128, elements: !364) +!364 = !{!365, !366} +!365 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !363, file: !105, line: 74, baseType: !109, size: 64) +!366 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !363, file: !105, line: 75, baseType: !44, size: 64, offset: 64) +!367 = !DILocation(line: 151, column: 24, scope: !351) +!368 = !DILocation(line: 153, column: 14, scope: !351) +!369 = !DILocation(line: 153, column: 12, scope: !351) +!370 = !DILocation(line: 154, column: 5, scope: !351) +!371 = !DILocation(line: 156, column: 32, scope: !351) +!372 = !DILocation(line: 156, column: 14, scope: !351) +!373 = !DILocation(line: 156, column: 12, scope: !351) +!374 = !DILocation(line: 157, column: 5, scope: !351) +!375 = !DILocation(line: 159, column: 14, scope: !351) +!376 = !DILocation(line: 159, column: 12, scope: !351) +!377 = !DILocation(line: 160, column: 5, scope: !351) +!378 = !DILocation(line: 161, column: 1, scope: !351) +!379 = distinct !DISubprogram(name: "cond_destroy", scope: !2, file: !2, line: 163, type: !352, scopeLine: 164, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!380 = !DILocalVariable(name: "cond", arg: 1, scope: !379, file: !2, line: 163, type: !354) +!381 = !DILocation(line: 163, column: 35, scope: !379) +!382 = !DILocalVariable(name: "status", scope: !379, file: !2, line: 165, type: !155) +!383 = !DILocation(line: 165, column: 9, scope: !379) +!384 = !DILocation(line: 165, column: 39, scope: !379) +!385 = !DILocation(line: 165, column: 18, scope: !379) +!386 = !DILocation(line: 166, column: 5, scope: !379) +!387 = !DILocation(line: 167, column: 1, scope: !379) +!388 = distinct !DISubprogram(name: "cond_signal", scope: !2, file: !2, line: 169, type: !352, scopeLine: 170, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!389 = !DILocalVariable(name: "cond", arg: 1, scope: !388, file: !2, line: 169, type: !354) +!390 = !DILocation(line: 169, column: 34, scope: !388) +!391 = !DILocalVariable(name: "status", scope: !388, file: !2, line: 171, type: !155) +!392 = !DILocation(line: 171, column: 9, scope: !388) +!393 = !DILocation(line: 171, column: 38, scope: !388) +!394 = !DILocation(line: 171, column: 18, scope: !388) +!395 = !DILocation(line: 172, column: 5, scope: !388) +!396 = !DILocation(line: 173, column: 1, scope: !388) +!397 = distinct !DISubprogram(name: "cond_broadcast", scope: !2, file: !2, line: 175, type: !352, scopeLine: 176, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!398 = !DILocalVariable(name: "cond", arg: 1, scope: !397, file: !2, line: 175, type: !354) +!399 = !DILocation(line: 175, column: 37, scope: !397) +!400 = !DILocalVariable(name: "status", scope: !397, file: !2, line: 177, type: !155) +!401 = !DILocation(line: 177, column: 9, scope: !397) +!402 = !DILocation(line: 177, column: 41, scope: !397) +!403 = !DILocation(line: 177, column: 18, scope: !397) +!404 = !DILocation(line: 178, column: 5, scope: !397) +!405 = !DILocation(line: 179, column: 1, scope: !397) +!406 = distinct !DISubprogram(name: "cond_wait", scope: !2, file: !2, line: 181, type: !407, scopeLine: 182, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!407 = !DISubroutineType(types: !408) +!408 = !{null, !354, !212} +!409 = !DILocalVariable(name: "cond", arg: 1, scope: !406, file: !2, line: 181, type: !354) +!410 = !DILocation(line: 181, column: 32, scope: !406) +!411 = !DILocalVariable(name: "lock", arg: 2, scope: !406, file: !2, line: 181, type: !212) +!412 = !DILocation(line: 181, column: 55, scope: !406) +!413 = !DILocalVariable(name: "status", scope: !406, file: !2, line: 183, type: !155) +!414 = !DILocation(line: 183, column: 9, scope: !406) +!415 = !DILocation(line: 183, column: 36, scope: !406) +!416 = !DILocation(line: 183, column: 42, scope: !406) +!417 = !DILocation(line: 183, column: 18, scope: !406) +!418 = !DILocation(line: 185, column: 1, scope: !406) +!419 = distinct !DISubprogram(name: "cond_timedwait", scope: !2, file: !2, line: 187, type: !420, scopeLine: 188, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!420 = !DISubroutineType(types: !421) +!421 = !{null, !354, !212, !422} +!422 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed) +!423 = !DILocalVariable(name: "cond", arg: 1, scope: !419, file: !2, line: 187, type: !354) +!424 = !DILocation(line: 187, column: 37, scope: !419) +!425 = !DILocalVariable(name: "lock", arg: 2, scope: !419, file: !2, line: 187, type: !212) +!426 = !DILocation(line: 187, column: 60, scope: !419) +!427 = !DILocalVariable(name: "millis", arg: 3, scope: !419, file: !2, line: 187, type: !422) +!428 = !DILocation(line: 187, column: 76, scope: !419) +!429 = !DILocalVariable(name: "ts", scope: !419, file: !2, line: 190, type: !430) +!430 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "timespec", file: !431, line: 33, size: 128, elements: !432) +!431 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_timespec.h", directory: "") +!432 = !{!433, !436} +!433 = !DIDerivedType(tag: DW_TAG_member, name: "tv_sec", scope: !430, file: !431, line: 35, baseType: !434, size: 64) +!434 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_time_t", file: !435, line: 98, baseType: !109) +!435 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/arm/_types.h", directory: "") +!436 = !DIDerivedType(tag: DW_TAG_member, name: "tv_nsec", scope: !430, file: !431, line: 36, baseType: !109, size: 64, offset: 64) +!437 = !DILocation(line: 190, column: 21, scope: !419) +!438 = !DILocation(line: 194, column: 11, scope: !419) +!439 = !DILocalVariable(name: "status", scope: !419, file: !2, line: 195, type: !155) +!440 = !DILocation(line: 195, column: 9, scope: !419) +!441 = !DILocation(line: 195, column: 41, scope: !419) +!442 = !DILocation(line: 195, column: 47, scope: !419) +!443 = !DILocation(line: 195, column: 18, scope: !419) +!444 = !DILocation(line: 196, column: 1, scope: !419) +!445 = distinct !DISubprogram(name: "cond_worker", scope: !2, file: !2, line: 202, type: !167, scopeLine: 203, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!446 = !DILocalVariable(name: "message", arg: 1, scope: !445, file: !2, line: 202, type: !64) +!447 = !DILocation(line: 202, column: 25, scope: !445) +!448 = !DILocalVariable(name: "idle", scope: !445, file: !2, line: 204, type: !298) +!449 = !DILocation(line: 204, column: 10, scope: !445) +!450 = !DILocation(line: 206, column: 9, scope: !451) +!451 = distinct !DILexicalBlock(scope: !445, file: !2, line: 205, column: 5) +!452 = !DILocation(line: 207, column: 9, scope: !451) +!453 = !DILocation(line: 208, column: 9, scope: !451) +!454 = !DILocation(line: 209, column: 9, scope: !451) +!455 = !DILocation(line: 210, column: 16, scope: !451) +!456 = !DILocation(line: 210, column: 22, scope: !451) +!457 = !DILocation(line: 210, column: 14, scope: !451) +!458 = !DILocation(line: 211, column: 9, scope: !451) +!459 = !DILocation(line: 213, column: 9, scope: !460) +!460 = distinct !DILexicalBlock(scope: !445, file: !2, line: 213, column: 9) +!461 = !DILocation(line: 213, column: 9, scope: !445) +!462 = !DILocation(line: 214, column: 25, scope: !460) +!463 = !DILocation(line: 214, column: 34, scope: !460) +!464 = !DILocation(line: 214, column: 9, scope: !460) +!465 = !DILocation(line: 215, column: 10, scope: !445) +!466 = !DILocation(line: 217, column: 9, scope: !467) +!467 = distinct !DILexicalBlock(scope: !445, file: !2, line: 216, column: 5) +!468 = !DILocation(line: 218, column: 9, scope: !467) +!469 = !DILocation(line: 219, column: 9, scope: !467) +!470 = !DILocation(line: 220, column: 9, scope: !467) +!471 = !DILocation(line: 221, column: 16, scope: !467) +!472 = !DILocation(line: 221, column: 22, scope: !467) +!473 = !DILocation(line: 221, column: 14, scope: !467) +!474 = !DILocation(line: 222, column: 9, scope: !467) +!475 = !DILocation(line: 224, column: 9, scope: !476) +!476 = distinct !DILexicalBlock(scope: !445, file: !2, line: 224, column: 9) +!477 = !DILocation(line: 224, column: 9, scope: !445) +!478 = !DILocation(line: 225, column: 25, scope: !476) +!479 = !DILocation(line: 225, column: 34, scope: !476) +!480 = !DILocation(line: 225, column: 9, scope: !476) +!481 = !DILocation(line: 226, column: 12, scope: !445) +!482 = !DILocation(line: 226, column: 5, scope: !445) +!483 = !DILocation(line: 227, column: 1, scope: !445) +!484 = distinct !DISubprogram(name: "cond_test", scope: !2, file: !2, line: 229, type: !318, scopeLine: 230, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!485 = !DILocalVariable(name: "message", scope: !484, file: !2, line: 231, type: !64) +!486 = !DILocation(line: 231, column: 11, scope: !484) +!487 = !DILocation(line: 232, column: 5, scope: !484) +!488 = !DILocation(line: 233, column: 5, scope: !484) +!489 = !DILocalVariable(name: "worker", scope: !484, file: !2, line: 235, type: !128) +!490 = !DILocation(line: 235, column: 15, scope: !484) +!491 = !DILocation(line: 235, column: 51, scope: !484) +!492 = !DILocation(line: 235, column: 24, scope: !484) +!493 = !DILocation(line: 238, column: 9, scope: !494) +!494 = distinct !DILexicalBlock(scope: !484, file: !2, line: 237, column: 5) +!495 = !DILocation(line: 239, column: 9, scope: !494) +!496 = !DILocation(line: 240, column: 9, scope: !494) +!497 = !DILocation(line: 241, column: 9, scope: !494) +!498 = !DILocation(line: 245, column: 9, scope: !499) +!499 = distinct !DILexicalBlock(scope: !484, file: !2, line: 244, column: 5) +!500 = !DILocation(line: 246, column: 9, scope: !499) +!501 = !DILocation(line: 247, column: 9, scope: !499) +!502 = !DILocation(line: 248, column: 9, scope: !499) +!503 = !DILocalVariable(name: "result", scope: !484, file: !2, line: 251, type: !64) +!504 = !DILocation(line: 251, column: 11, scope: !484) +!505 = !DILocation(line: 251, column: 32, scope: !484) +!506 = !DILocation(line: 251, column: 20, scope: !484) +!507 = !DILocation(line: 252, column: 5, scope: !484) +!508 = !DILocation(line: 254, column: 5, scope: !484) +!509 = !DILocation(line: 255, column: 5, scope: !484) +!510 = !DILocation(line: 256, column: 1, scope: !484) +!511 = distinct !DISubprogram(name: "rwlock_init", scope: !2, file: !2, line: 263, type: !512, scopeLine: 264, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) !512 = !DISubroutineType(types: !513) -!513 = !{null, !514, !154} +!513 = !{null, !514, !155} !514 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !515, size: 64) !515 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlock_t", file: !516, line: 31, baseType: !517) !516 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h", directory: "") -!517 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlock_t", file: !104, line: 116, baseType: !518) -!518 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlock_t", file: !104, line: 93, size: 1600, elements: !519) +!517 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlock_t", file: !105, line: 116, baseType: !518) +!518 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlock_t", file: !105, line: 93, size: 1600, elements: !519) !519 = !{!520, !521} -!520 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !518, file: !104, line: 94, baseType: !108, size: 64) -!521 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !518, file: !104, line: 95, baseType: !522, size: 1536, offset: 64) +!520 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !518, file: !105, line: 94, baseType: !109, size: 64) +!521 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !518, file: !105, line: 95, baseType: !522, size: 1536, offset: 64) !522 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 1536, elements: !523) !523 = !{!524} !524 = !DISubrange(count: 192) -!525 = !DILocalVariable(name: "lock", arg: 1, scope: !511, file: !2, line: 256, type: !514) -!526 = !DILocation(line: 256, column: 36, scope: !511) -!527 = !DILocalVariable(name: "shared", arg: 2, scope: !511, file: !2, line: 256, type: !154) -!528 = !DILocation(line: 256, column: 46, scope: !511) -!529 = !DILocalVariable(name: "status", scope: !511, file: !2, line: 258, type: !154) -!530 = !DILocation(line: 258, column: 9, scope: !511) -!531 = !DILocalVariable(name: "value", scope: !511, file: !2, line: 259, type: !154) -!532 = !DILocation(line: 259, column: 9, scope: !511) -!533 = !DILocalVariable(name: "attributes", scope: !511, file: !2, line: 260, type: !534) +!525 = !DILocalVariable(name: "lock", arg: 1, scope: !511, file: !2, line: 263, type: !514) +!526 = !DILocation(line: 263, column: 36, scope: !511) +!527 = !DILocalVariable(name: "shared", arg: 2, scope: !511, file: !2, line: 263, type: !155) +!528 = !DILocation(line: 263, column: 46, scope: !511) +!529 = !DILocalVariable(name: "status", scope: !511, file: !2, line: 265, type: !155) +!530 = !DILocation(line: 265, column: 9, scope: !511) +!531 = !DILocalVariable(name: "value", scope: !511, file: !2, line: 266, type: !155) +!532 = !DILocation(line: 266, column: 9, scope: !511) +!533 = !DILocalVariable(name: "attributes", scope: !511, file: !2, line: 267, type: !534) !534 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlockattr_t", file: !535, line: 31, baseType: !536) !535 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h", directory: "") -!536 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlockattr_t", file: !104, line: 117, baseType: !537) -!537 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlockattr_t", file: !104, line: 98, size: 192, elements: !538) +!536 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlockattr_t", file: !105, line: 117, baseType: !537) +!537 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlockattr_t", file: !105, line: 98, size: 192, elements: !538) !538 = !{!539, !540} -!539 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !537, file: !104, line: 99, baseType: !108, size: 64) -!540 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !537, file: !104, line: 100, baseType: !541, size: 128, offset: 64) +!539 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !537, file: !105, line: 99, baseType: !109, size: 64) +!540 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !537, file: !105, line: 100, baseType: !541, size: 128, offset: 64) !541 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 128, elements: !542) !542 = !{!543} !543 = !DISubrange(count: 16) -!544 = !DILocation(line: 260, column: 26, scope: !511) -!545 = !DILocation(line: 261, column: 14, scope: !511) -!546 = !DILocation(line: 261, column: 12, scope: !511) -!547 = !DILocation(line: 262, column: 5, scope: !511) -!548 = !DILocation(line: 264, column: 57, scope: !511) -!549 = !DILocation(line: 264, column: 14, scope: !511) -!550 = !DILocation(line: 264, column: 12, scope: !511) -!551 = !DILocation(line: 265, column: 5, scope: !511) -!552 = !DILocation(line: 266, column: 14, scope: !511) -!553 = !DILocation(line: 266, column: 12, scope: !511) -!554 = !DILocation(line: 267, column: 5, scope: !511) -!555 = !DILocation(line: 269, column: 34, scope: !511) -!556 = !DILocation(line: 269, column: 14, scope: !511) -!557 = !DILocation(line: 269, column: 12, scope: !511) -!558 = !DILocation(line: 270, column: 5, scope: !511) -!559 = !DILocation(line: 271, column: 14, scope: !511) -!560 = !DILocation(line: 271, column: 12, scope: !511) -!561 = !DILocation(line: 272, column: 5, scope: !511) -!562 = !DILocation(line: 273, column: 1, scope: !511) -!563 = distinct !DISubprogram(name: "rwlock_destroy", scope: !2, file: !2, line: 275, type: !564, scopeLine: 276, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!544 = !DILocation(line: 267, column: 26, scope: !511) +!545 = !DILocation(line: 268, column: 14, scope: !511) +!546 = !DILocation(line: 268, column: 12, scope: !511) +!547 = !DILocation(line: 269, column: 5, scope: !511) +!548 = !DILocation(line: 271, column: 57, scope: !511) +!549 = !DILocation(line: 271, column: 14, scope: !511) +!550 = !DILocation(line: 271, column: 12, scope: !511) +!551 = !DILocation(line: 272, column: 5, scope: !511) +!552 = !DILocation(line: 273, column: 14, scope: !511) +!553 = !DILocation(line: 273, column: 12, scope: !511) +!554 = !DILocation(line: 274, column: 5, scope: !511) +!555 = !DILocation(line: 276, column: 34, scope: !511) +!556 = !DILocation(line: 276, column: 14, scope: !511) +!557 = !DILocation(line: 276, column: 12, scope: !511) +!558 = !DILocation(line: 277, column: 5, scope: !511) +!559 = !DILocation(line: 278, column: 14, scope: !511) +!560 = !DILocation(line: 278, column: 12, scope: !511) +!561 = !DILocation(line: 279, column: 5, scope: !511) +!562 = !DILocation(line: 280, column: 1, scope: !511) +!563 = distinct !DISubprogram(name: "rwlock_destroy", scope: !2, file: !2, line: 282, type: !564, scopeLine: 283, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) !564 = !DISubroutineType(types: !565) !565 = !{null, !514} -!566 = !DILocalVariable(name: "lock", arg: 1, scope: !563, file: !2, line: 275, type: !514) -!567 = !DILocation(line: 275, column: 39, scope: !563) -!568 = !DILocalVariable(name: "status", scope: !563, file: !2, line: 277, type: !154) -!569 = !DILocation(line: 277, column: 9, scope: !563) -!570 = !DILocation(line: 277, column: 41, scope: !563) -!571 = !DILocation(line: 277, column: 18, scope: !563) -!572 = !DILocation(line: 278, column: 5, scope: !563) -!573 = !DILocation(line: 279, column: 1, scope: !563) -!574 = distinct !DISubprogram(name: "rwlock_wrlock", scope: !2, file: !2, line: 281, type: !564, scopeLine: 282, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!575 = !DILocalVariable(name: "lock", arg: 1, scope: !574, file: !2, line: 281, type: !514) -!576 = !DILocation(line: 281, column: 38, scope: !574) -!577 = !DILocalVariable(name: "status", scope: !574, file: !2, line: 283, type: !154) -!578 = !DILocation(line: 283, column: 9, scope: !574) -!579 = !DILocation(line: 283, column: 40, scope: !574) -!580 = !DILocation(line: 283, column: 18, scope: !574) -!581 = !DILocation(line: 284, column: 5, scope: !574) -!582 = !DILocation(line: 285, column: 1, scope: !574) -!583 = distinct !DISubprogram(name: "rwlock_trywrlock", scope: !2, file: !2, line: 287, type: !584, scopeLine: 288, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) +!566 = !DILocalVariable(name: "lock", arg: 1, scope: !563, file: !2, line: 282, type: !514) +!567 = !DILocation(line: 282, column: 39, scope: !563) +!568 = !DILocalVariable(name: "status", scope: !563, file: !2, line: 284, type: !155) +!569 = !DILocation(line: 284, column: 9, scope: !563) +!570 = !DILocation(line: 284, column: 41, scope: !563) +!571 = !DILocation(line: 284, column: 18, scope: !563) +!572 = !DILocation(line: 285, column: 5, scope: !563) +!573 = !DILocation(line: 286, column: 1, scope: !563) +!574 = distinct !DISubprogram(name: "rwlock_wrlock", scope: !2, file: !2, line: 288, type: !564, scopeLine: 289, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!575 = !DILocalVariable(name: "lock", arg: 1, scope: !574, file: !2, line: 288, type: !514) +!576 = !DILocation(line: 288, column: 38, scope: !574) +!577 = !DILocalVariable(name: "status", scope: !574, file: !2, line: 290, type: !155) +!578 = !DILocation(line: 290, column: 9, scope: !574) +!579 = !DILocation(line: 290, column: 40, scope: !574) +!580 = !DILocation(line: 290, column: 18, scope: !574) +!581 = !DILocation(line: 291, column: 5, scope: !574) +!582 = !DILocation(line: 292, column: 1, scope: !574) +!583 = distinct !DISubprogram(name: "rwlock_trywrlock", scope: !2, file: !2, line: 294, type: !584, scopeLine: 295, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) !584 = !DISubroutineType(types: !585) -!585 = !{!297, !514} -!586 = !DILocalVariable(name: "lock", arg: 1, scope: !583, file: !2, line: 287, type: !514) -!587 = !DILocation(line: 287, column: 41, scope: !583) -!588 = !DILocalVariable(name: "status", scope: !583, file: !2, line: 289, type: !154) -!589 = !DILocation(line: 289, column: 9, scope: !583) -!590 = !DILocation(line: 289, column: 43, scope: !583) -!591 = !DILocation(line: 289, column: 18, scope: !583) -!592 = !DILocation(line: 291, column: 12, scope: !583) -!593 = !DILocation(line: 291, column: 19, scope: !583) -!594 = !DILocation(line: 291, column: 5, scope: !583) -!595 = distinct !DISubprogram(name: "rwlock_rdlock", scope: !2, file: !2, line: 294, type: !564, scopeLine: 295, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!596 = !DILocalVariable(name: "lock", arg: 1, scope: !595, file: !2, line: 294, type: !514) -!597 = !DILocation(line: 294, column: 38, scope: !595) -!598 = !DILocalVariable(name: "status", scope: !595, file: !2, line: 296, type: !154) -!599 = !DILocation(line: 296, column: 9, scope: !595) -!600 = !DILocation(line: 296, column: 40, scope: !595) -!601 = !DILocation(line: 296, column: 18, scope: !595) -!602 = !DILocation(line: 297, column: 5, scope: !595) -!603 = !DILocation(line: 298, column: 1, scope: !595) -!604 = distinct !DISubprogram(name: "rwlock_tryrdlock", scope: !2, file: !2, line: 300, type: !584, scopeLine: 301, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!605 = !DILocalVariable(name: "lock", arg: 1, scope: !604, file: !2, line: 300, type: !514) -!606 = !DILocation(line: 300, column: 41, scope: !604) -!607 = !DILocalVariable(name: "status", scope: !604, file: !2, line: 302, type: !154) -!608 = !DILocation(line: 302, column: 9, scope: !604) -!609 = !DILocation(line: 302, column: 43, scope: !604) -!610 = !DILocation(line: 302, column: 18, scope: !604) -!611 = !DILocation(line: 304, column: 12, scope: !604) -!612 = !DILocation(line: 304, column: 19, scope: !604) -!613 = !DILocation(line: 304, column: 5, scope: !604) -!614 = distinct !DISubprogram(name: "rwlock_unlock", scope: !2, file: !2, line: 307, type: !564, scopeLine: 308, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!615 = !DILocalVariable(name: "lock", arg: 1, scope: !614, file: !2, line: 307, type: !514) -!616 = !DILocation(line: 307, column: 38, scope: !614) -!617 = !DILocalVariable(name: "status", scope: !614, file: !2, line: 309, type: !154) -!618 = !DILocation(line: 309, column: 9, scope: !614) -!619 = !DILocation(line: 309, column: 40, scope: !614) -!620 = !DILocation(line: 309, column: 18, scope: !614) -!621 = !DILocation(line: 310, column: 5, scope: !614) -!622 = !DILocation(line: 311, column: 1, scope: !614) -!623 = distinct !DISubprogram(name: "rwlock_test", scope: !2, file: !2, line: 313, type: !317, scopeLine: 314, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!624 = !DILocalVariable(name: "lock", scope: !623, file: !2, line: 315, type: !515) -!625 = !DILocation(line: 315, column: 22, scope: !623) -!626 = !DILocation(line: 316, column: 5, scope: !623) -!627 = !DILocalVariable(name: "test_depth", scope: !623, file: !2, line: 317, type: !628) -!628 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !154) -!629 = !DILocation(line: 317, column: 15, scope: !623) -!630 = !DILocation(line: 320, column: 9, scope: !631) -!631 = distinct !DILexicalBlock(scope: !623, file: !2, line: 319, column: 5) -!632 = !DILocalVariable(name: "success", scope: !631, file: !2, line: 321, type: !297) -!633 = !DILocation(line: 321, column: 14, scope: !631) -!634 = !DILocation(line: 321, column: 24, scope: !631) -!635 = !DILocation(line: 322, column: 9, scope: !631) -!636 = !DILocation(line: 323, column: 19, scope: !631) -!637 = !DILocation(line: 323, column: 17, scope: !631) -!638 = !DILocation(line: 324, column: 9, scope: !631) -!639 = !DILocation(line: 325, column: 9, scope: !631) -!640 = !DILocation(line: 329, column: 9, scope: !641) -!641 = distinct !DILexicalBlock(scope: !623, file: !2, line: 328, column: 5) -!642 = !DILocalVariable(name: "i", scope: !643, file: !2, line: 330, type: !154) -!643 = distinct !DILexicalBlock(scope: !641, file: !2, line: 330, column: 9) -!644 = !DILocation(line: 330, column: 18, scope: !643) -!645 = !DILocation(line: 330, column: 14, scope: !643) -!646 = !DILocation(line: 330, column: 25, scope: !647) -!647 = distinct !DILexicalBlock(scope: !643, file: !2, line: 330, column: 9) -!648 = !DILocation(line: 330, column: 27, scope: !647) -!649 = !DILocation(line: 330, column: 9, scope: !643) -!650 = !DILocalVariable(name: "success", scope: !651, file: !2, line: 332, type: !297) -!651 = distinct !DILexicalBlock(scope: !647, file: !2, line: 331, column: 9) -!652 = !DILocation(line: 332, column: 18, scope: !651) -!653 = !DILocation(line: 332, column: 28, scope: !651) -!654 = !DILocation(line: 333, column: 13, scope: !651) -!655 = !DILocation(line: 334, column: 9, scope: !651) -!656 = !DILocation(line: 330, column: 42, scope: !647) -!657 = !DILocation(line: 330, column: 9, scope: !647) -!658 = distinct !{!658, !649, !659, !464} -!659 = !DILocation(line: 334, column: 9, scope: !643) -!660 = !DILocalVariable(name: "success", scope: !661, file: !2, line: 337, type: !297) -!661 = distinct !DILexicalBlock(scope: !641, file: !2, line: 336, column: 9) -!662 = !DILocation(line: 337, column: 18, scope: !661) -!663 = !DILocation(line: 337, column: 28, scope: !661) -!664 = !DILocation(line: 338, column: 13, scope: !661) -!665 = !DILocation(line: 341, column: 9, scope: !641) -!666 = !DILocalVariable(name: "i", scope: !667, file: !2, line: 342, type: !154) -!667 = distinct !DILexicalBlock(scope: !641, file: !2, line: 342, column: 9) -!668 = !DILocation(line: 342, column: 18, scope: !667) -!669 = !DILocation(line: 342, column: 14, scope: !667) -!670 = !DILocation(line: 342, column: 25, scope: !671) -!671 = distinct !DILexicalBlock(scope: !667, file: !2, line: 342, column: 9) -!672 = !DILocation(line: 342, column: 27, scope: !671) -!673 = !DILocation(line: 342, column: 9, scope: !667) -!674 = !DILocation(line: 343, column: 13, scope: !675) -!675 = distinct !DILexicalBlock(scope: !671, file: !2, line: 342, column: 46) -!676 = !DILocation(line: 344, column: 9, scope: !675) -!677 = !DILocation(line: 342, column: 42, scope: !671) -!678 = !DILocation(line: 342, column: 9, scope: !671) -!679 = distinct !{!679, !673, !680, !464} -!680 = !DILocation(line: 344, column: 9, scope: !667) -!681 = !DILocation(line: 348, column: 9, scope: !682) -!682 = distinct !DILexicalBlock(scope: !623, file: !2, line: 347, column: 5) -!683 = !DILocalVariable(name: "success", scope: !682, file: !2, line: 349, type: !297) -!684 = !DILocation(line: 349, column: 14, scope: !682) -!685 = !DILocation(line: 349, column: 24, scope: !682) -!686 = !DILocation(line: 350, column: 9, scope: !682) -!687 = !DILocation(line: 353, column: 5, scope: !623) -!688 = !DILocation(line: 354, column: 1, scope: !623) -!689 = distinct !DISubprogram(name: "key_destroy", scope: !2, file: !2, line: 361, type: !140, scopeLine: 362, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!690 = !DILocalVariable(name: "unused_value", arg: 1, scope: !689, file: !2, line: 361, type: !63) -!691 = !DILocation(line: 361, column: 24, scope: !689) -!692 = !DILocation(line: 363, column: 21, scope: !689) -!693 = !DILocation(line: 363, column: 19, scope: !689) -!694 = !DILocation(line: 364, column: 1, scope: !689) -!695 = distinct !DISubprogram(name: "key_worker", scope: !2, file: !2, line: 366, type: !166, scopeLine: 367, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!696 = !DILocalVariable(name: "message", arg: 1, scope: !695, file: !2, line: 366, type: !63) -!697 = !DILocation(line: 366, column: 24, scope: !695) -!698 = !DILocalVariable(name: "my_secret", scope: !695, file: !2, line: 368, type: !154) -!699 = !DILocation(line: 368, column: 9, scope: !695) -!700 = !DILocalVariable(name: "status", scope: !695, file: !2, line: 370, type: !154) -!701 = !DILocation(line: 370, column: 9, scope: !695) -!702 = !DILocation(line: 370, column: 38, scope: !695) -!703 = !DILocation(line: 370, column: 18, scope: !695) -!704 = !DILocation(line: 371, column: 5, scope: !695) -!705 = !DILocalVariable(name: "my_local_data", scope: !695, file: !2, line: 373, type: !63) -!706 = !DILocation(line: 373, column: 11, scope: !695) -!707 = !DILocation(line: 373, column: 47, scope: !695) -!708 = !DILocation(line: 373, column: 27, scope: !695) -!709 = !DILocation(line: 374, column: 5, scope: !695) -!710 = !DILocation(line: 376, column: 12, scope: !695) -!711 = !DILocation(line: 376, column: 5, scope: !695) -!712 = distinct !DISubprogram(name: "key_test", scope: !2, file: !2, line: 379, type: !317, scopeLine: 380, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!713 = !DILocalVariable(name: "my_secret", scope: !712, file: !2, line: 381, type: !154) -!714 = !DILocation(line: 381, column: 9, scope: !712) -!715 = !DILocalVariable(name: "message", scope: !712, file: !2, line: 382, type: !63) -!716 = !DILocation(line: 382, column: 11, scope: !712) -!717 = !DILocalVariable(name: "status", scope: !712, file: !2, line: 383, type: !154) -!718 = !DILocation(line: 383, column: 9, scope: !712) -!719 = !DILocation(line: 385, column: 5, scope: !712) -!720 = !DILocalVariable(name: "worker", scope: !712, file: !2, line: 387, type: !127) -!721 = !DILocation(line: 387, column: 15, scope: !712) -!722 = !DILocation(line: 387, column: 50, scope: !712) -!723 = !DILocation(line: 387, column: 24, scope: !712) -!724 = !DILocation(line: 389, column: 34, scope: !712) -!725 = !DILocation(line: 389, column: 14, scope: !712) -!726 = !DILocation(line: 389, column: 12, scope: !712) -!727 = !DILocation(line: 390, column: 5, scope: !712) -!728 = !DILocalVariable(name: "my_local_data", scope: !712, file: !2, line: 392, type: !63) -!729 = !DILocation(line: 392, column: 11, scope: !712) -!730 = !DILocation(line: 392, column: 47, scope: !712) -!731 = !DILocation(line: 392, column: 27, scope: !712) -!732 = !DILocation(line: 393, column: 5, scope: !712) -!733 = !DILocation(line: 395, column: 34, scope: !712) -!734 = !DILocation(line: 395, column: 14, scope: !712) -!735 = !DILocation(line: 395, column: 12, scope: !712) -!736 = !DILocation(line: 396, column: 5, scope: !712) -!737 = !DILocalVariable(name: "result", scope: !712, file: !2, line: 398, type: !63) -!738 = !DILocation(line: 398, column: 11, scope: !712) -!739 = !DILocation(line: 398, column: 32, scope: !712) -!740 = !DILocation(line: 398, column: 20, scope: !712) -!741 = !DILocation(line: 399, column: 5, scope: !712) -!742 = !DILocation(line: 401, column: 33, scope: !712) -!743 = !DILocation(line: 401, column: 14, scope: !712) -!744 = !DILocation(line: 401, column: 12, scope: !712) -!745 = !DILocation(line: 402, column: 5, scope: !712) -!746 = !DILocation(line: 404, column: 5, scope: !712) -!747 = !DILocation(line: 405, column: 1, scope: !712) -!748 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 407, type: !749, scopeLine: 408, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !168) -!749 = !DISubroutineType(types: !750) -!750 = !{!154} -!751 = !DILocation(line: 409, column: 5, scope: !748) -!752 = !DILocation(line: 410, column: 5, scope: !748) -!753 = !DILocation(line: 411, column: 5, scope: !748) -!754 = !DILocation(line: 412, column: 5, scope: !748) -!755 = !DILocation(line: 413, column: 1, scope: !748) +!585 = !{!298, !514} +!586 = !DILocalVariable(name: "lock", arg: 1, scope: !583, file: !2, line: 294, type: !514) +!587 = !DILocation(line: 294, column: 41, scope: !583) +!588 = !DILocalVariable(name: "status", scope: !583, file: !2, line: 296, type: !155) +!589 = !DILocation(line: 296, column: 9, scope: !583) +!590 = !DILocation(line: 296, column: 43, scope: !583) +!591 = !DILocation(line: 296, column: 18, scope: !583) +!592 = !DILocation(line: 298, column: 12, scope: !583) +!593 = !DILocation(line: 298, column: 19, scope: !583) +!594 = !DILocation(line: 298, column: 5, scope: !583) +!595 = distinct !DISubprogram(name: "rwlock_rdlock", scope: !2, file: !2, line: 301, type: !564, scopeLine: 302, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!596 = !DILocalVariable(name: "lock", arg: 1, scope: !595, file: !2, line: 301, type: !514) +!597 = !DILocation(line: 301, column: 38, scope: !595) +!598 = !DILocalVariable(name: "status", scope: !595, file: !2, line: 303, type: !155) +!599 = !DILocation(line: 303, column: 9, scope: !595) +!600 = !DILocation(line: 303, column: 40, scope: !595) +!601 = !DILocation(line: 303, column: 18, scope: !595) +!602 = !DILocation(line: 304, column: 5, scope: !595) +!603 = !DILocation(line: 305, column: 1, scope: !595) +!604 = distinct !DISubprogram(name: "rwlock_tryrdlock", scope: !2, file: !2, line: 307, type: !584, scopeLine: 308, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!605 = !DILocalVariable(name: "lock", arg: 1, scope: !604, file: !2, line: 307, type: !514) +!606 = !DILocation(line: 307, column: 41, scope: !604) +!607 = !DILocalVariable(name: "status", scope: !604, file: !2, line: 309, type: !155) +!608 = !DILocation(line: 309, column: 9, scope: !604) +!609 = !DILocation(line: 309, column: 43, scope: !604) +!610 = !DILocation(line: 309, column: 18, scope: !604) +!611 = !DILocation(line: 311, column: 12, scope: !604) +!612 = !DILocation(line: 311, column: 19, scope: !604) +!613 = !DILocation(line: 311, column: 5, scope: !604) +!614 = distinct !DISubprogram(name: "rwlock_unlock", scope: !2, file: !2, line: 314, type: !564, scopeLine: 315, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!615 = !DILocalVariable(name: "lock", arg: 1, scope: !614, file: !2, line: 314, type: !514) +!616 = !DILocation(line: 314, column: 38, scope: !614) +!617 = !DILocalVariable(name: "status", scope: !614, file: !2, line: 316, type: !155) +!618 = !DILocation(line: 316, column: 9, scope: !614) +!619 = !DILocation(line: 316, column: 40, scope: !614) +!620 = !DILocation(line: 316, column: 18, scope: !614) +!621 = !DILocation(line: 317, column: 5, scope: !614) +!622 = !DILocation(line: 318, column: 1, scope: !614) +!623 = distinct !DISubprogram(name: "rwlock_test", scope: !2, file: !2, line: 320, type: !318, scopeLine: 321, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!624 = !DILocalVariable(name: "lock", scope: !623, file: !2, line: 322, type: !515) +!625 = !DILocation(line: 322, column: 22, scope: !623) +!626 = !DILocation(line: 323, column: 5, scope: !623) +!627 = !DILocalVariable(name: "test_depth", scope: !623, file: !2, line: 324, type: !628) +!628 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !155) +!629 = !DILocation(line: 324, column: 15, scope: !623) +!630 = !DILocation(line: 327, column: 9, scope: !631) +!631 = distinct !DILexicalBlock(scope: !623, file: !2, line: 326, column: 5) +!632 = !DILocalVariable(name: "success", scope: !631, file: !2, line: 328, type: !298) +!633 = !DILocation(line: 328, column: 14, scope: !631) +!634 = !DILocation(line: 328, column: 24, scope: !631) +!635 = !DILocation(line: 329, column: 9, scope: !631) +!636 = !DILocation(line: 330, column: 19, scope: !631) +!637 = !DILocation(line: 330, column: 17, scope: !631) +!638 = !DILocation(line: 331, column: 9, scope: !631) +!639 = !DILocation(line: 332, column: 9, scope: !631) +!640 = !DILocation(line: 336, column: 9, scope: !641) +!641 = distinct !DILexicalBlock(scope: !623, file: !2, line: 335, column: 5) +!642 = !DILocalVariable(name: "i", scope: !643, file: !2, line: 337, type: !155) +!643 = distinct !DILexicalBlock(scope: !641, file: !2, line: 337, column: 9) +!644 = !DILocation(line: 337, column: 18, scope: !643) +!645 = !DILocation(line: 337, column: 14, scope: !643) +!646 = !DILocation(line: 337, column: 25, scope: !647) +!647 = distinct !DILexicalBlock(scope: !643, file: !2, line: 337, column: 9) +!648 = !DILocation(line: 337, column: 27, scope: !647) +!649 = !DILocation(line: 337, column: 9, scope: !643) +!650 = !DILocalVariable(name: "success", scope: !651, file: !2, line: 339, type: !298) +!651 = distinct !DILexicalBlock(scope: !647, file: !2, line: 338, column: 9) +!652 = !DILocation(line: 339, column: 18, scope: !651) +!653 = !DILocation(line: 339, column: 28, scope: !651) +!654 = !DILocation(line: 340, column: 13, scope: !651) +!655 = !DILocation(line: 341, column: 9, scope: !651) +!656 = !DILocation(line: 337, column: 42, scope: !647) +!657 = !DILocation(line: 337, column: 9, scope: !647) +!658 = distinct !{!658, !649, !659, !660} +!659 = !DILocation(line: 341, column: 9, scope: !643) +!660 = !{!"llvm.loop.mustprogress"} +!661 = !DILocalVariable(name: "success", scope: !662, file: !2, line: 344, type: !298) +!662 = distinct !DILexicalBlock(scope: !641, file: !2, line: 343, column: 9) +!663 = !DILocation(line: 344, column: 18, scope: !662) +!664 = !DILocation(line: 344, column: 28, scope: !662) +!665 = !DILocation(line: 345, column: 13, scope: !662) +!666 = !DILocation(line: 348, column: 9, scope: !641) +!667 = !DILocalVariable(name: "i", scope: !668, file: !2, line: 349, type: !155) +!668 = distinct !DILexicalBlock(scope: !641, file: !2, line: 349, column: 9) +!669 = !DILocation(line: 349, column: 18, scope: !668) +!670 = !DILocation(line: 349, column: 14, scope: !668) +!671 = !DILocation(line: 349, column: 25, scope: !672) +!672 = distinct !DILexicalBlock(scope: !668, file: !2, line: 349, column: 9) +!673 = !DILocation(line: 349, column: 27, scope: !672) +!674 = !DILocation(line: 349, column: 9, scope: !668) +!675 = !DILocation(line: 350, column: 13, scope: !676) +!676 = distinct !DILexicalBlock(scope: !672, file: !2, line: 349, column: 46) +!677 = !DILocation(line: 351, column: 9, scope: !676) +!678 = !DILocation(line: 349, column: 42, scope: !672) +!679 = !DILocation(line: 349, column: 9, scope: !672) +!680 = distinct !{!680, !674, !681, !660} +!681 = !DILocation(line: 351, column: 9, scope: !668) +!682 = !DILocation(line: 355, column: 9, scope: !683) +!683 = distinct !DILexicalBlock(scope: !623, file: !2, line: 354, column: 5) +!684 = !DILocalVariable(name: "success", scope: !683, file: !2, line: 356, type: !298) +!685 = !DILocation(line: 356, column: 14, scope: !683) +!686 = !DILocation(line: 356, column: 24, scope: !683) +!687 = !DILocation(line: 357, column: 9, scope: !683) +!688 = !DILocation(line: 360, column: 5, scope: !623) +!689 = !DILocation(line: 361, column: 1, scope: !623) +!690 = distinct !DISubprogram(name: "key_destroy", scope: !2, file: !2, line: 368, type: !141, scopeLine: 369, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!691 = !DILocalVariable(name: "unused_value", arg: 1, scope: !690, file: !2, line: 368, type: !64) +!692 = !DILocation(line: 368, column: 24, scope: !690) +!693 = !DILocation(line: 370, column: 21, scope: !690) +!694 = !DILocation(line: 370, column: 19, scope: !690) +!695 = !DILocation(line: 371, column: 1, scope: !690) +!696 = distinct !DISubprogram(name: "key_worker", scope: !2, file: !2, line: 373, type: !167, scopeLine: 374, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!697 = !DILocalVariable(name: "message", arg: 1, scope: !696, file: !2, line: 373, type: !64) +!698 = !DILocation(line: 373, column: 24, scope: !696) +!699 = !DILocalVariable(name: "my_secret", scope: !696, file: !2, line: 375, type: !155) +!700 = !DILocation(line: 375, column: 9, scope: !696) +!701 = !DILocalVariable(name: "status", scope: !696, file: !2, line: 377, type: !155) +!702 = !DILocation(line: 377, column: 9, scope: !696) +!703 = !DILocation(line: 377, column: 38, scope: !696) +!704 = !DILocation(line: 377, column: 18, scope: !696) +!705 = !DILocation(line: 378, column: 5, scope: !696) +!706 = !DILocalVariable(name: "my_local_data", scope: !696, file: !2, line: 380, type: !64) +!707 = !DILocation(line: 380, column: 11, scope: !696) +!708 = !DILocation(line: 380, column: 47, scope: !696) +!709 = !DILocation(line: 380, column: 27, scope: !696) +!710 = !DILocation(line: 381, column: 5, scope: !696) +!711 = !DILocation(line: 383, column: 12, scope: !696) +!712 = !DILocation(line: 383, column: 5, scope: !696) +!713 = distinct !DISubprogram(name: "key_test", scope: !2, file: !2, line: 386, type: !318, scopeLine: 387, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!714 = !DILocalVariable(name: "my_secret", scope: !713, file: !2, line: 388, type: !155) +!715 = !DILocation(line: 388, column: 9, scope: !713) +!716 = !DILocalVariable(name: "message", scope: !713, file: !2, line: 389, type: !64) +!717 = !DILocation(line: 389, column: 11, scope: !713) +!718 = !DILocalVariable(name: "status", scope: !713, file: !2, line: 390, type: !155) +!719 = !DILocation(line: 390, column: 9, scope: !713) +!720 = !DILocation(line: 392, column: 5, scope: !713) +!721 = !DILocalVariable(name: "worker", scope: !713, file: !2, line: 394, type: !128) +!722 = !DILocation(line: 394, column: 15, scope: !713) +!723 = !DILocation(line: 394, column: 50, scope: !713) +!724 = !DILocation(line: 394, column: 24, scope: !713) +!725 = !DILocation(line: 396, column: 34, scope: !713) +!726 = !DILocation(line: 396, column: 14, scope: !713) +!727 = !DILocation(line: 396, column: 12, scope: !713) +!728 = !DILocation(line: 397, column: 5, scope: !713) +!729 = !DILocalVariable(name: "my_local_data", scope: !713, file: !2, line: 399, type: !64) +!730 = !DILocation(line: 399, column: 11, scope: !713) +!731 = !DILocation(line: 399, column: 47, scope: !713) +!732 = !DILocation(line: 399, column: 27, scope: !713) +!733 = !DILocation(line: 400, column: 5, scope: !713) +!734 = !DILocation(line: 402, column: 34, scope: !713) +!735 = !DILocation(line: 402, column: 14, scope: !713) +!736 = !DILocation(line: 402, column: 12, scope: !713) +!737 = !DILocation(line: 403, column: 5, scope: !713) +!738 = !DILocalVariable(name: "result", scope: !713, file: !2, line: 405, type: !64) +!739 = !DILocation(line: 405, column: 11, scope: !713) +!740 = !DILocation(line: 405, column: 32, scope: !713) +!741 = !DILocation(line: 405, column: 20, scope: !713) +!742 = !DILocation(line: 406, column: 5, scope: !713) +!743 = !DILocation(line: 408, column: 33, scope: !713) +!744 = !DILocation(line: 408, column: 14, scope: !713) +!745 = !DILocation(line: 408, column: 12, scope: !713) +!746 = !DILocation(line: 409, column: 5, scope: !713) +!747 = !DILocation(line: 411, column: 5, scope: !713) +!748 = !DILocation(line: 412, column: 1, scope: !713) +!749 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 414, type: !750, scopeLine: 415, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) +!750 = !DISubroutineType(types: !751) +!751 = !{!155} +!752 = !DILocation(line: 416, column: 5, scope: !749) +!753 = !DILocation(line: 417, column: 5, scope: !749) +!754 = !DILocation(line: 418, column: 5, scope: !749) +!755 = !DILocation(line: 419, column: 5, scope: !749) +!756 = !DILocation(line: 420, column: 1, scope: !749) From 260e0eb0101c79dc0f8363cf3290cec010600cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 20 Dec 2023 16:43:34 +0100 Subject: [PATCH 19/21] Add unescaping to VisitorLLVM --- .../parsers/program/visitors/VisitorLlvm.java | 31 +++++++++++++++++-- .../program/processing/Intrinsics.java | 30 ++++++++++-------- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java index 62773e9b90..8b2a6da822 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLlvm.java @@ -1365,15 +1365,42 @@ private static String parseMemoryOrder(AtomicOrderingContext ctx) { } private static String globalIdent(TerminalNode node) { + //see https://llvm.org/docs/LangRef.html#identifiers + // Names can be quoted, to allow escaping and other characters than . + // This should not bother us after parsing: @fun and @"fun" should be identical. final String ident = node.getText(); assert ident.startsWith("@"); - return ident.substring(1).replace(".loop", ".\\loop"); + final String unescapedIdent = unescape(ident.substring(1)); + // LLVM prepends \01 to a global, if subsequent name mangling should be disabled. + // Clang produces this flag, when a C declaration contains an explicit __asm alias. + // We ignore this flag. + final String trimmedIdent = unescapedIdent.startsWith("\1") ? unescapedIdent.substring(1) : unescapedIdent; + return trimmedIdent.replace(".loop", ".\\loop"); } private static String localIdent(TerminalNode node) { final String ident = node.getText(); assert ident.startsWith("%"); - return ident.substring(1).replace(".loop", ".\\loop"); + return unescape(ident.substring(1)).replace(".loop", ".\\loop"); + } + + private static String unescape(String original) { + final boolean quoted = original.startsWith("\""); + assert quoted == (original.endsWith("\"")); + final String unquoted = quoted ? original.substring(1, original.length() - 1) : original; + int escape = unquoted.indexOf('\\'); + if (escape == -1) { + return unquoted; + } + final StringBuilder sb = new StringBuilder(unquoted.length()); + int progress = 0; + do { + sb.append(unquoted, progress, escape); + progress = escape + 3; + sb.append((char) Integer.parseInt(unquoted.substring(escape + 1, progress), 16)); + escape = unquoted.indexOf('\\', progress); + } while (escape != -1); + return sb.append(unquoted, progress, unquoted.length()).toString(); } private Register getOrNewRegister(String name, Type type) { diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index d51bdb6759..2fabcfd0d9 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -114,7 +114,7 @@ public enum Info { // --------------------------- pthread threading --------------------------- P_THREAD_CREATE("pthread_create", true, false, true, false, null), P_THREAD_EXIT("pthread_exit", false, false, false, false, null), - P_THREAD_JOIN(List.of("pthread_join", "__pthread_join", "\"\\01_pthread_join\""), false, true, false, false, null), + P_THREAD_JOIN(List.of("pthread_join", "_pthread_join", "__pthread_join"), false, true, false, false, null), P_THREAD_BARRIER_WAIT("pthread_barrier_wait", false, false, true, true, Intrinsics::inlineAsZero), P_THREAD_SELF(List.of("pthread_self", "__VERIFIER_tid"), false, false, true, false, null), P_THREAD_EQUAL("pthread_equal", false, false, true, false, Intrinsics::inlinePthreadEqual), @@ -125,14 +125,14 @@ public enum Info { P_THREAD_ATTR_SET(P_THREAD_ATTR.stream().map(a -> "pthread_attr_set" + a).toList(), true, true, true, true, Intrinsics::inlinePthreadAttr), // --------------------------- pthread condition variable --------------------------- - P_THREAD_COND_INIT(List.of("pthread_cond_init", "\"\\01_pthread_cond_init\""), + P_THREAD_COND_INIT(List.of("pthread_cond_init", "_pthread_cond_init"), true, true, true, true, Intrinsics::inlinePthreadCondInit), P_THREAD_COND_DESTROY("pthread_cond_destroy", true, false, true, true, Intrinsics::inlinePthreadCondDestroy), P_THREAD_COND_SIGNAL("pthread_cond_signal", true, false, true, true, Intrinsics::inlinePthreadCondSignal), P_THREAD_COND_BROADCAST("pthread_cond_broadcast", true, false, true, true, Intrinsics::inlinePthreadCondBroadcast), - P_THREAD_COND_WAIT(List.of("pthread_cond_wait", "\"\\01_pthread_cond_wait\""), + P_THREAD_COND_WAIT(List.of("pthread_cond_wait", "_pthread_cond_wait"), false, true, false, true, Intrinsics::inlinePthreadCondWait), - P_THREAD_COND_TIMEDWAIT(List.of("pthread_cond_timedwait", "\"\\01_pthread_cond_timedwait\""), + P_THREAD_COND_TIMEDWAIT(List.of("pthread_cond_timedwait", "_pthread_cond_timedwait"), false, false, true, true, Intrinsics::inlinePthreadCondTimedwait), P_THREAD_CONDATTR_INIT("pthread_condattr_init", true, true, true, true, Intrinsics::inlinePthreadCondAttr), P_THREAD_CONDATTR_DESTROY("pthread_condattr_destroy", true, true, true, true, Intrinsics::inlinePthreadCondAttr), @@ -148,26 +148,26 @@ public enum Info { P_THREAD_MUTEX_TRYLOCK("pthread_mutex_trylock", true, true, true, true, Intrinsics::inlinePthreadMutexTryLock), P_THREAD_MUTEX_UNLOCK("pthread_mutex_unlock", true, true, true, true, Intrinsics::inlinePthreadMutexUnlock), P_THREAD_MUTEXATTR_INIT("pthread_mutexattr_init", true, true, true, true, Intrinsics::inlinePthreadMutexAttr), - P_THREAD_MUTEXATTR_DESTROY(List.of("pthread_mutexattr_destroy", "\"\\01_pthread_mutexattr_destroy\""), + P_THREAD_MUTEXATTR_DESTROY(List.of("pthread_mutexattr_destroy", "_pthread_mutexattr_destroy"), true, true, true, true, Intrinsics::inlinePthreadMutexAttr), P_THREAD_MUTEXATTR_SET(P_THREAD_MUTEXATTR.stream().map(a -> "pthread_mutexattr_get" + a).toList(), true, true, true, true, Intrinsics::inlinePthreadMutexAttr), P_THREAD_MUTEXATTR_GET(P_THREAD_MUTEXATTR.stream().map(a -> "pthread_mutexattr_set" + a).toList(), true, true, true, true, Intrinsics::inlinePthreadMutexAttr), // --------------------------- pthread read/write lock --------------------------- - P_THREAD_RWLOCK_INIT(List.of("pthread_rwlock_init", "\"\\01_pthread_rwlock_init\""), + P_THREAD_RWLOCK_INIT(List.of("pthread_rwlock_init", "_pthread_rwlock_init"), true, false, true, true, Intrinsics::inlinePthreadRwlockInit), - P_THREAD_RWLOCK_DESTROY(List.of("pthread_rwlock_destroy", "\"\\01_pthread_rwlock_destroy\""), + P_THREAD_RWLOCK_DESTROY(List.of("pthread_rwlock_destroy", "_pthread_rwlock_destroy"), true, true, true, true, Intrinsics::inlinePthreadRwlockDestroy), - P_THREAD_RWLOCK_WRLOCK(List.of("pthread_rwlock_wrlock", "\"\\01_pthread_rwlock_wrlock\""), + P_THREAD_RWLOCK_WRLOCK(List.of("pthread_rwlock_wrlock", "_pthread_rwlock_wrlock"), true, true, false, true, Intrinsics::inlinePthreadRwlockWrlock), - P_THREAD_RWLOCK_TRYWRLOCK(List.of("pthread_rwlock_trywrlock", "\"\\01_pthread_rwlock_trywrlock\""), + P_THREAD_RWLOCK_TRYWRLOCK(List.of("pthread_rwlock_trywrlock", "_pthread_rwlock_trywrlock"), true, true, true, true, Intrinsics::inlinePthreadRwlockTryWrlock), - P_THREAD_RWLOCK_RDLOCK(List.of("pthread_rwlock_rdlock", "\"\\01_pthread_rwlock_rdlock\""), + P_THREAD_RWLOCK_RDLOCK(List.of("pthread_rwlock_rdlock", "_pthread_rwlock_rdlock"), true, true, false, true, Intrinsics::inlinePthreadRwlockRdlock), - P_THREAD_RWLOCK_TRYRDLOCK(List.of("pthread_rwlock_tryrdlock", "\"\\01_pthread_rwlock_tryrdlock\""), + P_THREAD_RWLOCK_TRYRDLOCK(List.of("pthread_rwlock_tryrdlock", "_pthread_rwlock_tryrdlock"), true, true, true, true, Intrinsics::inlinePthreadRwlockTryRdlock), - P_THREAD_RWLOCK_UNLOCK(List.of("pthread_rwlock_unlock", "\"\\01_pthread_rwlock_unlock\""), + P_THREAD_RWLOCK_UNLOCK(List.of("pthread_rwlock_unlock", "_pthread_rwlock_unlock"), true, false, true, true, Intrinsics::inlinePthreadRwlockUnlock), P_THREAD_RWLOCKATTR_INIT("pthread_rwlockattr_init", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), P_THREAD_RWLOCKATTR_DESTROY("pthread_rwlockattr_destroy", true, false, true, true, Intrinsics::inlinePthreadRwlockAttr), @@ -664,7 +664,11 @@ private List inlinePthreadMutexUnlock(FunctionCall call) { } private List inlinePthreadMutexAttr(FunctionCall call) { - final String suffix = call.getCalledFunction().getName().substring("pthread_mutexattr_".length()); + //see https://linux.die.net/man/3/pthread_mutexattr_init + final String functionName = call.getCalledFunction().getName(); + // MacOS systems prepend 'pthread_mutexattr_destroy' with _. + final int prefixLength = functionName.startsWith("_") ? 1 : 0; + final String suffix = functionName.substring(prefixLength + "pthread_mutexattr_".length()); final boolean init = suffix.equals("init"); final boolean destroy = suffix.equals("destroy"); final Register errorRegister = getResultRegisterAndCheckArguments(init || destroy ? 1 : 2, call); From 3fe3fbda87da933f6568fb8e3ae95defe0284fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pascal=20Maseli?= Date: Wed, 20 Dec 2023 16:50:45 +0100 Subject: [PATCH 20/21] Fix pthread_rwlock_rdlock and pthread_rwlock_tryrdlock Ignore test for return values of pthread_join Ignore test for destructors of pthread_key_create --- benchmarks/c/miscellaneous/pthread.c | 7 +- .../program/processing/Intrinsics.java | 14 +- .../test/resources/miscellaneous/pthread.ll | 3308 ++++++++--------- 3 files changed, 1638 insertions(+), 1691 deletions(-) diff --git a/benchmarks/c/miscellaneous/pthread.c b/benchmarks/c/miscellaneous/pthread.c index f912b50c41..c4b20b6b64 100644 --- a/benchmarks/c/miscellaneous/pthread.c +++ b/benchmarks/c/miscellaneous/pthread.c @@ -249,7 +249,7 @@ void cond_test() } void* result = thread_join(worker); - assert(result == message); + //assert(result == message); //TODO add support for return values cond_destroy(&cond); mutex_destroy(&cond_mutex); @@ -354,6 +354,7 @@ void rwlock_test() { rwlock_wrlock(&lock); bool success = rwlock_trywrlock(&lock); + assert(!success); rwlock_unlock(&lock); } @@ -403,12 +404,12 @@ void key_test() assert(status == 0); void* result = thread_join(worker); - assert(result == message); + //assert(result == message); //TODO add support for return values status = pthread_key_delete(local_data); assert(status == 0); - assert(pthread_equal(latest_thread, worker)); + //assert(pthread_equal(latest_thread, worker));//TODO add support for destructors } int main() diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java index 2fabcfd0d9..cf7b8ade0d 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/Intrinsics.java @@ -759,6 +759,7 @@ private Event newRwlockTryWrlock(FunctionCall call, Register successRegister, Ex private List inlinePthreadRwlockRdlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_rdlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final Expression lockAddress = call.getArguments().get(0); final var expected = new INonDet(constantId++, getRwlockDatatype(), true); @@ -767,7 +768,9 @@ private List inlinePthreadRwlockRdlock(FunctionCall call) { // Expect any other value than write-locked. EventFactory.newAssume(expressions.makeNEQ(expected, getRwlockWriteLockedValue())), // Increment shared counter only if not locked by writer. - newRwlockTryRdlock(call, successRegister, lockAddress, expected), + newRwlockTryRdlock(call, oldValueRegister, successRegister, lockAddress, expected), + // Fail only if write-locked. + EventFactory.newAssume(expressions.makeOr(successRegister, expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()))), // Deadlock if a violation occurred in another thread. EventFactory.newAbortIf(expressions.makeNot(successRegister)), assignSuccess(errorRegister) @@ -777,6 +780,7 @@ private List inlinePthreadRwlockRdlock(FunctionCall call) { private List inlinePthreadRwlockTryRdlock(FunctionCall call) { //see https://linux.die.net/man/3/pthread_rwlock_tryrdlock final Register errorRegister = getResultRegisterAndCheckArguments(1, call); + final Register oldValueRegister = call.getFunction().newRegister(getRwlockDatatype()); final Register successRegister = call.getFunction().newRegister(types.getBooleanType()); final Expression lockAddress = call.getArguments().get(0); final var expected = new INonDet(constantId++, getRwlockDatatype(), true); @@ -788,16 +792,18 @@ private List inlinePthreadRwlockTryRdlock(FunctionCall call) { // Expect any other value than write-locked. EventFactory.newAssume(expressions.makeNEQ(expected, getRwlockWriteLockedValue())), // Increment shared counter only if not locked by writer. - newRwlockTryRdlock(call, successRegister, lockAddress, expected), + newRwlockTryRdlock(call, oldValueRegister, successRegister, lockAddress, expected), + // Fail only if write-locked. + EventFactory.newAssume(expressions.makeOr(successRegister, expressions.makeEQ(oldValueRegister, getRwlockWriteLockedValue()))), // Indicate success with zero. EventFactory.newAssume(expressions.makeEQ(successRegister, expressions.makeEQ(error, success))), EventFactory.newLocal(errorRegister, error) ); } - private Event newRwlockTryRdlock(FunctionCall call, Register successRegister, Expression lockAddress, Expression expected) { + private Event newRwlockTryRdlock(FunctionCall call, Register oldValueRegister, Register successRegister, Expression lockAddress, Expression expected) { return EventFactory.Llvm.newCompareExchange( - call.getFunction().newRegister(getRwlockDatatype()), + oldValueRegister, successRegister, lockAddress, expected, diff --git a/dartagnan/src/test/resources/miscellaneous/pthread.ll b/dartagnan/src/test/resources/miscellaneous/pthread.ll index e45283a80c..19a5ed1350 100644 --- a/dartagnan/src/test/resources/miscellaneous/pthread.ll +++ b/dartagnan/src/test/resources/miscellaneous/pthread.ll @@ -28,64 +28,61 @@ target triple = "arm64-apple-macosx14.0.0" @__func__.cond_signal = private unnamed_addr constant [12 x i8] c"cond_signal\00", align 1, !dbg !52 @__func__.cond_broadcast = private unnamed_addr constant [15 x i8] c"cond_broadcast\00", align 1, !dbg !54 @phase = global i32 0, align 4, !dbg !59 -@cond_mutex = global %struct._opaque_pthread_mutex_t zeroinitializer, align 8, !dbg !100 -@cond = global %struct._opaque_pthread_cond_t zeroinitializer, align 8, !dbg !114 -@__func__.cond_test = private unnamed_addr constant [10 x i8] c"cond_test\00", align 1, !dbg !66 -@.str.4 = private unnamed_addr constant [18 x i8] c"result == message\00", align 1, !dbg !68 -@__func__.rwlock_init = private unnamed_addr constant [12 x i8] c"rwlock_init\00", align 1, !dbg !73 -@__func__.rwlock_destroy = private unnamed_addr constant [15 x i8] c"rwlock_destroy\00", align 1, !dbg !75 -@__func__.rwlock_wrlock = private unnamed_addr constant [14 x i8] c"rwlock_wrlock\00", align 1, !dbg !77 -@__func__.rwlock_rdlock = private unnamed_addr constant [14 x i8] c"rwlock_rdlock\00", align 1, !dbg !79 -@__func__.rwlock_unlock = private unnamed_addr constant [14 x i8] c"rwlock_unlock\00", align 1, !dbg !81 -@__func__.rwlock_test = private unnamed_addr constant [12 x i8] c"rwlock_test\00", align 1, !dbg !83 -@latest_thread = global ptr null, align 8, !dbg !126 -@local_data = global i64 0, align 8, !dbg !149 -@__func__.key_worker = private unnamed_addr constant [11 x i8] c"key_worker\00", align 1, !dbg !85 -@.str.5 = private unnamed_addr constant [28 x i8] c"my_local_data == &my_secret\00", align 1, !dbg !87 -@__func__.key_test = private unnamed_addr constant [9 x i8] c"key_test\00", align 1, !dbg !92 -@.str.6 = private unnamed_addr constant [37 x i8] c"pthread_equal(latest_thread, worker)\00", align 1, !dbg !95 +@cond_mutex = global %struct._opaque_pthread_mutex_t zeroinitializer, align 8, !dbg !88 +@cond = global %struct._opaque_pthread_cond_t zeroinitializer, align 8, !dbg !102 +@__func__.rwlock_init = private unnamed_addr constant [12 x i8] c"rwlock_init\00", align 1, !dbg !66 +@__func__.rwlock_destroy = private unnamed_addr constant [15 x i8] c"rwlock_destroy\00", align 1, !dbg !68 +@__func__.rwlock_wrlock = private unnamed_addr constant [14 x i8] c"rwlock_wrlock\00", align 1, !dbg !70 +@__func__.rwlock_rdlock = private unnamed_addr constant [14 x i8] c"rwlock_rdlock\00", align 1, !dbg !72 +@__func__.rwlock_unlock = private unnamed_addr constant [14 x i8] c"rwlock_unlock\00", align 1, !dbg !74 +@__func__.rwlock_test = private unnamed_addr constant [12 x i8] c"rwlock_test\00", align 1, !dbg !76 +@latest_thread = global ptr null, align 8, !dbg !114 +@local_data = global i64 0, align 8, !dbg !137 +@__func__.key_worker = private unnamed_addr constant [11 x i8] c"key_worker\00", align 1, !dbg !78 +@.str.4 = private unnamed_addr constant [28 x i8] c"my_local_data == &my_secret\00", align 1, !dbg !80 +@__func__.key_test = private unnamed_addr constant [9 x i8] c"key_test\00", align 1, !dbg !85 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @thread_create(ptr noundef %0, ptr noundef %1) #0 !dbg !163 { +define ptr @thread_create(ptr noundef %0, ptr noundef %1) #0 !dbg !151 { %3 = alloca ptr, align 8 %4 = alloca ptr, align 8 %5 = alloca ptr, align 8 %6 = alloca %struct._opaque_pthread_attr_t, align 8 %7 = alloca i32, align 4 store ptr %0, ptr %3, align 8 - call void @llvm.dbg.declare(metadata ptr %3, metadata !170, metadata !DIExpression()), !dbg !171 + call void @llvm.dbg.declare(metadata ptr %3, metadata !158, metadata !DIExpression()), !dbg !159 store ptr %1, ptr %4, align 8 - call void @llvm.dbg.declare(metadata ptr %4, metadata !172, metadata !DIExpression()), !dbg !173 - call void @llvm.dbg.declare(metadata ptr %5, metadata !174, metadata !DIExpression()), !dbg !175 - call void @llvm.dbg.declare(metadata ptr %6, metadata !176, metadata !DIExpression()), !dbg !184 - %8 = call i32 @pthread_attr_init(ptr noundef %6), !dbg !185 - call void @llvm.dbg.declare(metadata ptr %7, metadata !186, metadata !DIExpression()), !dbg !187 - %9 = load ptr, ptr %3, align 8, !dbg !188 - %10 = load ptr, ptr %4, align 8, !dbg !189 - %11 = call i32 @pthread_create(ptr noundef %5, ptr noundef %6, ptr noundef %9, ptr noundef %10), !dbg !190 - store i32 %11, ptr %7, align 4, !dbg !187 - %12 = load i32, ptr %7, align 4, !dbg !191 - %13 = icmp eq i32 %12, 0, !dbg !191 - %14 = xor i1 %13, true, !dbg !191 - %15 = zext i1 %14 to i32, !dbg !191 - %16 = sext i32 %15 to i64, !dbg !191 - %17 = icmp ne i64 %16, 0, !dbg !191 - br i1 %17, label %18, label %20, !dbg !191 + call void @llvm.dbg.declare(metadata ptr %4, metadata !160, metadata !DIExpression()), !dbg !161 + call void @llvm.dbg.declare(metadata ptr %5, metadata !162, metadata !DIExpression()), !dbg !163 + call void @llvm.dbg.declare(metadata ptr %6, metadata !164, metadata !DIExpression()), !dbg !172 + %8 = call i32 @pthread_attr_init(ptr noundef %6), !dbg !173 + call void @llvm.dbg.declare(metadata ptr %7, metadata !174, metadata !DIExpression()), !dbg !175 + %9 = load ptr, ptr %3, align 8, !dbg !176 + %10 = load ptr, ptr %4, align 8, !dbg !177 + %11 = call i32 @pthread_create(ptr noundef %5, ptr noundef %6, ptr noundef %9, ptr noundef %10), !dbg !178 + store i32 %11, ptr %7, align 4, !dbg !175 + %12 = load i32, ptr %7, align 4, !dbg !179 + %13 = icmp eq i32 %12, 0, !dbg !179 + %14 = xor i1 %13, true, !dbg !179 + %15 = zext i1 %14 to i32, !dbg !179 + %16 = sext i32 %15 to i64, !dbg !179 + %17 = icmp ne i64 %16, 0, !dbg !179 + br i1 %17, label %18, label %20, !dbg !179 18: ; preds = %2 - call void @__assert_rtn(ptr noundef @__func__.thread_create, ptr noundef @.str, i32 noundef 18, ptr noundef @.str.1) #4, !dbg !191 - unreachable, !dbg !191 + call void @__assert_rtn(ptr noundef @__func__.thread_create, ptr noundef @.str, i32 noundef 18, ptr noundef @.str.1) #4, !dbg !179 + unreachable, !dbg !179 19: ; No predecessors! - br label %21, !dbg !191 + br label %21, !dbg !179 20: ; preds = %2 - br label %21, !dbg !191 + br label %21, !dbg !179 21: ; preds = %20, %19 - %22 = call i32 @pthread_attr_destroy(ptr noundef %6), !dbg !192 - %23 = load ptr, ptr %5, align 8, !dbg !193 - ret ptr %23, !dbg !194 + %22 = call i32 @pthread_attr_destroy(ptr noundef %6), !dbg !180 + %23 = load ptr, ptr %5, align 8, !dbg !181 + ret ptr %23, !dbg !182 } ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn @@ -101,44 +98,44 @@ declare void @__assert_rtn(ptr noundef, ptr noundef, i32 noundef, ptr noundef) # declare i32 @pthread_attr_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @thread_join(ptr noundef %0) #0 !dbg !195 { +define ptr @thread_join(ptr noundef %0) #0 !dbg !183 { %2 = alloca ptr, align 8 %3 = alloca ptr, align 8 %4 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !198, metadata !DIExpression()), !dbg !199 - call void @llvm.dbg.declare(metadata ptr %3, metadata !200, metadata !DIExpression()), !dbg !201 - call void @llvm.dbg.declare(metadata ptr %4, metadata !202, metadata !DIExpression()), !dbg !203 - %5 = load ptr, ptr %2, align 8, !dbg !204 - %6 = call i32 @"\01_pthread_join"(ptr noundef %5, ptr noundef %3), !dbg !205 - store i32 %6, ptr %4, align 4, !dbg !203 - %7 = load i32, ptr %4, align 4, !dbg !206 - %8 = icmp eq i32 %7, 0, !dbg !206 - %9 = xor i1 %8, true, !dbg !206 - %10 = zext i1 %9 to i32, !dbg !206 - %11 = sext i32 %10 to i64, !dbg !206 - %12 = icmp ne i64 %11, 0, !dbg !206 - br i1 %12, label %13, label %15, !dbg !206 + call void @llvm.dbg.declare(metadata ptr %2, metadata !186, metadata !DIExpression()), !dbg !187 + call void @llvm.dbg.declare(metadata ptr %3, metadata !188, metadata !DIExpression()), !dbg !189 + call void @llvm.dbg.declare(metadata ptr %4, metadata !190, metadata !DIExpression()), !dbg !191 + %5 = load ptr, ptr %2, align 8, !dbg !192 + %6 = call i32 @"\01_pthread_join"(ptr noundef %5, ptr noundef %3), !dbg !193 + store i32 %6, ptr %4, align 4, !dbg !191 + %7 = load i32, ptr %4, align 4, !dbg !194 + %8 = icmp eq i32 %7, 0, !dbg !194 + %9 = xor i1 %8, true, !dbg !194 + %10 = zext i1 %9 to i32, !dbg !194 + %11 = sext i32 %10 to i64, !dbg !194 + %12 = icmp ne i64 %11, 0, !dbg !194 + br i1 %12, label %13, label %15, !dbg !194 13: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.thread_join, ptr noundef @.str, i32 noundef 27, ptr noundef @.str.1) #4, !dbg !206 - unreachable, !dbg !206 + call void @__assert_rtn(ptr noundef @__func__.thread_join, ptr noundef @.str, i32 noundef 27, ptr noundef @.str.1) #4, !dbg !194 + unreachable, !dbg !194 14: ; No predecessors! - br label %16, !dbg !206 + br label %16, !dbg !194 15: ; preds = %1 - br label %16, !dbg !206 + br label %16, !dbg !194 16: ; preds = %15, %14 - %17 = load ptr, ptr %3, align 8, !dbg !207 - ret ptr %17, !dbg !208 + %17 = load ptr, ptr %3, align 8, !dbg !195 + ret ptr %17, !dbg !196 } declare i32 @"\01_pthread_join"(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 !dbg !209 { +define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 !dbg !197 { %6 = alloca ptr, align 8 %7 = alloca i32, align 4 %8 = alloca i32, align 4 @@ -148,255 +145,255 @@ define void @mutex_init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noun %12 = alloca i32, align 4 %13 = alloca %struct._opaque_pthread_mutexattr_t, align 8 store ptr %0, ptr %6, align 8 - call void @llvm.dbg.declare(metadata ptr %6, metadata !213, metadata !DIExpression()), !dbg !214 + call void @llvm.dbg.declare(metadata ptr %6, metadata !201, metadata !DIExpression()), !dbg !202 store i32 %1, ptr %7, align 4 - call void @llvm.dbg.declare(metadata ptr %7, metadata !215, metadata !DIExpression()), !dbg !216 + call void @llvm.dbg.declare(metadata ptr %7, metadata !203, metadata !DIExpression()), !dbg !204 store i32 %2, ptr %8, align 4 - call void @llvm.dbg.declare(metadata ptr %8, metadata !217, metadata !DIExpression()), !dbg !218 + call void @llvm.dbg.declare(metadata ptr %8, metadata !205, metadata !DIExpression()), !dbg !206 store i32 %3, ptr %9, align 4 - call void @llvm.dbg.declare(metadata ptr %9, metadata !219, metadata !DIExpression()), !dbg !220 + call void @llvm.dbg.declare(metadata ptr %9, metadata !207, metadata !DIExpression()), !dbg !208 store i32 %4, ptr %10, align 4 - call void @llvm.dbg.declare(metadata ptr %10, metadata !221, metadata !DIExpression()), !dbg !222 - call void @llvm.dbg.declare(metadata ptr %11, metadata !223, metadata !DIExpression()), !dbg !224 - call void @llvm.dbg.declare(metadata ptr %12, metadata !225, metadata !DIExpression()), !dbg !226 - call void @llvm.dbg.declare(metadata ptr %13, metadata !227, metadata !DIExpression()), !dbg !235 - %14 = call i32 @pthread_mutexattr_init(ptr noundef %13), !dbg !236 - store i32 %14, ptr %11, align 4, !dbg !237 - %15 = load i32, ptr %11, align 4, !dbg !238 - %16 = icmp eq i32 %15, 0, !dbg !238 - %17 = xor i1 %16, true, !dbg !238 - %18 = zext i1 %17 to i32, !dbg !238 - %19 = sext i32 %18 to i64, !dbg !238 - %20 = icmp ne i64 %19, 0, !dbg !238 - br i1 %20, label %21, label %23, !dbg !238 + call void @llvm.dbg.declare(metadata ptr %10, metadata !209, metadata !DIExpression()), !dbg !210 + call void @llvm.dbg.declare(metadata ptr %11, metadata !211, metadata !DIExpression()), !dbg !212 + call void @llvm.dbg.declare(metadata ptr %12, metadata !213, metadata !DIExpression()), !dbg !214 + call void @llvm.dbg.declare(metadata ptr %13, metadata !215, metadata !DIExpression()), !dbg !223 + %14 = call i32 @pthread_mutexattr_init(ptr noundef %13), !dbg !224 + store i32 %14, ptr %11, align 4, !dbg !225 + %15 = load i32, ptr %11, align 4, !dbg !226 + %16 = icmp eq i32 %15, 0, !dbg !226 + %17 = xor i1 %16, true, !dbg !226 + %18 = zext i1 %17 to i32, !dbg !226 + %19 = sext i32 %18 to i64, !dbg !226 + %20 = icmp ne i64 %19, 0, !dbg !226 + br i1 %20, label %21, label %23, !dbg !226 21: ; preds = %5 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 49, ptr noundef @.str.1) #4, !dbg !238 - unreachable, !dbg !238 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 49, ptr noundef @.str.1) #4, !dbg !226 + unreachable, !dbg !226 22: ; No predecessors! - br label %24, !dbg !238 + br label %24, !dbg !226 23: ; preds = %5 - br label %24, !dbg !238 + br label %24, !dbg !226 24: ; preds = %23, %22 - %25 = load i32, ptr %7, align 4, !dbg !239 - %26 = call i32 @pthread_mutexattr_settype(ptr noundef %13, i32 noundef %25), !dbg !240 - store i32 %26, ptr %11, align 4, !dbg !241 - %27 = load i32, ptr %11, align 4, !dbg !242 - %28 = icmp eq i32 %27, 0, !dbg !242 - %29 = xor i1 %28, true, !dbg !242 - %30 = zext i1 %29 to i32, !dbg !242 - %31 = sext i32 %30 to i64, !dbg !242 - %32 = icmp ne i64 %31, 0, !dbg !242 - br i1 %32, label %33, label %35, !dbg !242 + %25 = load i32, ptr %7, align 4, !dbg !227 + %26 = call i32 @pthread_mutexattr_settype(ptr noundef %13, i32 noundef %25), !dbg !228 + store i32 %26, ptr %11, align 4, !dbg !229 + %27 = load i32, ptr %11, align 4, !dbg !230 + %28 = icmp eq i32 %27, 0, !dbg !230 + %29 = xor i1 %28, true, !dbg !230 + %30 = zext i1 %29 to i32, !dbg !230 + %31 = sext i32 %30 to i64, !dbg !230 + %32 = icmp ne i64 %31, 0, !dbg !230 + br i1 %32, label %33, label %35, !dbg !230 33: ; preds = %24 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 52, ptr noundef @.str.1) #4, !dbg !242 - unreachable, !dbg !242 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 52, ptr noundef @.str.1) #4, !dbg !230 + unreachable, !dbg !230 34: ; No predecessors! - br label %36, !dbg !242 + br label %36, !dbg !230 35: ; preds = %24 - br label %36, !dbg !242 + br label %36, !dbg !230 36: ; preds = %35, %34 - %37 = call i32 @pthread_mutexattr_gettype(ptr noundef %13, ptr noundef %12), !dbg !243 - store i32 %37, ptr %11, align 4, !dbg !244 - %38 = load i32, ptr %11, align 4, !dbg !245 - %39 = icmp eq i32 %38, 0, !dbg !245 - %40 = xor i1 %39, true, !dbg !245 - %41 = zext i1 %40 to i32, !dbg !245 - %42 = sext i32 %41 to i64, !dbg !245 - %43 = icmp ne i64 %42, 0, !dbg !245 - br i1 %43, label %44, label %46, !dbg !245 + %37 = call i32 @pthread_mutexattr_gettype(ptr noundef %13, ptr noundef %12), !dbg !231 + store i32 %37, ptr %11, align 4, !dbg !232 + %38 = load i32, ptr %11, align 4, !dbg !233 + %39 = icmp eq i32 %38, 0, !dbg !233 + %40 = xor i1 %39, true, !dbg !233 + %41 = zext i1 %40 to i32, !dbg !233 + %42 = sext i32 %41 to i64, !dbg !233 + %43 = icmp ne i64 %42, 0, !dbg !233 + br i1 %43, label %44, label %46, !dbg !233 44: ; preds = %36 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 54, ptr noundef @.str.1) #4, !dbg !245 - unreachable, !dbg !245 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 54, ptr noundef @.str.1) #4, !dbg !233 + unreachable, !dbg !233 45: ; No predecessors! - br label %47, !dbg !245 + br label %47, !dbg !233 46: ; preds = %36 - br label %47, !dbg !245 + br label %47, !dbg !233 47: ; preds = %46, %45 - %48 = load i32, ptr %8, align 4, !dbg !246 - %49 = call i32 @pthread_mutexattr_setprotocol(ptr noundef %13, i32 noundef %48), !dbg !247 - store i32 %49, ptr %11, align 4, !dbg !248 - %50 = load i32, ptr %11, align 4, !dbg !249 - %51 = icmp eq i32 %50, 0, !dbg !249 - %52 = xor i1 %51, true, !dbg !249 - %53 = zext i1 %52 to i32, !dbg !249 - %54 = sext i32 %53 to i64, !dbg !249 - %55 = icmp ne i64 %54, 0, !dbg !249 - br i1 %55, label %56, label %58, !dbg !249 + %48 = load i32, ptr %8, align 4, !dbg !234 + %49 = call i32 @pthread_mutexattr_setprotocol(ptr noundef %13, i32 noundef %48), !dbg !235 + store i32 %49, ptr %11, align 4, !dbg !236 + %50 = load i32, ptr %11, align 4, !dbg !237 + %51 = icmp eq i32 %50, 0, !dbg !237 + %52 = xor i1 %51, true, !dbg !237 + %53 = zext i1 %52 to i32, !dbg !237 + %54 = sext i32 %53 to i64, !dbg !237 + %55 = icmp ne i64 %54, 0, !dbg !237 + br i1 %55, label %56, label %58, !dbg !237 56: ; preds = %47 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 57, ptr noundef @.str.1) #4, !dbg !249 - unreachable, !dbg !249 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 57, ptr noundef @.str.1) #4, !dbg !237 + unreachable, !dbg !237 57: ; No predecessors! - br label %59, !dbg !249 + br label %59, !dbg !237 58: ; preds = %47 - br label %59, !dbg !249 + br label %59, !dbg !237 59: ; preds = %58, %57 - %60 = call i32 @pthread_mutexattr_getprotocol(ptr noundef %13, ptr noundef %12), !dbg !250 - store i32 %60, ptr %11, align 4, !dbg !251 - %61 = load i32, ptr %11, align 4, !dbg !252 - %62 = icmp eq i32 %61, 0, !dbg !252 - %63 = xor i1 %62, true, !dbg !252 - %64 = zext i1 %63 to i32, !dbg !252 - %65 = sext i32 %64 to i64, !dbg !252 - %66 = icmp ne i64 %65, 0, !dbg !252 - br i1 %66, label %67, label %69, !dbg !252 + %60 = call i32 @pthread_mutexattr_getprotocol(ptr noundef %13, ptr noundef %12), !dbg !238 + store i32 %60, ptr %11, align 4, !dbg !239 + %61 = load i32, ptr %11, align 4, !dbg !240 + %62 = icmp eq i32 %61, 0, !dbg !240 + %63 = xor i1 %62, true, !dbg !240 + %64 = zext i1 %63 to i32, !dbg !240 + %65 = sext i32 %64 to i64, !dbg !240 + %66 = icmp ne i64 %65, 0, !dbg !240 + br i1 %66, label %67, label %69, !dbg !240 67: ; preds = %59 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 59, ptr noundef @.str.1) #4, !dbg !252 - unreachable, !dbg !252 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 59, ptr noundef @.str.1) #4, !dbg !240 + unreachable, !dbg !240 68: ; No predecessors! - br label %70, !dbg !252 + br label %70, !dbg !240 69: ; preds = %59 - br label %70, !dbg !252 + br label %70, !dbg !240 70: ; preds = %69, %68 - %71 = load i32, ptr %9, align 4, !dbg !253 - %72 = call i32 @pthread_mutexattr_setpolicy_np(ptr noundef %13, i32 noundef %71), !dbg !254 - store i32 %72, ptr %11, align 4, !dbg !255 - %73 = load i32, ptr %11, align 4, !dbg !256 - %74 = icmp eq i32 %73, 0, !dbg !256 - %75 = xor i1 %74, true, !dbg !256 - %76 = zext i1 %75 to i32, !dbg !256 - %77 = sext i32 %76 to i64, !dbg !256 - %78 = icmp ne i64 %77, 0, !dbg !256 - br i1 %78, label %79, label %81, !dbg !256 + %71 = load i32, ptr %9, align 4, !dbg !241 + %72 = call i32 @pthread_mutexattr_setpolicy_np(ptr noundef %13, i32 noundef %71), !dbg !242 + store i32 %72, ptr %11, align 4, !dbg !243 + %73 = load i32, ptr %11, align 4, !dbg !244 + %74 = icmp eq i32 %73, 0, !dbg !244 + %75 = xor i1 %74, true, !dbg !244 + %76 = zext i1 %75 to i32, !dbg !244 + %77 = sext i32 %76 to i64, !dbg !244 + %78 = icmp ne i64 %77, 0, !dbg !244 + br i1 %78, label %79, label %81, !dbg !244 79: ; preds = %70 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 62, ptr noundef @.str.1) #4, !dbg !256 - unreachable, !dbg !256 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 62, ptr noundef @.str.1) #4, !dbg !244 + unreachable, !dbg !244 80: ; No predecessors! - br label %82, !dbg !256 + br label %82, !dbg !244 81: ; preds = %70 - br label %82, !dbg !256 + br label %82, !dbg !244 82: ; preds = %81, %80 - %83 = call i32 @pthread_mutexattr_getpolicy_np(ptr noundef %13, ptr noundef %12), !dbg !257 - store i32 %83, ptr %11, align 4, !dbg !258 - %84 = load i32, ptr %11, align 4, !dbg !259 - %85 = icmp eq i32 %84, 0, !dbg !259 - %86 = xor i1 %85, true, !dbg !259 - %87 = zext i1 %86 to i32, !dbg !259 - %88 = sext i32 %87 to i64, !dbg !259 - %89 = icmp ne i64 %88, 0, !dbg !259 - br i1 %89, label %90, label %92, !dbg !259 + %83 = call i32 @pthread_mutexattr_getpolicy_np(ptr noundef %13, ptr noundef %12), !dbg !245 + store i32 %83, ptr %11, align 4, !dbg !246 + %84 = load i32, ptr %11, align 4, !dbg !247 + %85 = icmp eq i32 %84, 0, !dbg !247 + %86 = xor i1 %85, true, !dbg !247 + %87 = zext i1 %86 to i32, !dbg !247 + %88 = sext i32 %87 to i64, !dbg !247 + %89 = icmp ne i64 %88, 0, !dbg !247 + br i1 %89, label %90, label %92, !dbg !247 90: ; preds = %82 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 64, ptr noundef @.str.1) #4, !dbg !259 - unreachable, !dbg !259 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 64, ptr noundef @.str.1) #4, !dbg !247 + unreachable, !dbg !247 91: ; No predecessors! - br label %93, !dbg !259 + br label %93, !dbg !247 92: ; preds = %82 - br label %93, !dbg !259 + br label %93, !dbg !247 93: ; preds = %92, %91 - %94 = load i32, ptr %10, align 4, !dbg !260 - %95 = call i32 @pthread_mutexattr_setprioceiling(ptr noundef %13, i32 noundef %94), !dbg !261 - store i32 %95, ptr %11, align 4, !dbg !262 - %96 = load i32, ptr %11, align 4, !dbg !263 - %97 = icmp eq i32 %96, 0, !dbg !263 - %98 = xor i1 %97, true, !dbg !263 - %99 = zext i1 %98 to i32, !dbg !263 - %100 = sext i32 %99 to i64, !dbg !263 - %101 = icmp ne i64 %100, 0, !dbg !263 - br i1 %101, label %102, label %104, !dbg !263 + %94 = load i32, ptr %10, align 4, !dbg !248 + %95 = call i32 @pthread_mutexattr_setprioceiling(ptr noundef %13, i32 noundef %94), !dbg !249 + store i32 %95, ptr %11, align 4, !dbg !250 + %96 = load i32, ptr %11, align 4, !dbg !251 + %97 = icmp eq i32 %96, 0, !dbg !251 + %98 = xor i1 %97, true, !dbg !251 + %99 = zext i1 %98 to i32, !dbg !251 + %100 = sext i32 %99 to i64, !dbg !251 + %101 = icmp ne i64 %100, 0, !dbg !251 + br i1 %101, label %102, label %104, !dbg !251 102: ; preds = %93 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 67, ptr noundef @.str.1) #4, !dbg !263 - unreachable, !dbg !263 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 67, ptr noundef @.str.1) #4, !dbg !251 + unreachable, !dbg !251 103: ; No predecessors! - br label %105, !dbg !263 + br label %105, !dbg !251 104: ; preds = %93 - br label %105, !dbg !263 + br label %105, !dbg !251 105: ; preds = %104, %103 - %106 = call i32 @pthread_mutexattr_getprioceiling(ptr noundef %13, ptr noundef %12), !dbg !264 - store i32 %106, ptr %11, align 4, !dbg !265 - %107 = load i32, ptr %11, align 4, !dbg !266 - %108 = icmp eq i32 %107, 0, !dbg !266 - %109 = xor i1 %108, true, !dbg !266 - %110 = zext i1 %109 to i32, !dbg !266 - %111 = sext i32 %110 to i64, !dbg !266 - %112 = icmp ne i64 %111, 0, !dbg !266 - br i1 %112, label %113, label %115, !dbg !266 + %106 = call i32 @pthread_mutexattr_getprioceiling(ptr noundef %13, ptr noundef %12), !dbg !252 + store i32 %106, ptr %11, align 4, !dbg !253 + %107 = load i32, ptr %11, align 4, !dbg !254 + %108 = icmp eq i32 %107, 0, !dbg !254 + %109 = xor i1 %108, true, !dbg !254 + %110 = zext i1 %109 to i32, !dbg !254 + %111 = sext i32 %110 to i64, !dbg !254 + %112 = icmp ne i64 %111, 0, !dbg !254 + br i1 %112, label %113, label %115, !dbg !254 113: ; preds = %105 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 69, ptr noundef @.str.1) #4, !dbg !266 - unreachable, !dbg !266 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 69, ptr noundef @.str.1) #4, !dbg !254 + unreachable, !dbg !254 114: ; No predecessors! - br label %116, !dbg !266 + br label %116, !dbg !254 115: ; preds = %105 - br label %116, !dbg !266 + br label %116, !dbg !254 116: ; preds = %115, %114 - %117 = load ptr, ptr %6, align 8, !dbg !267 - %118 = call i32 @pthread_mutex_init(ptr noundef %117, ptr noundef %13), !dbg !268 - store i32 %118, ptr %11, align 4, !dbg !269 - %119 = load i32, ptr %11, align 4, !dbg !270 - %120 = icmp eq i32 %119, 0, !dbg !270 - %121 = xor i1 %120, true, !dbg !270 - %122 = zext i1 %121 to i32, !dbg !270 - %123 = sext i32 %122 to i64, !dbg !270 - %124 = icmp ne i64 %123, 0, !dbg !270 - br i1 %124, label %125, label %127, !dbg !270 + %117 = load ptr, ptr %6, align 8, !dbg !255 + %118 = call i32 @pthread_mutex_init(ptr noundef %117, ptr noundef %13), !dbg !256 + store i32 %118, ptr %11, align 4, !dbg !257 + %119 = load i32, ptr %11, align 4, !dbg !258 + %120 = icmp eq i32 %119, 0, !dbg !258 + %121 = xor i1 %120, true, !dbg !258 + %122 = zext i1 %121 to i32, !dbg !258 + %123 = sext i32 %122 to i64, !dbg !258 + %124 = icmp ne i64 %123, 0, !dbg !258 + br i1 %124, label %125, label %127, !dbg !258 125: ; preds = %116 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 72, ptr noundef @.str.1) #4, !dbg !270 - unreachable, !dbg !270 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 72, ptr noundef @.str.1) #4, !dbg !258 + unreachable, !dbg !258 126: ; No predecessors! - br label %128, !dbg !270 + br label %128, !dbg !258 127: ; preds = %116 - br label %128, !dbg !270 + br label %128, !dbg !258 128: ; preds = %127, %126 - %129 = call i32 @"\01_pthread_mutexattr_destroy"(ptr noundef %13), !dbg !271 - store i32 %129, ptr %11, align 4, !dbg !272 - %130 = load i32, ptr %11, align 4, !dbg !273 - %131 = icmp eq i32 %130, 0, !dbg !273 - %132 = xor i1 %131, true, !dbg !273 - %133 = zext i1 %132 to i32, !dbg !273 - %134 = sext i32 %133 to i64, !dbg !273 - %135 = icmp ne i64 %134, 0, !dbg !273 - br i1 %135, label %136, label %138, !dbg !273 + %129 = call i32 @"\01_pthread_mutexattr_destroy"(ptr noundef %13), !dbg !259 + store i32 %129, ptr %11, align 4, !dbg !260 + %130 = load i32, ptr %11, align 4, !dbg !261 + %131 = icmp eq i32 %130, 0, !dbg !261 + %132 = xor i1 %131, true, !dbg !261 + %133 = zext i1 %132 to i32, !dbg !261 + %134 = sext i32 %133 to i64, !dbg !261 + %135 = icmp ne i64 %134, 0, !dbg !261 + br i1 %135, label %136, label %138, !dbg !261 136: ; preds = %128 - call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 74, ptr noundef @.str.1) #4, !dbg !273 - unreachable, !dbg !273 + call void @__assert_rtn(ptr noundef @__func__.mutex_init, ptr noundef @.str, i32 noundef 74, ptr noundef @.str.1) #4, !dbg !261 + unreachable, !dbg !261 137: ; No predecessors! - br label %139, !dbg !273 + br label %139, !dbg !261 138: ; preds = %128 - br label %139, !dbg !273 + br label %139, !dbg !261 139: ; preds = %138, %137 - ret void, !dbg !274 + ret void, !dbg !262 } declare i32 @pthread_mutexattr_init(ptr noundef) #2 @@ -422,290 +419,290 @@ declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) #2 declare i32 @"\01_pthread_mutexattr_destroy"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_destroy(ptr noundef %0) #0 !dbg !275 { +define void @mutex_destroy(ptr noundef %0) #0 !dbg !263 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !278, metadata !DIExpression()), !dbg !279 - call void @llvm.dbg.declare(metadata ptr %3, metadata !280, metadata !DIExpression()), !dbg !281 - %4 = load ptr, ptr %2, align 8, !dbg !282 - %5 = call i32 @pthread_mutex_destroy(ptr noundef %4), !dbg !283 - store i32 %5, ptr %3, align 4, !dbg !281 - %6 = load i32, ptr %3, align 4, !dbg !284 - %7 = icmp eq i32 %6, 0, !dbg !284 - %8 = xor i1 %7, true, !dbg !284 - %9 = zext i1 %8 to i32, !dbg !284 - %10 = sext i32 %9 to i64, !dbg !284 - %11 = icmp ne i64 %10, 0, !dbg !284 - br i1 %11, label %12, label %14, !dbg !284 + call void @llvm.dbg.declare(metadata ptr %2, metadata !266, metadata !DIExpression()), !dbg !267 + call void @llvm.dbg.declare(metadata ptr %3, metadata !268, metadata !DIExpression()), !dbg !269 + %4 = load ptr, ptr %2, align 8, !dbg !270 + %5 = call i32 @pthread_mutex_destroy(ptr noundef %4), !dbg !271 + store i32 %5, ptr %3, align 4, !dbg !269 + %6 = load i32, ptr %3, align 4, !dbg !272 + %7 = icmp eq i32 %6, 0, !dbg !272 + %8 = xor i1 %7, true, !dbg !272 + %9 = zext i1 %8 to i32, !dbg !272 + %10 = sext i32 %9 to i64, !dbg !272 + %11 = icmp ne i64 %10, 0, !dbg !272 + br i1 %11, label %12, label %14, !dbg !272 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.mutex_destroy, ptr noundef @.str, i32 noundef 80, ptr noundef @.str.1) #4, !dbg !284 - unreachable, !dbg !284 + call void @__assert_rtn(ptr noundef @__func__.mutex_destroy, ptr noundef @.str, i32 noundef 80, ptr noundef @.str.1) #4, !dbg !272 + unreachable, !dbg !272 13: ; No predecessors! - br label %15, !dbg !284 + br label %15, !dbg !272 14: ; preds = %1 - br label %15, !dbg !284 + br label %15, !dbg !272 15: ; preds = %14, %13 - ret void, !dbg !285 + ret void, !dbg !273 } declare i32 @pthread_mutex_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_lock(ptr noundef %0) #0 !dbg !286 { +define void @mutex_lock(ptr noundef %0) #0 !dbg !274 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !287, metadata !DIExpression()), !dbg !288 - call void @llvm.dbg.declare(metadata ptr %3, metadata !289, metadata !DIExpression()), !dbg !290 - %4 = load ptr, ptr %2, align 8, !dbg !291 - %5 = call i32 @pthread_mutex_lock(ptr noundef %4), !dbg !292 - store i32 %5, ptr %3, align 4, !dbg !290 - %6 = load i32, ptr %3, align 4, !dbg !293 - %7 = icmp eq i32 %6, 0, !dbg !293 - %8 = xor i1 %7, true, !dbg !293 - %9 = zext i1 %8 to i32, !dbg !293 - %10 = sext i32 %9 to i64, !dbg !293 - %11 = icmp ne i64 %10, 0, !dbg !293 - br i1 %11, label %12, label %14, !dbg !293 + call void @llvm.dbg.declare(metadata ptr %2, metadata !275, metadata !DIExpression()), !dbg !276 + call void @llvm.dbg.declare(metadata ptr %3, metadata !277, metadata !DIExpression()), !dbg !278 + %4 = load ptr, ptr %2, align 8, !dbg !279 + %5 = call i32 @pthread_mutex_lock(ptr noundef %4), !dbg !280 + store i32 %5, ptr %3, align 4, !dbg !278 + %6 = load i32, ptr %3, align 4, !dbg !281 + %7 = icmp eq i32 %6, 0, !dbg !281 + %8 = xor i1 %7, true, !dbg !281 + %9 = zext i1 %8 to i32, !dbg !281 + %10 = sext i32 %9 to i64, !dbg !281 + %11 = icmp ne i64 %10, 0, !dbg !281 + br i1 %11, label %12, label %14, !dbg !281 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.mutex_lock, ptr noundef @.str, i32 noundef 86, ptr noundef @.str.1) #4, !dbg !293 - unreachable, !dbg !293 + call void @__assert_rtn(ptr noundef @__func__.mutex_lock, ptr noundef @.str, i32 noundef 86, ptr noundef @.str.1) #4, !dbg !281 + unreachable, !dbg !281 13: ; No predecessors! - br label %15, !dbg !293 + br label %15, !dbg !281 14: ; preds = %1 - br label %15, !dbg !293 + br label %15, !dbg !281 15: ; preds = %14, %13 - ret void, !dbg !294 + ret void, !dbg !282 } declare i32 @pthread_mutex_lock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define zeroext i1 @mutex_trylock(ptr noundef %0) #0 !dbg !295 { +define zeroext i1 @mutex_trylock(ptr noundef %0) #0 !dbg !283 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !299, metadata !DIExpression()), !dbg !300 - call void @llvm.dbg.declare(metadata ptr %3, metadata !301, metadata !DIExpression()), !dbg !302 - %4 = load ptr, ptr %2, align 8, !dbg !303 - %5 = call i32 @pthread_mutex_trylock(ptr noundef %4), !dbg !304 - store i32 %5, ptr %3, align 4, !dbg !302 - %6 = load i32, ptr %3, align 4, !dbg !305 - %7 = icmp eq i32 %6, 0, !dbg !306 - ret i1 %7, !dbg !307 + call void @llvm.dbg.declare(metadata ptr %2, metadata !287, metadata !DIExpression()), !dbg !288 + call void @llvm.dbg.declare(metadata ptr %3, metadata !289, metadata !DIExpression()), !dbg !290 + %4 = load ptr, ptr %2, align 8, !dbg !291 + %5 = call i32 @pthread_mutex_trylock(ptr noundef %4), !dbg !292 + store i32 %5, ptr %3, align 4, !dbg !290 + %6 = load i32, ptr %3, align 4, !dbg !293 + %7 = icmp eq i32 %6, 0, !dbg !294 + ret i1 %7, !dbg !295 } declare i32 @pthread_mutex_trylock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_unlock(ptr noundef %0) #0 !dbg !308 { +define void @mutex_unlock(ptr noundef %0) #0 !dbg !296 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !309, metadata !DIExpression()), !dbg !310 - call void @llvm.dbg.declare(metadata ptr %3, metadata !311, metadata !DIExpression()), !dbg !312 - %4 = load ptr, ptr %2, align 8, !dbg !313 - %5 = call i32 @pthread_mutex_unlock(ptr noundef %4), !dbg !314 - store i32 %5, ptr %3, align 4, !dbg !312 - %6 = load i32, ptr %3, align 4, !dbg !315 - %7 = icmp eq i32 %6, 0, !dbg !315 - %8 = xor i1 %7, true, !dbg !315 - %9 = zext i1 %8 to i32, !dbg !315 - %10 = sext i32 %9 to i64, !dbg !315 - %11 = icmp ne i64 %10, 0, !dbg !315 - br i1 %11, label %12, label %14, !dbg !315 + call void @llvm.dbg.declare(metadata ptr %2, metadata !297, metadata !DIExpression()), !dbg !298 + call void @llvm.dbg.declare(metadata ptr %3, metadata !299, metadata !DIExpression()), !dbg !300 + %4 = load ptr, ptr %2, align 8, !dbg !301 + %5 = call i32 @pthread_mutex_unlock(ptr noundef %4), !dbg !302 + store i32 %5, ptr %3, align 4, !dbg !300 + %6 = load i32, ptr %3, align 4, !dbg !303 + %7 = icmp eq i32 %6, 0, !dbg !303 + %8 = xor i1 %7, true, !dbg !303 + %9 = zext i1 %8 to i32, !dbg !303 + %10 = sext i32 %9 to i64, !dbg !303 + %11 = icmp ne i64 %10, 0, !dbg !303 + br i1 %11, label %12, label %14, !dbg !303 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.mutex_unlock, ptr noundef @.str, i32 noundef 99, ptr noundef @.str.1) #4, !dbg !315 - unreachable, !dbg !315 + call void @__assert_rtn(ptr noundef @__func__.mutex_unlock, ptr noundef @.str, i32 noundef 99, ptr noundef @.str.1) #4, !dbg !303 + unreachable, !dbg !303 13: ; No predecessors! - br label %15, !dbg !315 + br label %15, !dbg !303 14: ; preds = %1 - br label %15, !dbg !315 + br label %15, !dbg !303 15: ; preds = %14, %13 - ret void, !dbg !316 + ret void, !dbg !304 } declare i32 @pthread_mutex_unlock(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @mutex_test() #0 !dbg !317 { +define void @mutex_test() #0 !dbg !305 { %1 = alloca %struct._opaque_pthread_mutex_t, align 8 %2 = alloca %struct._opaque_pthread_mutex_t, align 8 %3 = alloca i8, align 1 %4 = alloca i8, align 1 %5 = alloca i8, align 1 - call void @llvm.dbg.declare(metadata ptr %1, metadata !320, metadata !DIExpression()), !dbg !321 - call void @llvm.dbg.declare(metadata ptr %2, metadata !322, metadata !DIExpression()), !dbg !323 - call void @mutex_init(ptr noundef %1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1), !dbg !324 - call void @mutex_init(ptr noundef %2, i32 noundef 2, i32 noundef 2, i32 noundef 3, i32 noundef 2), !dbg !325 - call void @mutex_lock(ptr noundef %1), !dbg !326 - call void @llvm.dbg.declare(metadata ptr %3, metadata !328, metadata !DIExpression()), !dbg !329 - %6 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !330 - %7 = zext i1 %6 to i8, !dbg !329 - store i8 %7, ptr %3, align 1, !dbg !329 - %8 = load i8, ptr %3, align 1, !dbg !331 - %9 = trunc i8 %8 to i1, !dbg !331 - %10 = xor i1 %9, true, !dbg !331 - %11 = xor i1 %10, true, !dbg !331 - %12 = zext i1 %11 to i32, !dbg !331 - %13 = sext i32 %12 to i64, !dbg !331 - %14 = icmp ne i64 %13, 0, !dbg !331 - br i1 %14, label %15, label %17, !dbg !331 + call void @llvm.dbg.declare(metadata ptr %1, metadata !308, metadata !DIExpression()), !dbg !309 + call void @llvm.dbg.declare(metadata ptr %2, metadata !310, metadata !DIExpression()), !dbg !311 + call void @mutex_init(ptr noundef %1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1), !dbg !312 + call void @mutex_init(ptr noundef %2, i32 noundef 2, i32 noundef 2, i32 noundef 3, i32 noundef 2), !dbg !313 + call void @mutex_lock(ptr noundef %1), !dbg !314 + call void @llvm.dbg.declare(metadata ptr %3, metadata !316, metadata !DIExpression()), !dbg !317 + %6 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !318 + %7 = zext i1 %6 to i8, !dbg !317 + store i8 %7, ptr %3, align 1, !dbg !317 + %8 = load i8, ptr %3, align 1, !dbg !319 + %9 = trunc i8 %8 to i1, !dbg !319 + %10 = xor i1 %9, true, !dbg !319 + %11 = xor i1 %10, true, !dbg !319 + %12 = zext i1 %11 to i32, !dbg !319 + %13 = sext i32 %12 to i64, !dbg !319 + %14 = icmp ne i64 %13, 0, !dbg !319 + br i1 %14, label %15, label %17, !dbg !319 15: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 113, ptr noundef @.str.2) #4, !dbg !331 - unreachable, !dbg !331 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 113, ptr noundef @.str.2) #4, !dbg !319 + unreachable, !dbg !319 16: ; No predecessors! - br label %18, !dbg !331 + br label %18, !dbg !319 17: ; preds = %0 - br label %18, !dbg !331 + br label %18, !dbg !319 18: ; preds = %17, %16 - call void @mutex_unlock(ptr noundef %1), !dbg !332 - call void @mutex_lock(ptr noundef %2), !dbg !333 - call void @llvm.dbg.declare(metadata ptr %4, metadata !335, metadata !DIExpression()), !dbg !337 - %19 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !338 - %20 = zext i1 %19 to i8, !dbg !337 - store i8 %20, ptr %4, align 1, !dbg !337 - %21 = load i8, ptr %4, align 1, !dbg !339 - %22 = trunc i8 %21 to i1, !dbg !339 - %23 = xor i1 %22, true, !dbg !339 - %24 = zext i1 %23 to i32, !dbg !339 - %25 = sext i32 %24 to i64, !dbg !339 - %26 = icmp ne i64 %25, 0, !dbg !339 - br i1 %26, label %27, label %29, !dbg !339 + call void @mutex_unlock(ptr noundef %1), !dbg !320 + call void @mutex_lock(ptr noundef %2), !dbg !321 + call void @llvm.dbg.declare(metadata ptr %4, metadata !323, metadata !DIExpression()), !dbg !325 + %19 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !326 + %20 = zext i1 %19 to i8, !dbg !325 + store i8 %20, ptr %4, align 1, !dbg !325 + %21 = load i8, ptr %4, align 1, !dbg !327 + %22 = trunc i8 %21 to i1, !dbg !327 + %23 = xor i1 %22, true, !dbg !327 + %24 = zext i1 %23 to i32, !dbg !327 + %25 = sext i32 %24 to i64, !dbg !327 + %26 = icmp ne i64 %25, 0, !dbg !327 + br i1 %26, label %27, label %29, !dbg !327 27: ; preds = %18 - call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 122, ptr noundef @.str.3) #4, !dbg !339 - unreachable, !dbg !339 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 122, ptr noundef @.str.3) #4, !dbg !327 + unreachable, !dbg !327 28: ; No predecessors! - br label %30, !dbg !339 + br label %30, !dbg !327 29: ; preds = %18 - br label %30, !dbg !339 + br label %30, !dbg !327 30: ; preds = %29, %28 - call void @mutex_unlock(ptr noundef %1), !dbg !340 - call void @llvm.dbg.declare(metadata ptr %5, metadata !341, metadata !DIExpression()), !dbg !343 - %31 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !344 - %32 = zext i1 %31 to i8, !dbg !343 - store i8 %32, ptr %5, align 1, !dbg !343 - %33 = load i8, ptr %5, align 1, !dbg !345 - %34 = trunc i8 %33 to i1, !dbg !345 - %35 = xor i1 %34, true, !dbg !345 - %36 = zext i1 %35 to i32, !dbg !345 - %37 = sext i32 %36 to i64, !dbg !345 - %38 = icmp ne i64 %37, 0, !dbg !345 - br i1 %38, label %39, label %41, !dbg !345 + call void @mutex_unlock(ptr noundef %1), !dbg !328 + call void @llvm.dbg.declare(metadata ptr %5, metadata !329, metadata !DIExpression()), !dbg !331 + %31 = call zeroext i1 @mutex_trylock(ptr noundef %1), !dbg !332 + %32 = zext i1 %31 to i8, !dbg !331 + store i8 %32, ptr %5, align 1, !dbg !331 + %33 = load i8, ptr %5, align 1, !dbg !333 + %34 = trunc i8 %33 to i1, !dbg !333 + %35 = xor i1 %34, true, !dbg !333 + %36 = zext i1 %35 to i32, !dbg !333 + %37 = sext i32 %36 to i64, !dbg !333 + %38 = icmp ne i64 %37, 0, !dbg !333 + br i1 %38, label %39, label %41, !dbg !333 39: ; preds = %30 - call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 128, ptr noundef @.str.3) #4, !dbg !345 - unreachable, !dbg !345 + call void @__assert_rtn(ptr noundef @__func__.mutex_test, ptr noundef @.str, i32 noundef 128, ptr noundef @.str.3) #4, !dbg !333 + unreachable, !dbg !333 40: ; No predecessors! - br label %42, !dbg !345 + br label %42, !dbg !333 41: ; preds = %30 - br label %42, !dbg !345 + br label %42, !dbg !333 42: ; preds = %41, %40 - call void @mutex_unlock(ptr noundef %1), !dbg !346 - call void @mutex_unlock(ptr noundef %2), !dbg !347 - call void @mutex_destroy(ptr noundef %2), !dbg !348 - call void @mutex_destroy(ptr noundef %1), !dbg !349 - ret void, !dbg !350 + call void @mutex_unlock(ptr noundef %1), !dbg !334 + call void @mutex_unlock(ptr noundef %2), !dbg !335 + call void @mutex_destroy(ptr noundef %2), !dbg !336 + call void @mutex_destroy(ptr noundef %1), !dbg !337 + ret void, !dbg !338 } ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_init(ptr noundef %0) #0 !dbg !351 { +define void @cond_init(ptr noundef %0) #0 !dbg !339 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 %4 = alloca %struct._opaque_pthread_condattr_t, align 8 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !355, metadata !DIExpression()), !dbg !356 - call void @llvm.dbg.declare(metadata ptr %3, metadata !357, metadata !DIExpression()), !dbg !358 - call void @llvm.dbg.declare(metadata ptr %4, metadata !359, metadata !DIExpression()), !dbg !367 - %5 = call i32 @pthread_condattr_init(ptr noundef %4), !dbg !368 - store i32 %5, ptr %3, align 4, !dbg !369 - %6 = load i32, ptr %3, align 4, !dbg !370 - %7 = icmp eq i32 %6, 0, !dbg !370 - %8 = xor i1 %7, true, !dbg !370 - %9 = zext i1 %8 to i32, !dbg !370 - %10 = sext i32 %9 to i64, !dbg !370 - %11 = icmp ne i64 %10, 0, !dbg !370 - br i1 %11, label %12, label %14, !dbg !370 + call void @llvm.dbg.declare(metadata ptr %2, metadata !343, metadata !DIExpression()), !dbg !344 + call void @llvm.dbg.declare(metadata ptr %3, metadata !345, metadata !DIExpression()), !dbg !346 + call void @llvm.dbg.declare(metadata ptr %4, metadata !347, metadata !DIExpression()), !dbg !355 + %5 = call i32 @pthread_condattr_init(ptr noundef %4), !dbg !356 + store i32 %5, ptr %3, align 4, !dbg !357 + %6 = load i32, ptr %3, align 4, !dbg !358 + %7 = icmp eq i32 %6, 0, !dbg !358 + %8 = xor i1 %7, true, !dbg !358 + %9 = zext i1 %8 to i32, !dbg !358 + %10 = sext i32 %9 to i64, !dbg !358 + %11 = icmp ne i64 %10, 0, !dbg !358 + br i1 %11, label %12, label %14, !dbg !358 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 154, ptr noundef @.str.1) #4, !dbg !370 - unreachable, !dbg !370 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 154, ptr noundef @.str.1) #4, !dbg !358 + unreachable, !dbg !358 13: ; No predecessors! - br label %15, !dbg !370 + br label %15, !dbg !358 14: ; preds = %1 - br label %15, !dbg !370 + br label %15, !dbg !358 15: ; preds = %14, %13 - %16 = load ptr, ptr %2, align 8, !dbg !371 - %17 = call i32 @"\01_pthread_cond_init"(ptr noundef %16, ptr noundef %4), !dbg !372 - store i32 %17, ptr %3, align 4, !dbg !373 - %18 = load i32, ptr %3, align 4, !dbg !374 - %19 = icmp eq i32 %18, 0, !dbg !374 - %20 = xor i1 %19, true, !dbg !374 - %21 = zext i1 %20 to i32, !dbg !374 - %22 = sext i32 %21 to i64, !dbg !374 - %23 = icmp ne i64 %22, 0, !dbg !374 - br i1 %23, label %24, label %26, !dbg !374 + %16 = load ptr, ptr %2, align 8, !dbg !359 + %17 = call i32 @"\01_pthread_cond_init"(ptr noundef %16, ptr noundef %4), !dbg !360 + store i32 %17, ptr %3, align 4, !dbg !361 + %18 = load i32, ptr %3, align 4, !dbg !362 + %19 = icmp eq i32 %18, 0, !dbg !362 + %20 = xor i1 %19, true, !dbg !362 + %21 = zext i1 %20 to i32, !dbg !362 + %22 = sext i32 %21 to i64, !dbg !362 + %23 = icmp ne i64 %22, 0, !dbg !362 + br i1 %23, label %24, label %26, !dbg !362 24: ; preds = %15 - call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 157, ptr noundef @.str.1) #4, !dbg !374 - unreachable, !dbg !374 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 157, ptr noundef @.str.1) #4, !dbg !362 + unreachable, !dbg !362 25: ; No predecessors! - br label %27, !dbg !374 + br label %27, !dbg !362 26: ; preds = %15 - br label %27, !dbg !374 + br label %27, !dbg !362 27: ; preds = %26, %25 - %28 = call i32 @pthread_condattr_destroy(ptr noundef %4), !dbg !375 - store i32 %28, ptr %3, align 4, !dbg !376 - %29 = load i32, ptr %3, align 4, !dbg !377 - %30 = icmp eq i32 %29, 0, !dbg !377 - %31 = xor i1 %30, true, !dbg !377 - %32 = zext i1 %31 to i32, !dbg !377 - %33 = sext i32 %32 to i64, !dbg !377 - %34 = icmp ne i64 %33, 0, !dbg !377 - br i1 %34, label %35, label %37, !dbg !377 + %28 = call i32 @pthread_condattr_destroy(ptr noundef %4), !dbg !363 + store i32 %28, ptr %3, align 4, !dbg !364 + %29 = load i32, ptr %3, align 4, !dbg !365 + %30 = icmp eq i32 %29, 0, !dbg !365 + %31 = xor i1 %30, true, !dbg !365 + %32 = zext i1 %31 to i32, !dbg !365 + %33 = sext i32 %32 to i64, !dbg !365 + %34 = icmp ne i64 %33, 0, !dbg !365 + br i1 %34, label %35, label %37, !dbg !365 35: ; preds = %27 - call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 160, ptr noundef @.str.1) #4, !dbg !377 - unreachable, !dbg !377 + call void @__assert_rtn(ptr noundef @__func__.cond_init, ptr noundef @.str, i32 noundef 160, ptr noundef @.str.1) #4, !dbg !365 + unreachable, !dbg !365 36: ; No predecessors! - br label %38, !dbg !377 + br label %38, !dbg !365 37: ; preds = %27 - br label %38, !dbg !377 + br label %38, !dbg !365 38: ; preds = %37, %36 - ret void, !dbg !378 + ret void, !dbg !366 } declare i32 @pthread_condattr_init(ptr noundef) #2 @@ -715,394 +712,374 @@ declare i32 @"\01_pthread_cond_init"(ptr noundef, ptr noundef) #2 declare i32 @pthread_condattr_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_destroy(ptr noundef %0) #0 !dbg !379 { +define void @cond_destroy(ptr noundef %0) #0 !dbg !367 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !380, metadata !DIExpression()), !dbg !381 - call void @llvm.dbg.declare(metadata ptr %3, metadata !382, metadata !DIExpression()), !dbg !383 - %4 = load ptr, ptr %2, align 8, !dbg !384 - %5 = call i32 @pthread_cond_destroy(ptr noundef %4), !dbg !385 - store i32 %5, ptr %3, align 4, !dbg !383 - %6 = load i32, ptr %3, align 4, !dbg !386 - %7 = icmp eq i32 %6, 0, !dbg !386 - %8 = xor i1 %7, true, !dbg !386 - %9 = zext i1 %8 to i32, !dbg !386 - %10 = sext i32 %9 to i64, !dbg !386 - %11 = icmp ne i64 %10, 0, !dbg !386 - br i1 %11, label %12, label %14, !dbg !386 + call void @llvm.dbg.declare(metadata ptr %2, metadata !368, metadata !DIExpression()), !dbg !369 + call void @llvm.dbg.declare(metadata ptr %3, metadata !370, metadata !DIExpression()), !dbg !371 + %4 = load ptr, ptr %2, align 8, !dbg !372 + %5 = call i32 @pthread_cond_destroy(ptr noundef %4), !dbg !373 + store i32 %5, ptr %3, align 4, !dbg !371 + %6 = load i32, ptr %3, align 4, !dbg !374 + %7 = icmp eq i32 %6, 0, !dbg !374 + %8 = xor i1 %7, true, !dbg !374 + %9 = zext i1 %8 to i32, !dbg !374 + %10 = sext i32 %9 to i64, !dbg !374 + %11 = icmp ne i64 %10, 0, !dbg !374 + br i1 %11, label %12, label %14, !dbg !374 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_destroy, ptr noundef @.str, i32 noundef 166, ptr noundef @.str.1) #4, !dbg !386 - unreachable, !dbg !386 + call void @__assert_rtn(ptr noundef @__func__.cond_destroy, ptr noundef @.str, i32 noundef 166, ptr noundef @.str.1) #4, !dbg !374 + unreachable, !dbg !374 13: ; No predecessors! - br label %15, !dbg !386 + br label %15, !dbg !374 14: ; preds = %1 - br label %15, !dbg !386 + br label %15, !dbg !374 15: ; preds = %14, %13 - ret void, !dbg !387 + ret void, !dbg !375 } declare i32 @pthread_cond_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_signal(ptr noundef %0) #0 !dbg !388 { +define void @cond_signal(ptr noundef %0) #0 !dbg !376 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !389, metadata !DIExpression()), !dbg !390 - call void @llvm.dbg.declare(metadata ptr %3, metadata !391, metadata !DIExpression()), !dbg !392 - %4 = load ptr, ptr %2, align 8, !dbg !393 - %5 = call i32 @pthread_cond_signal(ptr noundef %4), !dbg !394 - store i32 %5, ptr %3, align 4, !dbg !392 - %6 = load i32, ptr %3, align 4, !dbg !395 - %7 = icmp eq i32 %6, 0, !dbg !395 - %8 = xor i1 %7, true, !dbg !395 - %9 = zext i1 %8 to i32, !dbg !395 - %10 = sext i32 %9 to i64, !dbg !395 - %11 = icmp ne i64 %10, 0, !dbg !395 - br i1 %11, label %12, label %14, !dbg !395 + call void @llvm.dbg.declare(metadata ptr %2, metadata !377, metadata !DIExpression()), !dbg !378 + call void @llvm.dbg.declare(metadata ptr %3, metadata !379, metadata !DIExpression()), !dbg !380 + %4 = load ptr, ptr %2, align 8, !dbg !381 + %5 = call i32 @pthread_cond_signal(ptr noundef %4), !dbg !382 + store i32 %5, ptr %3, align 4, !dbg !380 + %6 = load i32, ptr %3, align 4, !dbg !383 + %7 = icmp eq i32 %6, 0, !dbg !383 + %8 = xor i1 %7, true, !dbg !383 + %9 = zext i1 %8 to i32, !dbg !383 + %10 = sext i32 %9 to i64, !dbg !383 + %11 = icmp ne i64 %10, 0, !dbg !383 + br i1 %11, label %12, label %14, !dbg !383 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_signal, ptr noundef @.str, i32 noundef 172, ptr noundef @.str.1) #4, !dbg !395 - unreachable, !dbg !395 + call void @__assert_rtn(ptr noundef @__func__.cond_signal, ptr noundef @.str, i32 noundef 172, ptr noundef @.str.1) #4, !dbg !383 + unreachable, !dbg !383 13: ; No predecessors! - br label %15, !dbg !395 + br label %15, !dbg !383 14: ; preds = %1 - br label %15, !dbg !395 + br label %15, !dbg !383 15: ; preds = %14, %13 - ret void, !dbg !396 + ret void, !dbg !384 } declare i32 @pthread_cond_signal(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_broadcast(ptr noundef %0) #0 !dbg !397 { +define void @cond_broadcast(ptr noundef %0) #0 !dbg !385 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !398, metadata !DIExpression()), !dbg !399 - call void @llvm.dbg.declare(metadata ptr %3, metadata !400, metadata !DIExpression()), !dbg !401 - %4 = load ptr, ptr %2, align 8, !dbg !402 - %5 = call i32 @pthread_cond_broadcast(ptr noundef %4), !dbg !403 - store i32 %5, ptr %3, align 4, !dbg !401 - %6 = load i32, ptr %3, align 4, !dbg !404 - %7 = icmp eq i32 %6, 0, !dbg !404 - %8 = xor i1 %7, true, !dbg !404 - %9 = zext i1 %8 to i32, !dbg !404 - %10 = sext i32 %9 to i64, !dbg !404 - %11 = icmp ne i64 %10, 0, !dbg !404 - br i1 %11, label %12, label %14, !dbg !404 + call void @llvm.dbg.declare(metadata ptr %2, metadata !386, metadata !DIExpression()), !dbg !387 + call void @llvm.dbg.declare(metadata ptr %3, metadata !388, metadata !DIExpression()), !dbg !389 + %4 = load ptr, ptr %2, align 8, !dbg !390 + %5 = call i32 @pthread_cond_broadcast(ptr noundef %4), !dbg !391 + store i32 %5, ptr %3, align 4, !dbg !389 + %6 = load i32, ptr %3, align 4, !dbg !392 + %7 = icmp eq i32 %6, 0, !dbg !392 + %8 = xor i1 %7, true, !dbg !392 + %9 = zext i1 %8 to i32, !dbg !392 + %10 = sext i32 %9 to i64, !dbg !392 + %11 = icmp ne i64 %10, 0, !dbg !392 + br i1 %11, label %12, label %14, !dbg !392 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.cond_broadcast, ptr noundef @.str, i32 noundef 178, ptr noundef @.str.1) #4, !dbg !404 - unreachable, !dbg !404 + call void @__assert_rtn(ptr noundef @__func__.cond_broadcast, ptr noundef @.str, i32 noundef 178, ptr noundef @.str.1) #4, !dbg !392 + unreachable, !dbg !392 13: ; No predecessors! - br label %15, !dbg !404 + br label %15, !dbg !392 14: ; preds = %1 - br label %15, !dbg !404 + br label %15, !dbg !392 15: ; preds = %14, %13 - ret void, !dbg !405 + ret void, !dbg !393 } declare i32 @pthread_cond_broadcast(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_wait(ptr noundef %0, ptr noundef %1) #0 !dbg !406 { +define void @cond_wait(ptr noundef %0, ptr noundef %1) #0 !dbg !394 { %3 = alloca ptr, align 8 %4 = alloca ptr, align 8 %5 = alloca i32, align 4 store ptr %0, ptr %3, align 8 - call void @llvm.dbg.declare(metadata ptr %3, metadata !409, metadata !DIExpression()), !dbg !410 + call void @llvm.dbg.declare(metadata ptr %3, metadata !397, metadata !DIExpression()), !dbg !398 store ptr %1, ptr %4, align 8 - call void @llvm.dbg.declare(metadata ptr %4, metadata !411, metadata !DIExpression()), !dbg !412 - call void @llvm.dbg.declare(metadata ptr %5, metadata !413, metadata !DIExpression()), !dbg !414 - %6 = load ptr, ptr %3, align 8, !dbg !415 - %7 = load ptr, ptr %4, align 8, !dbg !416 - %8 = call i32 @"\01_pthread_cond_wait"(ptr noundef %6, ptr noundef %7), !dbg !417 - store i32 %8, ptr %5, align 4, !dbg !414 - ret void, !dbg !418 + call void @llvm.dbg.declare(metadata ptr %4, metadata !399, metadata !DIExpression()), !dbg !400 + call void @llvm.dbg.declare(metadata ptr %5, metadata !401, metadata !DIExpression()), !dbg !402 + %6 = load ptr, ptr %3, align 8, !dbg !403 + %7 = load ptr, ptr %4, align 8, !dbg !404 + %8 = call i32 @"\01_pthread_cond_wait"(ptr noundef %6, ptr noundef %7), !dbg !405 + store i32 %8, ptr %5, align 4, !dbg !402 + ret void, !dbg !406 } declare i32 @"\01_pthread_cond_wait"(ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 !dbg !419 { +define void @cond_timedwait(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 !dbg !407 { %4 = alloca ptr, align 8 %5 = alloca ptr, align 8 %6 = alloca i64, align 8 %7 = alloca %struct.timespec, align 8 %8 = alloca i32, align 4 store ptr %0, ptr %4, align 8 - call void @llvm.dbg.declare(metadata ptr %4, metadata !423, metadata !DIExpression()), !dbg !424 + call void @llvm.dbg.declare(metadata ptr %4, metadata !411, metadata !DIExpression()), !dbg !412 store ptr %1, ptr %5, align 8 - call void @llvm.dbg.declare(metadata ptr %5, metadata !425, metadata !DIExpression()), !dbg !426 + call void @llvm.dbg.declare(metadata ptr %5, metadata !413, metadata !DIExpression()), !dbg !414 store i64 %2, ptr %6, align 8 - call void @llvm.dbg.declare(metadata ptr %6, metadata !427, metadata !DIExpression()), !dbg !428 - call void @llvm.dbg.declare(metadata ptr %7, metadata !429, metadata !DIExpression()), !dbg !437 - %9 = load i64, ptr %6, align 8, !dbg !438 - call void @llvm.dbg.declare(metadata ptr %8, metadata !439, metadata !DIExpression()), !dbg !440 - %10 = load ptr, ptr %4, align 8, !dbg !441 - %11 = load ptr, ptr %5, align 8, !dbg !442 - %12 = call i32 @"\01_pthread_cond_timedwait"(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !443 - store i32 %12, ptr %8, align 4, !dbg !440 - ret void, !dbg !444 + call void @llvm.dbg.declare(metadata ptr %6, metadata !415, metadata !DIExpression()), !dbg !416 + call void @llvm.dbg.declare(metadata ptr %7, metadata !417, metadata !DIExpression()), !dbg !425 + %9 = load i64, ptr %6, align 8, !dbg !426 + call void @llvm.dbg.declare(metadata ptr %8, metadata !427, metadata !DIExpression()), !dbg !428 + %10 = load ptr, ptr %4, align 8, !dbg !429 + %11 = load ptr, ptr %5, align 8, !dbg !430 + %12 = call i32 @"\01_pthread_cond_timedwait"(ptr noundef %10, ptr noundef %11, ptr noundef %7), !dbg !431 + store i32 %12, ptr %8, align 4, !dbg !428 + ret void, !dbg !432 } declare i32 @"\01_pthread_cond_timedwait"(ptr noundef, ptr noundef, ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @cond_worker(ptr noundef %0) #0 !dbg !445 { +define ptr @cond_worker(ptr noundef %0) #0 !dbg !433 { %2 = alloca ptr, align 8 %3 = alloca ptr, align 8 %4 = alloca i8, align 1 store ptr %0, ptr %3, align 8 - call void @llvm.dbg.declare(metadata ptr %3, metadata !446, metadata !DIExpression()), !dbg !447 - call void @llvm.dbg.declare(metadata ptr %4, metadata !448, metadata !DIExpression()), !dbg !449 - store i8 1, ptr %4, align 1, !dbg !449 - call void @mutex_lock(ptr noundef @cond_mutex), !dbg !450 - %5 = load i32, ptr @phase, align 4, !dbg !452 - %6 = add nsw i32 %5, 1, !dbg !452 - store i32 %6, ptr @phase, align 4, !dbg !452 - call void @cond_wait(ptr noundef @cond, ptr noundef @cond_mutex), !dbg !453 - %7 = load i32, ptr @phase, align 4, !dbg !454 - %8 = add nsw i32 %7, 1, !dbg !454 - store i32 %8, ptr @phase, align 4, !dbg !454 - %9 = load i32, ptr @phase, align 4, !dbg !455 - %10 = icmp slt i32 %9, 2, !dbg !456 - %11 = zext i1 %10 to i8, !dbg !457 - store i8 %11, ptr %4, align 1, !dbg !457 - call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !458 - %12 = load i8, ptr %4, align 1, !dbg !459 - %13 = trunc i8 %12 to i1, !dbg !459 - br i1 %13, label %14, label %17, !dbg !461 + call void @llvm.dbg.declare(metadata ptr %3, metadata !434, metadata !DIExpression()), !dbg !435 + call void @llvm.dbg.declare(metadata ptr %4, metadata !436, metadata !DIExpression()), !dbg !437 + store i8 1, ptr %4, align 1, !dbg !437 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !438 + %5 = load i32, ptr @phase, align 4, !dbg !440 + %6 = add nsw i32 %5, 1, !dbg !440 + store i32 %6, ptr @phase, align 4, !dbg !440 + call void @cond_wait(ptr noundef @cond, ptr noundef @cond_mutex), !dbg !441 + %7 = load i32, ptr @phase, align 4, !dbg !442 + %8 = add nsw i32 %7, 1, !dbg !442 + store i32 %8, ptr @phase, align 4, !dbg !442 + %9 = load i32, ptr @phase, align 4, !dbg !443 + %10 = icmp slt i32 %9, 2, !dbg !444 + %11 = zext i1 %10 to i8, !dbg !445 + store i8 %11, ptr %4, align 1, !dbg !445 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !446 + %12 = load i8, ptr %4, align 1, !dbg !447 + %13 = trunc i8 %12 to i1, !dbg !447 + br i1 %13, label %14, label %17, !dbg !449 14: ; preds = %1 - %15 = load ptr, ptr %3, align 8, !dbg !462 - %16 = getelementptr inbounds i8, ptr %15, i64 1, !dbg !463 - store ptr %16, ptr %2, align 8, !dbg !464 - br label %32, !dbg !464 + %15 = load ptr, ptr %3, align 8, !dbg !450 + %16 = getelementptr inbounds i8, ptr %15, i64 1, !dbg !451 + store ptr %16, ptr %2, align 8, !dbg !452 + br label %32, !dbg !452 17: ; preds = %1 - store i8 1, ptr %4, align 1, !dbg !465 - call void @mutex_lock(ptr noundef @cond_mutex), !dbg !466 - %18 = load i32, ptr @phase, align 4, !dbg !468 - %19 = add nsw i32 %18, 1, !dbg !468 - store i32 %19, ptr @phase, align 4, !dbg !468 - call void @cond_timedwait(ptr noundef @cond, ptr noundef @cond_mutex, i64 noundef 10), !dbg !469 - %20 = load i32, ptr @phase, align 4, !dbg !470 - %21 = add nsw i32 %20, 1, !dbg !470 - store i32 %21, ptr @phase, align 4, !dbg !470 - %22 = load i32, ptr @phase, align 4, !dbg !471 - %23 = icmp sgt i32 %22, 6, !dbg !472 - %24 = zext i1 %23 to i8, !dbg !473 - store i8 %24, ptr %4, align 1, !dbg !473 - call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !474 - %25 = load i8, ptr %4, align 1, !dbg !475 - %26 = trunc i8 %25 to i1, !dbg !475 - br i1 %26, label %27, label %30, !dbg !477 + store i8 1, ptr %4, align 1, !dbg !453 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !454 + %18 = load i32, ptr @phase, align 4, !dbg !456 + %19 = add nsw i32 %18, 1, !dbg !456 + store i32 %19, ptr @phase, align 4, !dbg !456 + call void @cond_timedwait(ptr noundef @cond, ptr noundef @cond_mutex, i64 noundef 10), !dbg !457 + %20 = load i32, ptr @phase, align 4, !dbg !458 + %21 = add nsw i32 %20, 1, !dbg !458 + store i32 %21, ptr @phase, align 4, !dbg !458 + %22 = load i32, ptr @phase, align 4, !dbg !459 + %23 = icmp sgt i32 %22, 6, !dbg !460 + %24 = zext i1 %23 to i8, !dbg !461 + store i8 %24, ptr %4, align 1, !dbg !461 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !462 + %25 = load i8, ptr %4, align 1, !dbg !463 + %26 = trunc i8 %25 to i1, !dbg !463 + br i1 %26, label %27, label %30, !dbg !465 27: ; preds = %17 - %28 = load ptr, ptr %3, align 8, !dbg !478 - %29 = getelementptr inbounds i8, ptr %28, i64 2, !dbg !479 - store ptr %29, ptr %2, align 8, !dbg !480 - br label %32, !dbg !480 + %28 = load ptr, ptr %3, align 8, !dbg !466 + %29 = getelementptr inbounds i8, ptr %28, i64 2, !dbg !467 + store ptr %29, ptr %2, align 8, !dbg !468 + br label %32, !dbg !468 30: ; preds = %17 - %31 = load ptr, ptr %3, align 8, !dbg !481 - store ptr %31, ptr %2, align 8, !dbg !482 - br label %32, !dbg !482 + %31 = load ptr, ptr %3, align 8, !dbg !469 + store ptr %31, ptr %2, align 8, !dbg !470 + br label %32, !dbg !470 32: ; preds = %30, %27, %14 - %33 = load ptr, ptr %2, align 8, !dbg !483 - ret ptr %33, !dbg !483 + %33 = load ptr, ptr %2, align 8, !dbg !471 + ret ptr %33, !dbg !471 } ; Function Attrs: noinline nounwind ssp uwtable -define void @cond_test() #0 !dbg !484 { +define void @cond_test() #0 !dbg !472 { %1 = alloca ptr, align 8 %2 = alloca ptr, align 8 %3 = alloca ptr, align 8 - call void @llvm.dbg.declare(metadata ptr %1, metadata !485, metadata !DIExpression()), !dbg !486 - store ptr inttoptr (i64 42 to ptr), ptr %1, align 8, !dbg !486 - call void @mutex_init(ptr noundef @cond_mutex, i32 noundef 0, i32 noundef 0, i32 noundef 3, i32 noundef 0), !dbg !487 - call void @cond_init(ptr noundef @cond), !dbg !488 - call void @llvm.dbg.declare(metadata ptr %2, metadata !489, metadata !DIExpression()), !dbg !490 - %4 = load ptr, ptr %1, align 8, !dbg !491 - %5 = call ptr @thread_create(ptr noundef @cond_worker, ptr noundef %4), !dbg !492 - store ptr %5, ptr %2, align 8, !dbg !490 - call void @mutex_lock(ptr noundef @cond_mutex), !dbg !493 - %6 = load i32, ptr @phase, align 4, !dbg !495 - %7 = add nsw i32 %6, 1, !dbg !495 - store i32 %7, ptr @phase, align 4, !dbg !495 - call void @cond_signal(ptr noundef @cond), !dbg !496 - call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !497 - call void @mutex_lock(ptr noundef @cond_mutex), !dbg !498 - %8 = load i32, ptr @phase, align 4, !dbg !500 - %9 = add nsw i32 %8, 1, !dbg !500 - store i32 %9, ptr @phase, align 4, !dbg !500 - call void @cond_broadcast(ptr noundef @cond), !dbg !501 - call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !502 - call void @llvm.dbg.declare(metadata ptr %3, metadata !503, metadata !DIExpression()), !dbg !504 - %10 = load ptr, ptr %2, align 8, !dbg !505 - %11 = call ptr @thread_join(ptr noundef %10), !dbg !506 - store ptr %11, ptr %3, align 8, !dbg !504 - %12 = load ptr, ptr %3, align 8, !dbg !507 - %13 = load ptr, ptr %1, align 8, !dbg !507 - %14 = icmp eq ptr %12, %13, !dbg !507 - %15 = xor i1 %14, true, !dbg !507 - %16 = zext i1 %15 to i32, !dbg !507 - %17 = sext i32 %16 to i64, !dbg !507 - %18 = icmp ne i64 %17, 0, !dbg !507 - br i1 %18, label %19, label %21, !dbg !507 - -19: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.cond_test, ptr noundef @.str, i32 noundef 252, ptr noundef @.str.4) #4, !dbg !507 - unreachable, !dbg !507 - -20: ; No predecessors! - br label %22, !dbg !507 - -21: ; preds = %0 - br label %22, !dbg !507 - -22: ; preds = %21, %20 - call void @cond_destroy(ptr noundef @cond), !dbg !508 - call void @mutex_destroy(ptr noundef @cond_mutex), !dbg !509 - ret void, !dbg !510 + call void @llvm.dbg.declare(metadata ptr %1, metadata !473, metadata !DIExpression()), !dbg !474 + store ptr inttoptr (i64 42 to ptr), ptr %1, align 8, !dbg !474 + call void @mutex_init(ptr noundef @cond_mutex, i32 noundef 0, i32 noundef 0, i32 noundef 3, i32 noundef 0), !dbg !475 + call void @cond_init(ptr noundef @cond), !dbg !476 + call void @llvm.dbg.declare(metadata ptr %2, metadata !477, metadata !DIExpression()), !dbg !478 + %4 = load ptr, ptr %1, align 8, !dbg !479 + %5 = call ptr @thread_create(ptr noundef @cond_worker, ptr noundef %4), !dbg !480 + store ptr %5, ptr %2, align 8, !dbg !478 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !481 + %6 = load i32, ptr @phase, align 4, !dbg !483 + %7 = add nsw i32 %6, 1, !dbg !483 + store i32 %7, ptr @phase, align 4, !dbg !483 + call void @cond_signal(ptr noundef @cond), !dbg !484 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !485 + call void @mutex_lock(ptr noundef @cond_mutex), !dbg !486 + %8 = load i32, ptr @phase, align 4, !dbg !488 + %9 = add nsw i32 %8, 1, !dbg !488 + store i32 %9, ptr @phase, align 4, !dbg !488 + call void @cond_broadcast(ptr noundef @cond), !dbg !489 + call void @mutex_unlock(ptr noundef @cond_mutex), !dbg !490 + call void @llvm.dbg.declare(metadata ptr %3, metadata !491, metadata !DIExpression()), !dbg !492 + %10 = load ptr, ptr %2, align 8, !dbg !493 + %11 = call ptr @thread_join(ptr noundef %10), !dbg !494 + store ptr %11, ptr %3, align 8, !dbg !492 + call void @cond_destroy(ptr noundef @cond), !dbg !495 + call void @mutex_destroy(ptr noundef @cond_mutex), !dbg !496 + ret void, !dbg !497 } ; Function Attrs: noinline nounwind ssp uwtable -define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !511 { +define void @rwlock_init(ptr noundef %0, i32 noundef %1) #0 !dbg !498 { %3 = alloca ptr, align 8 %4 = alloca i32, align 4 %5 = alloca i32, align 4 %6 = alloca i32, align 4 %7 = alloca %struct._opaque_pthread_rwlockattr_t, align 8 store ptr %0, ptr %3, align 8 - call void @llvm.dbg.declare(metadata ptr %3, metadata !525, metadata !DIExpression()), !dbg !526 + call void @llvm.dbg.declare(metadata ptr %3, metadata !512, metadata !DIExpression()), !dbg !513 store i32 %1, ptr %4, align 4 - call void @llvm.dbg.declare(metadata ptr %4, metadata !527, metadata !DIExpression()), !dbg !528 - call void @llvm.dbg.declare(metadata ptr %5, metadata !529, metadata !DIExpression()), !dbg !530 - call void @llvm.dbg.declare(metadata ptr %6, metadata !531, metadata !DIExpression()), !dbg !532 - call void @llvm.dbg.declare(metadata ptr %7, metadata !533, metadata !DIExpression()), !dbg !544 - %8 = call i32 @pthread_rwlockattr_init(ptr noundef %7), !dbg !545 - store i32 %8, ptr %5, align 4, !dbg !546 - %9 = load i32, ptr %5, align 4, !dbg !547 - %10 = icmp eq i32 %9, 0, !dbg !547 - %11 = xor i1 %10, true, !dbg !547 - %12 = zext i1 %11 to i32, !dbg !547 - %13 = sext i32 %12 to i64, !dbg !547 - %14 = icmp ne i64 %13, 0, !dbg !547 - br i1 %14, label %15, label %17, !dbg !547 + call void @llvm.dbg.declare(metadata ptr %4, metadata !514, metadata !DIExpression()), !dbg !515 + call void @llvm.dbg.declare(metadata ptr %5, metadata !516, metadata !DIExpression()), !dbg !517 + call void @llvm.dbg.declare(metadata ptr %6, metadata !518, metadata !DIExpression()), !dbg !519 + call void @llvm.dbg.declare(metadata ptr %7, metadata !520, metadata !DIExpression()), !dbg !531 + %8 = call i32 @pthread_rwlockattr_init(ptr noundef %7), !dbg !532 + store i32 %8, ptr %5, align 4, !dbg !533 + %9 = load i32, ptr %5, align 4, !dbg !534 + %10 = icmp eq i32 %9, 0, !dbg !534 + %11 = xor i1 %10, true, !dbg !534 + %12 = zext i1 %11 to i32, !dbg !534 + %13 = sext i32 %12 to i64, !dbg !534 + %14 = icmp ne i64 %13, 0, !dbg !534 + br i1 %14, label %15, label %17, !dbg !534 15: ; preds = %2 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 269, ptr noundef @.str.1) #4, !dbg !547 - unreachable, !dbg !547 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 269, ptr noundef @.str.1) #4, !dbg !534 + unreachable, !dbg !534 16: ; No predecessors! - br label %18, !dbg !547 + br label %18, !dbg !534 17: ; preds = %2 - br label %18, !dbg !547 + br label %18, !dbg !534 18: ; preds = %17, %16 - %19 = load i32, ptr %4, align 4, !dbg !548 - %20 = call i32 @pthread_rwlockattr_setpshared(ptr noundef %7, i32 noundef %19), !dbg !549 - store i32 %20, ptr %5, align 4, !dbg !550 - %21 = load i32, ptr %5, align 4, !dbg !551 - %22 = icmp eq i32 %21, 0, !dbg !551 - %23 = xor i1 %22, true, !dbg !551 - %24 = zext i1 %23 to i32, !dbg !551 - %25 = sext i32 %24 to i64, !dbg !551 - %26 = icmp ne i64 %25, 0, !dbg !551 - br i1 %26, label %27, label %29, !dbg !551 + %19 = load i32, ptr %4, align 4, !dbg !535 + %20 = call i32 @pthread_rwlockattr_setpshared(ptr noundef %7, i32 noundef %19), !dbg !536 + store i32 %20, ptr %5, align 4, !dbg !537 + %21 = load i32, ptr %5, align 4, !dbg !538 + %22 = icmp eq i32 %21, 0, !dbg !538 + %23 = xor i1 %22, true, !dbg !538 + %24 = zext i1 %23 to i32, !dbg !538 + %25 = sext i32 %24 to i64, !dbg !538 + %26 = icmp ne i64 %25, 0, !dbg !538 + br i1 %26, label %27, label %29, !dbg !538 27: ; preds = %18 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 272, ptr noundef @.str.1) #4, !dbg !551 - unreachable, !dbg !551 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 272, ptr noundef @.str.1) #4, !dbg !538 + unreachable, !dbg !538 28: ; No predecessors! - br label %30, !dbg !551 + br label %30, !dbg !538 29: ; preds = %18 - br label %30, !dbg !551 + br label %30, !dbg !538 30: ; preds = %29, %28 - %31 = call i32 @pthread_rwlockattr_getpshared(ptr noundef %7, ptr noundef %6), !dbg !552 - store i32 %31, ptr %5, align 4, !dbg !553 - %32 = load i32, ptr %5, align 4, !dbg !554 - %33 = icmp eq i32 %32, 0, !dbg !554 - %34 = xor i1 %33, true, !dbg !554 - %35 = zext i1 %34 to i32, !dbg !554 - %36 = sext i32 %35 to i64, !dbg !554 - %37 = icmp ne i64 %36, 0, !dbg !554 - br i1 %37, label %38, label %40, !dbg !554 + %31 = call i32 @pthread_rwlockattr_getpshared(ptr noundef %7, ptr noundef %6), !dbg !539 + store i32 %31, ptr %5, align 4, !dbg !540 + %32 = load i32, ptr %5, align 4, !dbg !541 + %33 = icmp eq i32 %32, 0, !dbg !541 + %34 = xor i1 %33, true, !dbg !541 + %35 = zext i1 %34 to i32, !dbg !541 + %36 = sext i32 %35 to i64, !dbg !541 + %37 = icmp ne i64 %36, 0, !dbg !541 + br i1 %37, label %38, label %40, !dbg !541 38: ; preds = %30 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 274, ptr noundef @.str.1) #4, !dbg !554 - unreachable, !dbg !554 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 274, ptr noundef @.str.1) #4, !dbg !541 + unreachable, !dbg !541 39: ; No predecessors! - br label %41, !dbg !554 + br label %41, !dbg !541 40: ; preds = %30 - br label %41, !dbg !554 + br label %41, !dbg !541 41: ; preds = %40, %39 - %42 = load ptr, ptr %3, align 8, !dbg !555 - %43 = call i32 @"\01_pthread_rwlock_init"(ptr noundef %42, ptr noundef %7), !dbg !556 - store i32 %43, ptr %5, align 4, !dbg !557 - %44 = load i32, ptr %5, align 4, !dbg !558 - %45 = icmp eq i32 %44, 0, !dbg !558 - %46 = xor i1 %45, true, !dbg !558 - %47 = zext i1 %46 to i32, !dbg !558 - %48 = sext i32 %47 to i64, !dbg !558 - %49 = icmp ne i64 %48, 0, !dbg !558 - br i1 %49, label %50, label %52, !dbg !558 + %42 = load ptr, ptr %3, align 8, !dbg !542 + %43 = call i32 @"\01_pthread_rwlock_init"(ptr noundef %42, ptr noundef %7), !dbg !543 + store i32 %43, ptr %5, align 4, !dbg !544 + %44 = load i32, ptr %5, align 4, !dbg !545 + %45 = icmp eq i32 %44, 0, !dbg !545 + %46 = xor i1 %45, true, !dbg !545 + %47 = zext i1 %46 to i32, !dbg !545 + %48 = sext i32 %47 to i64, !dbg !545 + %49 = icmp ne i64 %48, 0, !dbg !545 + br i1 %49, label %50, label %52, !dbg !545 50: ; preds = %41 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 277, ptr noundef @.str.1) #4, !dbg !558 - unreachable, !dbg !558 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 277, ptr noundef @.str.1) #4, !dbg !545 + unreachable, !dbg !545 51: ; No predecessors! - br label %53, !dbg !558 + br label %53, !dbg !545 52: ; preds = %41 - br label %53, !dbg !558 + br label %53, !dbg !545 53: ; preds = %52, %51 - %54 = call i32 @pthread_rwlockattr_destroy(ptr noundef %7), !dbg !559 - store i32 %54, ptr %5, align 4, !dbg !560 - %55 = load i32, ptr %5, align 4, !dbg !561 - %56 = icmp eq i32 %55, 0, !dbg !561 - %57 = xor i1 %56, true, !dbg !561 - %58 = zext i1 %57 to i32, !dbg !561 - %59 = sext i32 %58 to i64, !dbg !561 - %60 = icmp ne i64 %59, 0, !dbg !561 - br i1 %60, label %61, label %63, !dbg !561 + %54 = call i32 @pthread_rwlockattr_destroy(ptr noundef %7), !dbg !546 + store i32 %54, ptr %5, align 4, !dbg !547 + %55 = load i32, ptr %5, align 4, !dbg !548 + %56 = icmp eq i32 %55, 0, !dbg !548 + %57 = xor i1 %56, true, !dbg !548 + %58 = zext i1 %57 to i32, !dbg !548 + %59 = sext i32 %58 to i64, !dbg !548 + %60 = icmp ne i64 %59, 0, !dbg !548 + br i1 %60, label %61, label %63, !dbg !548 61: ; preds = %53 - call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 279, ptr noundef @.str.1) #4, !dbg !561 - unreachable, !dbg !561 + call void @__assert_rtn(ptr noundef @__func__.rwlock_init, ptr noundef @.str, i32 noundef 279, ptr noundef @.str.1) #4, !dbg !548 + unreachable, !dbg !548 62: ; No predecessors! - br label %64, !dbg !561 + br label %64, !dbg !548 63: ; preds = %53 - br label %64, !dbg !561 + br label %64, !dbg !548 64: ; preds = %63, %62 - ret void, !dbg !562 + ret void, !dbg !549 } declare i32 @pthread_rwlockattr_init(ptr noundef) #2 @@ -1116,177 +1093,177 @@ declare i32 @"\01_pthread_rwlock_init"(ptr noundef, ptr noundef) #2 declare i32 @pthread_rwlockattr_destroy(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @rwlock_destroy(ptr noundef %0) #0 !dbg !563 { +define void @rwlock_destroy(ptr noundef %0) #0 !dbg !550 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !566, metadata !DIExpression()), !dbg !567 - call void @llvm.dbg.declare(metadata ptr %3, metadata !568, metadata !DIExpression()), !dbg !569 - %4 = load ptr, ptr %2, align 8, !dbg !570 - %5 = call i32 @"\01_pthread_rwlock_destroy"(ptr noundef %4), !dbg !571 - store i32 %5, ptr %3, align 4, !dbg !569 - %6 = load i32, ptr %3, align 4, !dbg !572 - %7 = icmp eq i32 %6, 0, !dbg !572 - %8 = xor i1 %7, true, !dbg !572 - %9 = zext i1 %8 to i32, !dbg !572 - %10 = sext i32 %9 to i64, !dbg !572 - %11 = icmp ne i64 %10, 0, !dbg !572 - br i1 %11, label %12, label %14, !dbg !572 + call void @llvm.dbg.declare(metadata ptr %2, metadata !553, metadata !DIExpression()), !dbg !554 + call void @llvm.dbg.declare(metadata ptr %3, metadata !555, metadata !DIExpression()), !dbg !556 + %4 = load ptr, ptr %2, align 8, !dbg !557 + %5 = call i32 @"\01_pthread_rwlock_destroy"(ptr noundef %4), !dbg !558 + store i32 %5, ptr %3, align 4, !dbg !556 + %6 = load i32, ptr %3, align 4, !dbg !559 + %7 = icmp eq i32 %6, 0, !dbg !559 + %8 = xor i1 %7, true, !dbg !559 + %9 = zext i1 %8 to i32, !dbg !559 + %10 = sext i32 %9 to i64, !dbg !559 + %11 = icmp ne i64 %10, 0, !dbg !559 + br i1 %11, label %12, label %14, !dbg !559 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_destroy, ptr noundef @.str, i32 noundef 285, ptr noundef @.str.1) #4, !dbg !572 - unreachable, !dbg !572 + call void @__assert_rtn(ptr noundef @__func__.rwlock_destroy, ptr noundef @.str, i32 noundef 285, ptr noundef @.str.1) #4, !dbg !559 + unreachable, !dbg !559 13: ; No predecessors! - br label %15, !dbg !572 + br label %15, !dbg !559 14: ; preds = %1 - br label %15, !dbg !572 + br label %15, !dbg !559 15: ; preds = %14, %13 - ret void, !dbg !573 + ret void, !dbg !560 } declare i32 @"\01_pthread_rwlock_destroy"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !574 { +define void @rwlock_wrlock(ptr noundef %0) #0 !dbg !561 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !575, metadata !DIExpression()), !dbg !576 - call void @llvm.dbg.declare(metadata ptr %3, metadata !577, metadata !DIExpression()), !dbg !578 - %4 = load ptr, ptr %2, align 8, !dbg !579 - %5 = call i32 @"\01_pthread_rwlock_wrlock"(ptr noundef %4), !dbg !580 - store i32 %5, ptr %3, align 4, !dbg !578 - %6 = load i32, ptr %3, align 4, !dbg !581 - %7 = icmp eq i32 %6, 0, !dbg !581 - %8 = xor i1 %7, true, !dbg !581 - %9 = zext i1 %8 to i32, !dbg !581 - %10 = sext i32 %9 to i64, !dbg !581 - %11 = icmp ne i64 %10, 0, !dbg !581 - br i1 %11, label %12, label %14, !dbg !581 + call void @llvm.dbg.declare(metadata ptr %2, metadata !562, metadata !DIExpression()), !dbg !563 + call void @llvm.dbg.declare(metadata ptr %3, metadata !564, metadata !DIExpression()), !dbg !565 + %4 = load ptr, ptr %2, align 8, !dbg !566 + %5 = call i32 @"\01_pthread_rwlock_wrlock"(ptr noundef %4), !dbg !567 + store i32 %5, ptr %3, align 4, !dbg !565 + %6 = load i32, ptr %3, align 4, !dbg !568 + %7 = icmp eq i32 %6, 0, !dbg !568 + %8 = xor i1 %7, true, !dbg !568 + %9 = zext i1 %8 to i32, !dbg !568 + %10 = sext i32 %9 to i64, !dbg !568 + %11 = icmp ne i64 %10, 0, !dbg !568 + br i1 %11, label %12, label %14, !dbg !568 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_wrlock, ptr noundef @.str, i32 noundef 291, ptr noundef @.str.1) #4, !dbg !581 - unreachable, !dbg !581 + call void @__assert_rtn(ptr noundef @__func__.rwlock_wrlock, ptr noundef @.str, i32 noundef 291, ptr noundef @.str.1) #4, !dbg !568 + unreachable, !dbg !568 13: ; No predecessors! - br label %15, !dbg !581 + br label %15, !dbg !568 14: ; preds = %1 - br label %15, !dbg !581 + br label %15, !dbg !568 15: ; preds = %14, %13 - ret void, !dbg !582 + ret void, !dbg !569 } declare i32 @"\01_pthread_rwlock_wrlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !583 { +define zeroext i1 @rwlock_trywrlock(ptr noundef %0) #0 !dbg !570 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !586, metadata !DIExpression()), !dbg !587 - call void @llvm.dbg.declare(metadata ptr %3, metadata !588, metadata !DIExpression()), !dbg !589 - %4 = load ptr, ptr %2, align 8, !dbg !590 - %5 = call i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef %4), !dbg !591 - store i32 %5, ptr %3, align 4, !dbg !589 - %6 = load i32, ptr %3, align 4, !dbg !592 - %7 = icmp eq i32 %6, 0, !dbg !593 - ret i1 %7, !dbg !594 + call void @llvm.dbg.declare(metadata ptr %2, metadata !573, metadata !DIExpression()), !dbg !574 + call void @llvm.dbg.declare(metadata ptr %3, metadata !575, metadata !DIExpression()), !dbg !576 + %4 = load ptr, ptr %2, align 8, !dbg !577 + %5 = call i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef %4), !dbg !578 + store i32 %5, ptr %3, align 4, !dbg !576 + %6 = load i32, ptr %3, align 4, !dbg !579 + %7 = icmp eq i32 %6, 0, !dbg !580 + ret i1 %7, !dbg !581 } declare i32 @"\01_pthread_rwlock_trywrlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !595 { +define void @rwlock_rdlock(ptr noundef %0) #0 !dbg !582 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !596, metadata !DIExpression()), !dbg !597 - call void @llvm.dbg.declare(metadata ptr %3, metadata !598, metadata !DIExpression()), !dbg !599 - %4 = load ptr, ptr %2, align 8, !dbg !600 - %5 = call i32 @"\01_pthread_rwlock_rdlock"(ptr noundef %4), !dbg !601 - store i32 %5, ptr %3, align 4, !dbg !599 - %6 = load i32, ptr %3, align 4, !dbg !602 - %7 = icmp eq i32 %6, 0, !dbg !602 - %8 = xor i1 %7, true, !dbg !602 - %9 = zext i1 %8 to i32, !dbg !602 - %10 = sext i32 %9 to i64, !dbg !602 - %11 = icmp ne i64 %10, 0, !dbg !602 - br i1 %11, label %12, label %14, !dbg !602 + call void @llvm.dbg.declare(metadata ptr %2, metadata !583, metadata !DIExpression()), !dbg !584 + call void @llvm.dbg.declare(metadata ptr %3, metadata !585, metadata !DIExpression()), !dbg !586 + %4 = load ptr, ptr %2, align 8, !dbg !587 + %5 = call i32 @"\01_pthread_rwlock_rdlock"(ptr noundef %4), !dbg !588 + store i32 %5, ptr %3, align 4, !dbg !586 + %6 = load i32, ptr %3, align 4, !dbg !589 + %7 = icmp eq i32 %6, 0, !dbg !589 + %8 = xor i1 %7, true, !dbg !589 + %9 = zext i1 %8 to i32, !dbg !589 + %10 = sext i32 %9 to i64, !dbg !589 + %11 = icmp ne i64 %10, 0, !dbg !589 + br i1 %11, label %12, label %14, !dbg !589 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_rdlock, ptr noundef @.str, i32 noundef 304, ptr noundef @.str.1) #4, !dbg !602 - unreachable, !dbg !602 + call void @__assert_rtn(ptr noundef @__func__.rwlock_rdlock, ptr noundef @.str, i32 noundef 304, ptr noundef @.str.1) #4, !dbg !589 + unreachable, !dbg !589 13: ; No predecessors! - br label %15, !dbg !602 + br label %15, !dbg !589 14: ; preds = %1 - br label %15, !dbg !602 + br label %15, !dbg !589 15: ; preds = %14, %13 - ret void, !dbg !603 + ret void, !dbg !590 } declare i32 @"\01_pthread_rwlock_rdlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !604 { +define zeroext i1 @rwlock_tryrdlock(ptr noundef %0) #0 !dbg !591 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !605, metadata !DIExpression()), !dbg !606 - call void @llvm.dbg.declare(metadata ptr %3, metadata !607, metadata !DIExpression()), !dbg !608 - %4 = load ptr, ptr %2, align 8, !dbg !609 - %5 = call i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef %4), !dbg !610 - store i32 %5, ptr %3, align 4, !dbg !608 - %6 = load i32, ptr %3, align 4, !dbg !611 - %7 = icmp eq i32 %6, 0, !dbg !612 - ret i1 %7, !dbg !613 + call void @llvm.dbg.declare(metadata ptr %2, metadata !592, metadata !DIExpression()), !dbg !593 + call void @llvm.dbg.declare(metadata ptr %3, metadata !594, metadata !DIExpression()), !dbg !595 + %4 = load ptr, ptr %2, align 8, !dbg !596 + %5 = call i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef %4), !dbg !597 + store i32 %5, ptr %3, align 4, !dbg !595 + %6 = load i32, ptr %3, align 4, !dbg !598 + %7 = icmp eq i32 %6, 0, !dbg !599 + ret i1 %7, !dbg !600 } declare i32 @"\01_pthread_rwlock_tryrdlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @rwlock_unlock(ptr noundef %0) #0 !dbg !614 { +define void @rwlock_unlock(ptr noundef %0) #0 !dbg !601 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !615, metadata !DIExpression()), !dbg !616 - call void @llvm.dbg.declare(metadata ptr %3, metadata !617, metadata !DIExpression()), !dbg !618 - %4 = load ptr, ptr %2, align 8, !dbg !619 - %5 = call i32 @"\01_pthread_rwlock_unlock"(ptr noundef %4), !dbg !620 - store i32 %5, ptr %3, align 4, !dbg !618 - %6 = load i32, ptr %3, align 4, !dbg !621 - %7 = icmp eq i32 %6, 0, !dbg !621 - %8 = xor i1 %7, true, !dbg !621 - %9 = zext i1 %8 to i32, !dbg !621 - %10 = sext i32 %9 to i64, !dbg !621 - %11 = icmp ne i64 %10, 0, !dbg !621 - br i1 %11, label %12, label %14, !dbg !621 + call void @llvm.dbg.declare(metadata ptr %2, metadata !602, metadata !DIExpression()), !dbg !603 + call void @llvm.dbg.declare(metadata ptr %3, metadata !604, metadata !DIExpression()), !dbg !605 + %4 = load ptr, ptr %2, align 8, !dbg !606 + %5 = call i32 @"\01_pthread_rwlock_unlock"(ptr noundef %4), !dbg !607 + store i32 %5, ptr %3, align 4, !dbg !605 + %6 = load i32, ptr %3, align 4, !dbg !608 + %7 = icmp eq i32 %6, 0, !dbg !608 + %8 = xor i1 %7, true, !dbg !608 + %9 = zext i1 %8 to i32, !dbg !608 + %10 = sext i32 %9 to i64, !dbg !608 + %11 = icmp ne i64 %10, 0, !dbg !608 + br i1 %11, label %12, label %14, !dbg !608 12: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.rwlock_unlock, ptr noundef @.str, i32 noundef 317, ptr noundef @.str.1) #4, !dbg !621 - unreachable, !dbg !621 + call void @__assert_rtn(ptr noundef @__func__.rwlock_unlock, ptr noundef @.str, i32 noundef 317, ptr noundef @.str.1) #4, !dbg !608 + unreachable, !dbg !608 13: ; No predecessors! - br label %15, !dbg !621 + br label %15, !dbg !608 14: ; preds = %1 - br label %15, !dbg !621 + br label %15, !dbg !608 15: ; preds = %14, %13 - ret void, !dbg !622 + ret void, !dbg !609 } declare i32 @"\01_pthread_rwlock_unlock"(ptr noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @rwlock_test() #0 !dbg !623 { +define void @rwlock_test() #0 !dbg !610 { %1 = alloca %struct._opaque_pthread_rwlock_t, align 8 %2 = alloca i32, align 4 %3 = alloca i8, align 1 @@ -1295,229 +1272,249 @@ define void @rwlock_test() #0 !dbg !623 { %6 = alloca i8, align 1 %7 = alloca i32, align 4 %8 = alloca i8, align 1 - call void @llvm.dbg.declare(metadata ptr %1, metadata !624, metadata !DIExpression()), !dbg !625 - call void @rwlock_init(ptr noundef %1, i32 noundef 2), !dbg !626 - call void @llvm.dbg.declare(metadata ptr %2, metadata !627, metadata !DIExpression()), !dbg !629 - store i32 4, ptr %2, align 4, !dbg !629 - call void @rwlock_wrlock(ptr noundef %1), !dbg !630 - call void @llvm.dbg.declare(metadata ptr %3, metadata !632, metadata !DIExpression()), !dbg !633 - %9 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !634 - %10 = zext i1 %9 to i8, !dbg !633 - store i8 %10, ptr %3, align 1, !dbg !633 - %11 = load i8, ptr %3, align 1, !dbg !635 - %12 = trunc i8 %11 to i1, !dbg !635 - %13 = xor i1 %12, true, !dbg !635 - %14 = xor i1 %13, true, !dbg !635 - %15 = zext i1 %14 to i32, !dbg !635 - %16 = sext i32 %15 to i64, !dbg !635 - %17 = icmp ne i64 %16, 0, !dbg !635 - br i1 %17, label %18, label %20, !dbg !635 + call void @llvm.dbg.declare(metadata ptr %1, metadata !611, metadata !DIExpression()), !dbg !612 + call void @rwlock_init(ptr noundef %1, i32 noundef 2), !dbg !613 + call void @llvm.dbg.declare(metadata ptr %2, metadata !614, metadata !DIExpression()), !dbg !616 + store i32 4, ptr %2, align 4, !dbg !616 + call void @rwlock_wrlock(ptr noundef %1), !dbg !617 + call void @llvm.dbg.declare(metadata ptr %3, metadata !619, metadata !DIExpression()), !dbg !620 + %9 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !621 + %10 = zext i1 %9 to i8, !dbg !620 + store i8 %10, ptr %3, align 1, !dbg !620 + %11 = load i8, ptr %3, align 1, !dbg !622 + %12 = trunc i8 %11 to i1, !dbg !622 + %13 = xor i1 %12, true, !dbg !622 + %14 = xor i1 %13, true, !dbg !622 + %15 = zext i1 %14 to i32, !dbg !622 + %16 = sext i32 %15 to i64, !dbg !622 + %17 = icmp ne i64 %16, 0, !dbg !622 + br i1 %17, label %18, label %20, !dbg !622 18: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 329, ptr noundef @.str.2) #4, !dbg !635 - unreachable, !dbg !635 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 329, ptr noundef @.str.2) #4, !dbg !622 + unreachable, !dbg !622 19: ; No predecessors! - br label %21, !dbg !635 + br label %21, !dbg !622 20: ; preds = %0 - br label %21, !dbg !635 + br label %21, !dbg !622 21: ; preds = %20, %19 - %22 = call zeroext i1 @rwlock_tryrdlock(ptr noundef %1), !dbg !636 - %23 = zext i1 %22 to i8, !dbg !637 - store i8 %23, ptr %3, align 1, !dbg !637 - %24 = load i8, ptr %3, align 1, !dbg !638 - %25 = trunc i8 %24 to i1, !dbg !638 - %26 = xor i1 %25, true, !dbg !638 - %27 = xor i1 %26, true, !dbg !638 - %28 = zext i1 %27 to i32, !dbg !638 - %29 = sext i32 %28 to i64, !dbg !638 - %30 = icmp ne i64 %29, 0, !dbg !638 - br i1 %30, label %31, label %33, !dbg !638 + %22 = call zeroext i1 @rwlock_tryrdlock(ptr noundef %1), !dbg !623 + %23 = zext i1 %22 to i8, !dbg !624 + store i8 %23, ptr %3, align 1, !dbg !624 + %24 = load i8, ptr %3, align 1, !dbg !625 + %25 = trunc i8 %24 to i1, !dbg !625 + %26 = xor i1 %25, true, !dbg !625 + %27 = xor i1 %26, true, !dbg !625 + %28 = zext i1 %27 to i32, !dbg !625 + %29 = sext i32 %28 to i64, !dbg !625 + %30 = icmp ne i64 %29, 0, !dbg !625 + br i1 %30, label %31, label %33, !dbg !625 31: ; preds = %21 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 331, ptr noundef @.str.2) #4, !dbg !638 - unreachable, !dbg !638 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 331, ptr noundef @.str.2) #4, !dbg !625 + unreachable, !dbg !625 32: ; No predecessors! - br label %34, !dbg !638 + br label %34, !dbg !625 33: ; preds = %21 - br label %34, !dbg !638 + br label %34, !dbg !625 34: ; preds = %33, %32 - call void @rwlock_unlock(ptr noundef %1), !dbg !639 - call void @__VERIFIER_loop_bound(i32 noundef 5), !dbg !640 - call void @llvm.dbg.declare(metadata ptr %4, metadata !642, metadata !DIExpression()), !dbg !644 - store i32 0, ptr %4, align 4, !dbg !644 - br label %35, !dbg !645 + call void @rwlock_unlock(ptr noundef %1), !dbg !626 + call void @__VERIFIER_loop_bound(i32 noundef 5), !dbg !627 + call void @llvm.dbg.declare(metadata ptr %4, metadata !629, metadata !DIExpression()), !dbg !631 + store i32 0, ptr %4, align 4, !dbg !631 + br label %35, !dbg !632 35: ; preds = %51, %34 - %36 = load i32, ptr %4, align 4, !dbg !646 - %37 = icmp slt i32 %36, 4, !dbg !648 - br i1 %37, label %38, label %54, !dbg !649 + %36 = load i32, ptr %4, align 4, !dbg !633 + %37 = icmp slt i32 %36, 4, !dbg !635 + br i1 %37, label %38, label %54, !dbg !636 38: ; preds = %35 - call void @llvm.dbg.declare(metadata ptr %5, metadata !650, metadata !DIExpression()), !dbg !652 - %39 = call zeroext i1 @rwlock_tryrdlock(ptr noundef %1), !dbg !653 - %40 = zext i1 %39 to i8, !dbg !652 - store i8 %40, ptr %5, align 1, !dbg !652 - %41 = load i8, ptr %5, align 1, !dbg !654 - %42 = trunc i8 %41 to i1, !dbg !654 - %43 = xor i1 %42, true, !dbg !654 - %44 = zext i1 %43 to i32, !dbg !654 - %45 = sext i32 %44 to i64, !dbg !654 - %46 = icmp ne i64 %45, 0, !dbg !654 - br i1 %46, label %47, label %49, !dbg !654 + call void @llvm.dbg.declare(metadata ptr %5, metadata !637, metadata !DIExpression()), !dbg !639 + %39 = call zeroext i1 @rwlock_tryrdlock(ptr noundef %1), !dbg !640 + %40 = zext i1 %39 to i8, !dbg !639 + store i8 %40, ptr %5, align 1, !dbg !639 + %41 = load i8, ptr %5, align 1, !dbg !641 + %42 = trunc i8 %41 to i1, !dbg !641 + %43 = xor i1 %42, true, !dbg !641 + %44 = zext i1 %43 to i32, !dbg !641 + %45 = sext i32 %44 to i64, !dbg !641 + %46 = icmp ne i64 %45, 0, !dbg !641 + br i1 %46, label %47, label %49, !dbg !641 47: ; preds = %38 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 340, ptr noundef @.str.3) #4, !dbg !654 - unreachable, !dbg !654 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 340, ptr noundef @.str.3) #4, !dbg !641 + unreachable, !dbg !641 48: ; No predecessors! - br label %50, !dbg !654 + br label %50, !dbg !641 49: ; preds = %38 - br label %50, !dbg !654 + br label %50, !dbg !641 50: ; preds = %49, %48 - br label %51, !dbg !655 + br label %51, !dbg !642 51: ; preds = %50 - %52 = load i32, ptr %4, align 4, !dbg !656 - %53 = add nsw i32 %52, 1, !dbg !656 - store i32 %53, ptr %4, align 4, !dbg !656 - br label %35, !dbg !657, !llvm.loop !658 + %52 = load i32, ptr %4, align 4, !dbg !643 + %53 = add nsw i32 %52, 1, !dbg !643 + store i32 %53, ptr %4, align 4, !dbg !643 + br label %35, !dbg !644, !llvm.loop !645 54: ; preds = %35 - call void @llvm.dbg.declare(metadata ptr %6, metadata !661, metadata !DIExpression()), !dbg !663 - %55 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !664 - %56 = zext i1 %55 to i8, !dbg !663 - store i8 %56, ptr %6, align 1, !dbg !663 - %57 = load i8, ptr %6, align 1, !dbg !665 - %58 = trunc i8 %57 to i1, !dbg !665 - %59 = xor i1 %58, true, !dbg !665 - %60 = xor i1 %59, true, !dbg !665 - %61 = zext i1 %60 to i32, !dbg !665 - %62 = sext i32 %61 to i64, !dbg !665 - %63 = icmp ne i64 %62, 0, !dbg !665 - br i1 %63, label %64, label %66, !dbg !665 + call void @llvm.dbg.declare(metadata ptr %6, metadata !648, metadata !DIExpression()), !dbg !650 + %55 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !651 + %56 = zext i1 %55 to i8, !dbg !650 + store i8 %56, ptr %6, align 1, !dbg !650 + %57 = load i8, ptr %6, align 1, !dbg !652 + %58 = trunc i8 %57 to i1, !dbg !652 + %59 = xor i1 %58, true, !dbg !652 + %60 = xor i1 %59, true, !dbg !652 + %61 = zext i1 %60 to i32, !dbg !652 + %62 = sext i32 %61 to i64, !dbg !652 + %63 = icmp ne i64 %62, 0, !dbg !652 + br i1 %63, label %64, label %66, !dbg !652 64: ; preds = %54 - call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 345, ptr noundef @.str.2) #4, !dbg !665 - unreachable, !dbg !665 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 345, ptr noundef @.str.2) #4, !dbg !652 + unreachable, !dbg !652 65: ; No predecessors! - br label %67, !dbg !665 + br label %67, !dbg !652 66: ; preds = %54 - br label %67, !dbg !665 + br label %67, !dbg !652 67: ; preds = %66, %65 - call void @__VERIFIER_loop_bound(i32 noundef 5), !dbg !666 - call void @llvm.dbg.declare(metadata ptr %7, metadata !667, metadata !DIExpression()), !dbg !669 - store i32 0, ptr %7, align 4, !dbg !669 - br label %68, !dbg !670 + call void @__VERIFIER_loop_bound(i32 noundef 5), !dbg !653 + call void @llvm.dbg.declare(metadata ptr %7, metadata !654, metadata !DIExpression()), !dbg !656 + store i32 0, ptr %7, align 4, !dbg !656 + br label %68, !dbg !657 68: ; preds = %72, %67 - %69 = load i32, ptr %7, align 4, !dbg !671 - %70 = icmp slt i32 %69, 4, !dbg !673 - br i1 %70, label %71, label %75, !dbg !674 + %69 = load i32, ptr %7, align 4, !dbg !658 + %70 = icmp slt i32 %69, 4, !dbg !660 + br i1 %70, label %71, label %75, !dbg !661 71: ; preds = %68 - call void @rwlock_unlock(ptr noundef %1), !dbg !675 - br label %72, !dbg !677 + call void @rwlock_unlock(ptr noundef %1), !dbg !662 + br label %72, !dbg !664 72: ; preds = %71 - %73 = load i32, ptr %7, align 4, !dbg !678 - %74 = add nsw i32 %73, 1, !dbg !678 - store i32 %74, ptr %7, align 4, !dbg !678 - br label %68, !dbg !679, !llvm.loop !680 + %73 = load i32, ptr %7, align 4, !dbg !665 + %74 = add nsw i32 %73, 1, !dbg !665 + store i32 %74, ptr %7, align 4, !dbg !665 + br label %68, !dbg !666, !llvm.loop !667 75: ; preds = %68 - call void @rwlock_wrlock(ptr noundef %1), !dbg !682 - call void @llvm.dbg.declare(metadata ptr %8, metadata !684, metadata !DIExpression()), !dbg !685 - %76 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !686 - %77 = zext i1 %76 to i8, !dbg !685 - store i8 %77, ptr %8, align 1, !dbg !685 - call void @rwlock_unlock(ptr noundef %1), !dbg !687 - call void @rwlock_destroy(ptr noundef %1), !dbg !688 - ret void, !dbg !689 + call void @rwlock_wrlock(ptr noundef %1), !dbg !669 + call void @llvm.dbg.declare(metadata ptr %8, metadata !671, metadata !DIExpression()), !dbg !672 + %76 = call zeroext i1 @rwlock_trywrlock(ptr noundef %1), !dbg !673 + %77 = zext i1 %76 to i8, !dbg !672 + store i8 %77, ptr %8, align 1, !dbg !672 + %78 = load i8, ptr %8, align 1, !dbg !674 + %79 = trunc i8 %78 to i1, !dbg !674 + %80 = xor i1 %79, true, !dbg !674 + %81 = xor i1 %80, true, !dbg !674 + %82 = zext i1 %81 to i32, !dbg !674 + %83 = sext i32 %82 to i64, !dbg !674 + %84 = icmp ne i64 %83, 0, !dbg !674 + br i1 %84, label %85, label %87, !dbg !674 + +85: ; preds = %75 + call void @__assert_rtn(ptr noundef @__func__.rwlock_test, ptr noundef @.str, i32 noundef 357, ptr noundef @.str.2) #4, !dbg !674 + unreachable, !dbg !674 + +86: ; No predecessors! + br label %88, !dbg !674 + +87: ; preds = %75 + br label %88, !dbg !674 + +88: ; preds = %87, %86 + call void @rwlock_unlock(ptr noundef %1), !dbg !675 + call void @rwlock_destroy(ptr noundef %1), !dbg !676 + ret void, !dbg !677 } declare void @__VERIFIER_loop_bound(i32 noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @key_destroy(ptr noundef %0) #0 !dbg !690 { +define void @key_destroy(ptr noundef %0) #0 !dbg !678 { %2 = alloca ptr, align 8 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !691, metadata !DIExpression()), !dbg !692 - %3 = call ptr @pthread_self(), !dbg !693 - store ptr %3, ptr @latest_thread, align 8, !dbg !694 - ret void, !dbg !695 + call void @llvm.dbg.declare(metadata ptr %2, metadata !679, metadata !DIExpression()), !dbg !680 + %3 = call ptr @pthread_self(), !dbg !681 + store ptr %3, ptr @latest_thread, align 8, !dbg !682 + ret void, !dbg !683 } declare ptr @pthread_self() #2 ; Function Attrs: noinline nounwind ssp uwtable -define ptr @key_worker(ptr noundef %0) #0 !dbg !696 { +define ptr @key_worker(ptr noundef %0) #0 !dbg !684 { %2 = alloca ptr, align 8 %3 = alloca i32, align 4 %4 = alloca i32, align 4 %5 = alloca ptr, align 8 store ptr %0, ptr %2, align 8 - call void @llvm.dbg.declare(metadata ptr %2, metadata !697, metadata !DIExpression()), !dbg !698 - call void @llvm.dbg.declare(metadata ptr %3, metadata !699, metadata !DIExpression()), !dbg !700 - store i32 1, ptr %3, align 4, !dbg !700 - call void @llvm.dbg.declare(metadata ptr %4, metadata !701, metadata !DIExpression()), !dbg !702 - %6 = load i64, ptr @local_data, align 8, !dbg !703 - %7 = call i32 @pthread_setspecific(i64 noundef %6, ptr noundef %3), !dbg !704 - store i32 %7, ptr %4, align 4, !dbg !702 - %8 = load i32, ptr %4, align 4, !dbg !705 - %9 = icmp eq i32 %8, 0, !dbg !705 - %10 = xor i1 %9, true, !dbg !705 - %11 = zext i1 %10 to i32, !dbg !705 - %12 = sext i32 %11 to i64, !dbg !705 - %13 = icmp ne i64 %12, 0, !dbg !705 - br i1 %13, label %14, label %16, !dbg !705 + call void @llvm.dbg.declare(metadata ptr %2, metadata !685, metadata !DIExpression()), !dbg !686 + call void @llvm.dbg.declare(metadata ptr %3, metadata !687, metadata !DIExpression()), !dbg !688 + store i32 1, ptr %3, align 4, !dbg !688 + call void @llvm.dbg.declare(metadata ptr %4, metadata !689, metadata !DIExpression()), !dbg !690 + %6 = load i64, ptr @local_data, align 8, !dbg !691 + %7 = call i32 @pthread_setspecific(i64 noundef %6, ptr noundef %3), !dbg !692 + store i32 %7, ptr %4, align 4, !dbg !690 + %8 = load i32, ptr %4, align 4, !dbg !693 + %9 = icmp eq i32 %8, 0, !dbg !693 + %10 = xor i1 %9, true, !dbg !693 + %11 = zext i1 %10 to i32, !dbg !693 + %12 = sext i32 %11 to i64, !dbg !693 + %13 = icmp ne i64 %12, 0, !dbg !693 + br i1 %13, label %14, label %16, !dbg !693 14: ; preds = %1 - call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 378, ptr noundef @.str.1) #4, !dbg !705 - unreachable, !dbg !705 + call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 379, ptr noundef @.str.1) #4, !dbg !693 + unreachable, !dbg !693 15: ; No predecessors! - br label %17, !dbg !705 + br label %17, !dbg !693 16: ; preds = %1 - br label %17, !dbg !705 + br label %17, !dbg !693 17: ; preds = %16, %15 - call void @llvm.dbg.declare(metadata ptr %5, metadata !706, metadata !DIExpression()), !dbg !707 - %18 = load i64, ptr @local_data, align 8, !dbg !708 - %19 = call ptr @pthread_getspecific(i64 noundef %18), !dbg !709 - store ptr %19, ptr %5, align 8, !dbg !707 - %20 = load ptr, ptr %5, align 8, !dbg !710 - %21 = icmp eq ptr %20, %3, !dbg !710 - %22 = xor i1 %21, true, !dbg !710 - %23 = zext i1 %22 to i32, !dbg !710 - %24 = sext i32 %23 to i64, !dbg !710 - %25 = icmp ne i64 %24, 0, !dbg !710 - br i1 %25, label %26, label %28, !dbg !710 + call void @llvm.dbg.declare(metadata ptr %5, metadata !694, metadata !DIExpression()), !dbg !695 + %18 = load i64, ptr @local_data, align 8, !dbg !696 + %19 = call ptr @pthread_getspecific(i64 noundef %18), !dbg !697 + store ptr %19, ptr %5, align 8, !dbg !695 + %20 = load ptr, ptr %5, align 8, !dbg !698 + %21 = icmp eq ptr %20, %3, !dbg !698 + %22 = xor i1 %21, true, !dbg !698 + %23 = zext i1 %22 to i32, !dbg !698 + %24 = sext i32 %23 to i64, !dbg !698 + %25 = icmp ne i64 %24, 0, !dbg !698 + br i1 %25, label %26, label %28, !dbg !698 26: ; preds = %17 - call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 381, ptr noundef @.str.5) #4, !dbg !710 - unreachable, !dbg !710 + call void @__assert_rtn(ptr noundef @__func__.key_worker, ptr noundef @.str, i32 noundef 382, ptr noundef @.str.4) #4, !dbg !698 + unreachable, !dbg !698 27: ; No predecessors! - br label %29, !dbg !710 + br label %29, !dbg !698 28: ; preds = %17 - br label %29, !dbg !710 + br label %29, !dbg !698 29: ; preds = %28, %27 - %30 = load ptr, ptr %2, align 8, !dbg !711 - ret ptr %30, !dbg !712 + %30 = load ptr, ptr %2, align 8, !dbg !699 + ret ptr %30, !dbg !700 } declare i32 @pthread_setspecific(i64 noundef, ptr noundef) #2 @@ -1525,173 +1522,130 @@ declare i32 @pthread_setspecific(i64 noundef, ptr noundef) #2 declare ptr @pthread_getspecific(i64 noundef) #2 ; Function Attrs: noinline nounwind ssp uwtable -define void @key_test() #0 !dbg !713 { +define void @key_test() #0 !dbg !701 { %1 = alloca i32, align 4 %2 = alloca ptr, align 8 %3 = alloca i32, align 4 %4 = alloca ptr, align 8 %5 = alloca ptr, align 8 %6 = alloca ptr, align 8 - call void @llvm.dbg.declare(metadata ptr %1, metadata !714, metadata !DIExpression()), !dbg !715 - store i32 2, ptr %1, align 4, !dbg !715 - call void @llvm.dbg.declare(metadata ptr %2, metadata !716, metadata !DIExpression()), !dbg !717 - store ptr inttoptr (i64 41 to ptr), ptr %2, align 8, !dbg !717 - call void @llvm.dbg.declare(metadata ptr %3, metadata !718, metadata !DIExpression()), !dbg !719 - %7 = call i32 @pthread_key_create(ptr noundef @local_data, ptr noundef @key_destroy), !dbg !720 - call void @llvm.dbg.declare(metadata ptr %4, metadata !721, metadata !DIExpression()), !dbg !722 - %8 = load ptr, ptr %2, align 8, !dbg !723 - %9 = call ptr @thread_create(ptr noundef @key_worker, ptr noundef %8), !dbg !724 - store ptr %9, ptr %4, align 8, !dbg !722 - %10 = load i64, ptr @local_data, align 8, !dbg !725 - %11 = call i32 @pthread_setspecific(i64 noundef %10, ptr noundef %1), !dbg !726 - store i32 %11, ptr %3, align 4, !dbg !727 - %12 = load i32, ptr %3, align 4, !dbg !728 - %13 = icmp eq i32 %12, 0, !dbg !728 - %14 = xor i1 %13, true, !dbg !728 - %15 = zext i1 %14 to i32, !dbg !728 - %16 = sext i32 %15 to i64, !dbg !728 - %17 = icmp ne i64 %16, 0, !dbg !728 - br i1 %17, label %18, label %20, !dbg !728 + call void @llvm.dbg.declare(metadata ptr %1, metadata !702, metadata !DIExpression()), !dbg !703 + store i32 2, ptr %1, align 4, !dbg !703 + call void @llvm.dbg.declare(metadata ptr %2, metadata !704, metadata !DIExpression()), !dbg !705 + store ptr inttoptr (i64 41 to ptr), ptr %2, align 8, !dbg !705 + call void @llvm.dbg.declare(metadata ptr %3, metadata !706, metadata !DIExpression()), !dbg !707 + %7 = call i32 @pthread_key_create(ptr noundef @local_data, ptr noundef @key_destroy), !dbg !708 + call void @llvm.dbg.declare(metadata ptr %4, metadata !709, metadata !DIExpression()), !dbg !710 + %8 = load ptr, ptr %2, align 8, !dbg !711 + %9 = call ptr @thread_create(ptr noundef @key_worker, ptr noundef %8), !dbg !712 + store ptr %9, ptr %4, align 8, !dbg !710 + %10 = load i64, ptr @local_data, align 8, !dbg !713 + %11 = call i32 @pthread_setspecific(i64 noundef %10, ptr noundef %1), !dbg !714 + store i32 %11, ptr %3, align 4, !dbg !715 + %12 = load i32, ptr %3, align 4, !dbg !716 + %13 = icmp eq i32 %12, 0, !dbg !716 + %14 = xor i1 %13, true, !dbg !716 + %15 = zext i1 %14 to i32, !dbg !716 + %16 = sext i32 %15 to i64, !dbg !716 + %17 = icmp ne i64 %16, 0, !dbg !716 + br i1 %17, label %18, label %20, !dbg !716 18: ; preds = %0 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 397, ptr noundef @.str.1) #4, !dbg !728 - unreachable, !dbg !728 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 398, ptr noundef @.str.1) #4, !dbg !716 + unreachable, !dbg !716 19: ; No predecessors! - br label %21, !dbg !728 + br label %21, !dbg !716 20: ; preds = %0 - br label %21, !dbg !728 + br label %21, !dbg !716 21: ; preds = %20, %19 - call void @llvm.dbg.declare(metadata ptr %5, metadata !729, metadata !DIExpression()), !dbg !730 - %22 = load i64, ptr @local_data, align 8, !dbg !731 - %23 = call ptr @pthread_getspecific(i64 noundef %22), !dbg !732 - store ptr %23, ptr %5, align 8, !dbg !730 - %24 = load ptr, ptr %5, align 8, !dbg !733 - %25 = icmp eq ptr %24, %1, !dbg !733 - %26 = xor i1 %25, true, !dbg !733 - %27 = zext i1 %26 to i32, !dbg !733 - %28 = sext i32 %27 to i64, !dbg !733 - %29 = icmp ne i64 %28, 0, !dbg !733 - br i1 %29, label %30, label %32, !dbg !733 + call void @llvm.dbg.declare(metadata ptr %5, metadata !717, metadata !DIExpression()), !dbg !718 + %22 = load i64, ptr @local_data, align 8, !dbg !719 + %23 = call ptr @pthread_getspecific(i64 noundef %22), !dbg !720 + store ptr %23, ptr %5, align 8, !dbg !718 + %24 = load ptr, ptr %5, align 8, !dbg !721 + %25 = icmp eq ptr %24, %1, !dbg !721 + %26 = xor i1 %25, true, !dbg !721 + %27 = zext i1 %26 to i32, !dbg !721 + %28 = sext i32 %27 to i64, !dbg !721 + %29 = icmp ne i64 %28, 0, !dbg !721 + br i1 %29, label %30, label %32, !dbg !721 30: ; preds = %21 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 400, ptr noundef @.str.5) #4, !dbg !733 - unreachable, !dbg !733 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 401, ptr noundef @.str.4) #4, !dbg !721 + unreachable, !dbg !721 31: ; No predecessors! - br label %33, !dbg !733 + br label %33, !dbg !721 32: ; preds = %21 - br label %33, !dbg !733 + br label %33, !dbg !721 33: ; preds = %32, %31 - %34 = load i64, ptr @local_data, align 8, !dbg !734 - %35 = call i32 @pthread_setspecific(i64 noundef %34, ptr noundef null), !dbg !735 - store i32 %35, ptr %3, align 4, !dbg !736 - %36 = load i32, ptr %3, align 4, !dbg !737 - %37 = icmp eq i32 %36, 0, !dbg !737 - %38 = xor i1 %37, true, !dbg !737 - %39 = zext i1 %38 to i32, !dbg !737 - %40 = sext i32 %39 to i64, !dbg !737 - %41 = icmp ne i64 %40, 0, !dbg !737 - br i1 %41, label %42, label %44, !dbg !737 + %34 = load i64, ptr @local_data, align 8, !dbg !722 + %35 = call i32 @pthread_setspecific(i64 noundef %34, ptr noundef null), !dbg !723 + store i32 %35, ptr %3, align 4, !dbg !724 + %36 = load i32, ptr %3, align 4, !dbg !725 + %37 = icmp eq i32 %36, 0, !dbg !725 + %38 = xor i1 %37, true, !dbg !725 + %39 = zext i1 %38 to i32, !dbg !725 + %40 = sext i32 %39 to i64, !dbg !725 + %41 = icmp ne i64 %40, 0, !dbg !725 + br i1 %41, label %42, label %44, !dbg !725 42: ; preds = %33 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 403, ptr noundef @.str.1) #4, !dbg !737 - unreachable, !dbg !737 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 404, ptr noundef @.str.1) #4, !dbg !725 + unreachable, !dbg !725 43: ; No predecessors! - br label %45, !dbg !737 + br label %45, !dbg !725 44: ; preds = %33 - br label %45, !dbg !737 + br label %45, !dbg !725 45: ; preds = %44, %43 - call void @llvm.dbg.declare(metadata ptr %6, metadata !738, metadata !DIExpression()), !dbg !739 - %46 = load ptr, ptr %4, align 8, !dbg !740 - %47 = call ptr @thread_join(ptr noundef %46), !dbg !741 - store ptr %47, ptr %6, align 8, !dbg !739 - %48 = load ptr, ptr %6, align 8, !dbg !742 - %49 = load ptr, ptr %2, align 8, !dbg !742 - %50 = icmp eq ptr %48, %49, !dbg !742 - %51 = xor i1 %50, true, !dbg !742 - %52 = zext i1 %51 to i32, !dbg !742 - %53 = sext i32 %52 to i64, !dbg !742 - %54 = icmp ne i64 %53, 0, !dbg !742 - br i1 %54, label %55, label %57, !dbg !742 - -55: ; preds = %45 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 406, ptr noundef @.str.4) #4, !dbg !742 - unreachable, !dbg !742 - -56: ; No predecessors! - br label %58, !dbg !742 - -57: ; preds = %45 - br label %58, !dbg !742 - -58: ; preds = %57, %56 - %59 = load i64, ptr @local_data, align 8, !dbg !743 - %60 = call i32 @pthread_key_delete(i64 noundef %59), !dbg !744 - store i32 %60, ptr %3, align 4, !dbg !745 - %61 = load i32, ptr %3, align 4, !dbg !746 - %62 = icmp eq i32 %61, 0, !dbg !746 - %63 = xor i1 %62, true, !dbg !746 - %64 = zext i1 %63 to i32, !dbg !746 - %65 = sext i32 %64 to i64, !dbg !746 - %66 = icmp ne i64 %65, 0, !dbg !746 - br i1 %66, label %67, label %69, !dbg !746 - -67: ; preds = %58 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 409, ptr noundef @.str.1) #4, !dbg !746 - unreachable, !dbg !746 - -68: ; No predecessors! - br label %70, !dbg !746 - -69: ; preds = %58 - br label %70, !dbg !746 - -70: ; preds = %69, %68 - %71 = load ptr, ptr @latest_thread, align 8, !dbg !747 - %72 = load ptr, ptr %4, align 8, !dbg !747 - %73 = call i32 @pthread_equal(ptr noundef %71, ptr noundef %72), !dbg !747 - %74 = icmp ne i32 %73, 0, !dbg !747 - %75 = xor i1 %74, true, !dbg !747 - %76 = zext i1 %75 to i32, !dbg !747 - %77 = sext i32 %76 to i64, !dbg !747 - %78 = icmp ne i64 %77, 0, !dbg !747 - br i1 %78, label %79, label %81, !dbg !747 - -79: ; preds = %70 - call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 411, ptr noundef @.str.6) #4, !dbg !747 - unreachable, !dbg !747 + call void @llvm.dbg.declare(metadata ptr %6, metadata !726, metadata !DIExpression()), !dbg !727 + %46 = load ptr, ptr %4, align 8, !dbg !728 + %47 = call ptr @thread_join(ptr noundef %46), !dbg !729 + store ptr %47, ptr %6, align 8, !dbg !727 + %48 = load i64, ptr @local_data, align 8, !dbg !730 + %49 = call i32 @pthread_key_delete(i64 noundef %48), !dbg !731 + store i32 %49, ptr %3, align 4, !dbg !732 + %50 = load i32, ptr %3, align 4, !dbg !733 + %51 = icmp eq i32 %50, 0, !dbg !733 + %52 = xor i1 %51, true, !dbg !733 + %53 = zext i1 %52 to i32, !dbg !733 + %54 = sext i32 %53 to i64, !dbg !733 + %55 = icmp ne i64 %54, 0, !dbg !733 + br i1 %55, label %56, label %58, !dbg !733 + +56: ; preds = %45 + call void @__assert_rtn(ptr noundef @__func__.key_test, ptr noundef @.str, i32 noundef 410, ptr noundef @.str.1) #4, !dbg !733 + unreachable, !dbg !733 -80: ; No predecessors! - br label %82, !dbg !747 +57: ; No predecessors! + br label %59, !dbg !733 -81: ; preds = %70 - br label %82, !dbg !747 +58: ; preds = %45 + br label %59, !dbg !733 -82: ; preds = %81, %80 - ret void, !dbg !748 +59: ; preds = %58, %57 + ret void, !dbg !734 } declare i32 @pthread_key_create(ptr noundef, ptr noundef) #2 declare i32 @pthread_key_delete(i64 noundef) #2 -declare i32 @pthread_equal(ptr noundef, ptr noundef) #2 - ; Function Attrs: noinline nounwind ssp uwtable -define i32 @main() #0 !dbg !749 { - call void @mutex_test(), !dbg !752 - call void @cond_test(), !dbg !753 - call void @rwlock_test(), !dbg !754 - call void @key_test(), !dbg !755 - ret i32 0, !dbg !756 +define i32 @main() #0 !dbg !735 { + call void @mutex_test(), !dbg !738 + call void @cond_test(), !dbg !739 + call void @rwlock_test(), !dbg !740 + call void @key_test(), !dbg !741 + ret i32 0, !dbg !742 } attributes #0 = { noinline nounwind ssp uwtable "frame-pointer"="non-leaf" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.5a,+zcm,+zcz" } @@ -1701,8 +1655,8 @@ attributes #3 = { cold noreturn "disable-tail-calls"="true" "frame-pointer"="non attributes #4 = { cold noreturn } !llvm.dbg.cu = !{!61} -!llvm.module.flags = !{!156, !157, !158, !159, !160, !161} -!llvm.ident = !{!162} +!llvm.module.flags = !{!144, !145, !146, !147, !148, !149} +!llvm.ident = !{!150} !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) !1 = distinct !DIGlobalVariable(scope: null, file: !2, line: 18, type: !3, isLocal: true, isDefinition: true) @@ -1764,700 +1718,686 @@ attributes #4 = { cold noreturn } !57 = !{!58} !58 = !DISubrange(count: 15) !59 = !DIGlobalVariableExpression(var: !60, expr: !DIExpression()) -!60 = distinct !DIGlobalVariable(name: "phase", scope: !61, file: !2, line: 200, type: !155, isLocal: false, isDefinition: true) +!60 = distinct !DIGlobalVariable(name: "phase", scope: !61, file: !2, line: 200, type: !143, isLocal: false, isDefinition: true) !61 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "Homebrew clang version 15.0.7", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !62, globals: !65, splitDebugInlining: false, nameTableKind: None, sysroot: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk", sdk: "MacOSX13.sdk") !62 = !{!63, !64} !63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64) !64 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -!65 = !{!0, !8, !13, !18, !21, !26, !28, !30, !35, !37, !42, !47, !50, !52, !54, !59, !66, !68, !73, !75, !77, !79, !81, !83, !85, !87, !92, !95, !100, !114, !126, !149} +!65 = !{!0, !8, !13, !18, !21, !26, !28, !30, !35, !37, !42, !47, !50, !52, !54, !59, !66, !68, !70, !72, !74, !76, !78, !80, !85, !88, !102, !114, !137} !66 = !DIGlobalVariableExpression(var: !67, expr: !DIExpression()) -!67 = distinct !DIGlobalVariable(scope: null, file: !2, line: 252, type: !49, isLocal: true, isDefinition: true) +!67 = distinct !DIGlobalVariable(scope: null, file: !2, line: 269, type: !20, isLocal: true, isDefinition: true) !68 = !DIGlobalVariableExpression(var: !69, expr: !DIExpression()) -!69 = distinct !DIGlobalVariable(scope: null, file: !2, line: 252, type: !70, isLocal: true, isDefinition: true) -!70 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 144, elements: !71) -!71 = !{!72} -!72 = !DISubrange(count: 18) -!73 = !DIGlobalVariableExpression(var: !74, expr: !DIExpression()) -!74 = distinct !DIGlobalVariable(scope: null, file: !2, line: 269, type: !20, isLocal: true, isDefinition: true) -!75 = !DIGlobalVariableExpression(var: !76, expr: !DIExpression()) -!76 = distinct !DIGlobalVariable(scope: null, file: !2, line: 285, type: !56, isLocal: true, isDefinition: true) -!77 = !DIGlobalVariableExpression(var: !78, expr: !DIExpression()) -!78 = distinct !DIGlobalVariable(scope: null, file: !2, line: 291, type: !3, isLocal: true, isDefinition: true) -!79 = !DIGlobalVariableExpression(var: !80, expr: !DIExpression()) -!80 = distinct !DIGlobalVariable(scope: null, file: !2, line: 304, type: !3, isLocal: true, isDefinition: true) -!81 = !DIGlobalVariableExpression(var: !82, expr: !DIExpression()) -!82 = distinct !DIGlobalVariable(scope: null, file: !2, line: 317, type: !3, isLocal: true, isDefinition: true) -!83 = !DIGlobalVariableExpression(var: !84, expr: !DIExpression()) -!84 = distinct !DIGlobalVariable(scope: null, file: !2, line: 329, type: !20, isLocal: true, isDefinition: true) +!69 = distinct !DIGlobalVariable(scope: null, file: !2, line: 285, type: !56, isLocal: true, isDefinition: true) +!70 = !DIGlobalVariableExpression(var: !71, expr: !DIExpression()) +!71 = distinct !DIGlobalVariable(scope: null, file: !2, line: 291, type: !3, isLocal: true, isDefinition: true) +!72 = !DIGlobalVariableExpression(var: !73, expr: !DIExpression()) +!73 = distinct !DIGlobalVariable(scope: null, file: !2, line: 304, type: !3, isLocal: true, isDefinition: true) +!74 = !DIGlobalVariableExpression(var: !75, expr: !DIExpression()) +!75 = distinct !DIGlobalVariable(scope: null, file: !2, line: 317, type: !3, isLocal: true, isDefinition: true) +!76 = !DIGlobalVariableExpression(var: !77, expr: !DIExpression()) +!77 = distinct !DIGlobalVariable(scope: null, file: !2, line: 329, type: !20, isLocal: true, isDefinition: true) +!78 = !DIGlobalVariableExpression(var: !79, expr: !DIExpression()) +!79 = distinct !DIGlobalVariable(scope: null, file: !2, line: 379, type: !23, isLocal: true, isDefinition: true) +!80 = !DIGlobalVariableExpression(var: !81, expr: !DIExpression()) +!81 = distinct !DIGlobalVariable(scope: null, file: !2, line: 382, type: !82, isLocal: true, isDefinition: true) +!82 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 224, elements: !83) +!83 = !{!84} +!84 = !DISubrange(count: 28) !85 = !DIGlobalVariableExpression(var: !86, expr: !DIExpression()) -!86 = distinct !DIGlobalVariable(scope: null, file: !2, line: 378, type: !23, isLocal: true, isDefinition: true) -!87 = !DIGlobalVariableExpression(var: !88, expr: !DIExpression()) -!88 = distinct !DIGlobalVariable(scope: null, file: !2, line: 381, type: !89, isLocal: true, isDefinition: true) -!89 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 224, elements: !90) -!90 = !{!91} -!91 = !DISubrange(count: 28) -!92 = !DIGlobalVariableExpression(var: !93, expr: !DIExpression()) -!93 = distinct !DIGlobalVariable(scope: null, file: !2, line: 397, type: !94, isLocal: true, isDefinition: true) -!94 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 72, elements: !40) -!95 = !DIGlobalVariableExpression(var: !96, expr: !DIExpression()) -!96 = distinct !DIGlobalVariable(scope: null, file: !2, line: 411, type: !97, isLocal: true, isDefinition: true) -!97 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 296, elements: !98) -!98 = !{!99} -!99 = !DISubrange(count: 37) -!100 = !DIGlobalVariableExpression(var: !101, expr: !DIExpression()) -!101 = distinct !DIGlobalVariable(name: "cond_mutex", scope: !61, file: !2, line: 198, type: !102, isLocal: false, isDefinition: true) -!102 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutex_t", file: !103, line: 31, baseType: !104) -!103 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h", directory: "") -!104 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutex_t", file: !105, line: 113, baseType: !106) -!105 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_types.h", directory: "") -!106 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutex_t", file: !105, line: 78, size: 512, elements: !107) -!107 = !{!108, !110} -!108 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !106, file: !105, line: 79, baseType: !109, size: 64) -!109 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed) -!110 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !106, file: !105, line: 80, baseType: !111, size: 448, offset: 64) -!111 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 448, elements: !112) +!86 = distinct !DIGlobalVariable(scope: null, file: !2, line: 398, type: !87, isLocal: true, isDefinition: true) +!87 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 72, elements: !40) +!88 = !DIGlobalVariableExpression(var: !89, expr: !DIExpression()) +!89 = distinct !DIGlobalVariable(name: "cond_mutex", scope: !61, file: !2, line: 198, type: !90, isLocal: false, isDefinition: true) +!90 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutex_t", file: !91, line: 31, baseType: !92) +!91 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h", directory: "") +!92 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutex_t", file: !93, line: 113, baseType: !94) +!93 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_types.h", directory: "") +!94 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutex_t", file: !93, line: 78, size: 512, elements: !95) +!95 = !{!96, !98} +!96 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !94, file: !93, line: 79, baseType: !97, size: 64) +!97 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed) +!98 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !94, file: !93, line: 80, baseType: !99, size: 448, offset: 64) +!99 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 448, elements: !100) +!100 = !{!101} +!101 = !DISubrange(count: 56) +!102 = !DIGlobalVariableExpression(var: !103, expr: !DIExpression()) +!103 = distinct !DIGlobalVariable(name: "cond", scope: !61, file: !2, line: 199, type: !104, isLocal: false, isDefinition: true) +!104 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_cond_t", file: !105, line: 31, baseType: !106) +!105 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_cond_t.h", directory: "") +!106 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_cond_t", file: !93, line: 110, baseType: !107) +!107 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_cond_t", file: !93, line: 68, size: 384, elements: !108) +!108 = !{!109, !110} +!109 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !107, file: !93, line: 69, baseType: !97, size: 64) +!110 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !107, file: !93, line: 70, baseType: !111, size: 320, offset: 64) +!111 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 320, elements: !112) !112 = !{!113} -!113 = !DISubrange(count: 56) +!113 = !DISubrange(count: 40) !114 = !DIGlobalVariableExpression(var: !115, expr: !DIExpression()) -!115 = distinct !DIGlobalVariable(name: "cond", scope: !61, file: !2, line: 199, type: !116, isLocal: false, isDefinition: true) -!116 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_cond_t", file: !117, line: 31, baseType: !118) -!117 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_cond_t.h", directory: "") -!118 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_cond_t", file: !105, line: 110, baseType: !119) -!119 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_cond_t", file: !105, line: 68, size: 384, elements: !120) -!120 = !{!121, !122} -!121 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !119, file: !105, line: 69, baseType: !109, size: 64) -!122 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !119, file: !105, line: 70, baseType: !123, size: 320, offset: 64) -!123 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 320, elements: !124) -!124 = !{!125} -!125 = !DISubrange(count: 40) -!126 = !DIGlobalVariableExpression(var: !127, expr: !DIExpression()) -!127 = distinct !DIGlobalVariable(name: "latest_thread", scope: !61, file: !2, line: 365, type: !128, isLocal: false, isDefinition: true) -!128 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_t", file: !129, line: 31, baseType: !130) -!129 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_t.h", directory: "") -!130 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_t", file: !105, line: 118, baseType: !131) -!131 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !132, size: 64) -!132 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_t", file: !105, line: 103, size: 65536, elements: !133) -!133 = !{!134, !135, !145} -!134 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !132, file: !105, line: 104, baseType: !109, size: 64) -!135 = !DIDerivedType(tag: DW_TAG_member, name: "__cleanup_stack", scope: !132, file: !105, line: 105, baseType: !136, size: 64, offset: 64) -!136 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !137, size: 64) -!137 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__darwin_pthread_handler_rec", file: !105, line: 57, size: 192, elements: !138) -!138 = !{!139, !143, !144} -!139 = !DIDerivedType(tag: DW_TAG_member, name: "__routine", scope: !137, file: !105, line: 58, baseType: !140, size: 64) -!140 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !141, size: 64) -!141 = !DISubroutineType(types: !142) -!142 = !{null, !64} -!143 = !DIDerivedType(tag: DW_TAG_member, name: "__arg", scope: !137, file: !105, line: 59, baseType: !64, size: 64, offset: 64) -!144 = !DIDerivedType(tag: DW_TAG_member, name: "__next", scope: !137, file: !105, line: 60, baseType: !136, size: 64, offset: 128) -!145 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !132, file: !105, line: 106, baseType: !146, size: 65408, offset: 128) -!146 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 65408, elements: !147) -!147 = !{!148} -!148 = !DISubrange(count: 8176) -!149 = !DIGlobalVariableExpression(var: !150, expr: !DIExpression()) -!150 = distinct !DIGlobalVariable(name: "local_data", scope: !61, file: !2, line: 366, type: !151, isLocal: false, isDefinition: true) -!151 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_key_t", file: !152, line: 31, baseType: !153) -!152 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_key_t.h", directory: "") -!153 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_key_t", file: !105, line: 112, baseType: !154) -!154 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned) -!155 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -!156 = !{i32 7, !"Dwarf Version", i32 4} -!157 = !{i32 2, !"Debug Info Version", i32 3} -!158 = !{i32 1, !"wchar_size", i32 4} -!159 = !{i32 7, !"PIC Level", i32 2} -!160 = !{i32 7, !"uwtable", i32 2} -!161 = !{i32 7, !"frame-pointer", i32 1} -!162 = !{!"Homebrew clang version 15.0.7"} -!163 = distinct !DISubprogram(name: "thread_create", scope: !2, file: !2, line: 12, type: !164, scopeLine: 13, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!164 = !DISubroutineType(types: !165) -!165 = !{!128, !166, !64} -!166 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !167, size: 64) -!167 = !DISubroutineType(types: !168) -!168 = !{!64, !64} -!169 = !{} -!170 = !DILocalVariable(name: "runner", arg: 1, scope: !163, file: !2, line: 12, type: !166) -!171 = !DILocation(line: 12, column: 32, scope: !163) -!172 = !DILocalVariable(name: "data", arg: 2, scope: !163, file: !2, line: 12, type: !64) -!173 = !DILocation(line: 12, column: 54, scope: !163) -!174 = !DILocalVariable(name: "id", scope: !163, file: !2, line: 14, type: !128) -!175 = !DILocation(line: 14, column: 15, scope: !163) -!176 = !DILocalVariable(name: "attr", scope: !163, file: !2, line: 15, type: !177) -!177 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_attr_t", file: !178, line: 31, baseType: !179) -!178 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_attr_t.h", directory: "") -!179 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_attr_t", file: !105, line: 109, baseType: !180) -!180 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_attr_t", file: !105, line: 63, size: 512, elements: !181) -!181 = !{!182, !183} -!182 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !180, file: !105, line: 64, baseType: !109, size: 64) -!183 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !180, file: !105, line: 65, baseType: !111, size: 448, offset: 64) -!184 = !DILocation(line: 15, column: 20, scope: !163) -!185 = !DILocation(line: 16, column: 5, scope: !163) -!186 = !DILocalVariable(name: "status", scope: !163, file: !2, line: 17, type: !155) -!187 = !DILocation(line: 17, column: 9, scope: !163) -!188 = !DILocation(line: 17, column: 45, scope: !163) -!189 = !DILocation(line: 17, column: 53, scope: !163) -!190 = !DILocation(line: 17, column: 18, scope: !163) -!191 = !DILocation(line: 18, column: 5, scope: !163) -!192 = !DILocation(line: 19, column: 5, scope: !163) -!193 = !DILocation(line: 20, column: 12, scope: !163) -!194 = !DILocation(line: 20, column: 5, scope: !163) -!195 = distinct !DISubprogram(name: "thread_join", scope: !2, file: !2, line: 23, type: !196, scopeLine: 24, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!196 = !DISubroutineType(types: !197) -!197 = !{!64, !128} -!198 = !DILocalVariable(name: "id", arg: 1, scope: !195, file: !2, line: 23, type: !128) -!199 = !DILocation(line: 23, column: 29, scope: !195) -!200 = !DILocalVariable(name: "result", scope: !195, file: !2, line: 25, type: !64) -!201 = !DILocation(line: 25, column: 11, scope: !195) -!202 = !DILocalVariable(name: "status", scope: !195, file: !2, line: 26, type: !155) -!203 = !DILocation(line: 26, column: 9, scope: !195) -!204 = !DILocation(line: 26, column: 31, scope: !195) -!205 = !DILocation(line: 26, column: 18, scope: !195) -!206 = !DILocation(line: 27, column: 5, scope: !195) -!207 = !DILocation(line: 28, column: 12, scope: !195) -!208 = !DILocation(line: 28, column: 5, scope: !195) -!209 = distinct !DISubprogram(name: "mutex_init", scope: !2, file: !2, line: 43, type: !210, scopeLine: 44, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!210 = !DISubroutineType(types: !211) -!211 = !{null, !212, !155, !155, !155, !155} -!212 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !102, size: 64) -!213 = !DILocalVariable(name: "lock", arg: 1, scope: !209, file: !2, line: 43, type: !212) -!214 = !DILocation(line: 43, column: 34, scope: !209) -!215 = !DILocalVariable(name: "type", arg: 2, scope: !209, file: !2, line: 43, type: !155) -!216 = !DILocation(line: 43, column: 44, scope: !209) -!217 = !DILocalVariable(name: "protocol", arg: 3, scope: !209, file: !2, line: 43, type: !155) -!218 = !DILocation(line: 43, column: 54, scope: !209) -!219 = !DILocalVariable(name: "policy", arg: 4, scope: !209, file: !2, line: 43, type: !155) -!220 = !DILocation(line: 43, column: 68, scope: !209) -!221 = !DILocalVariable(name: "prioceiling", arg: 5, scope: !209, file: !2, line: 43, type: !155) -!222 = !DILocation(line: 43, column: 80, scope: !209) -!223 = !DILocalVariable(name: "status", scope: !209, file: !2, line: 45, type: !155) -!224 = !DILocation(line: 45, column: 9, scope: !209) -!225 = !DILocalVariable(name: "value", scope: !209, file: !2, line: 46, type: !155) -!226 = !DILocation(line: 46, column: 9, scope: !209) -!227 = !DILocalVariable(name: "attributes", scope: !209, file: !2, line: 47, type: !228) -!228 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutexattr_t", file: !229, line: 31, baseType: !230) -!229 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h", directory: "") -!230 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutexattr_t", file: !105, line: 114, baseType: !231) -!231 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutexattr_t", file: !105, line: 83, size: 128, elements: !232) -!232 = !{!233, !234} -!233 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !231, file: !105, line: 84, baseType: !109, size: 64) -!234 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !231, file: !105, line: 85, baseType: !44, size: 64, offset: 64) -!235 = !DILocation(line: 47, column: 25, scope: !209) -!236 = !DILocation(line: 48, column: 14, scope: !209) -!237 = !DILocation(line: 48, column: 12, scope: !209) -!238 = !DILocation(line: 49, column: 5, scope: !209) -!239 = !DILocation(line: 51, column: 53, scope: !209) -!240 = !DILocation(line: 51, column: 14, scope: !209) -!241 = !DILocation(line: 51, column: 12, scope: !209) -!242 = !DILocation(line: 52, column: 5, scope: !209) -!243 = !DILocation(line: 53, column: 14, scope: !209) -!244 = !DILocation(line: 53, column: 12, scope: !209) -!245 = !DILocation(line: 54, column: 5, scope: !209) -!246 = !DILocation(line: 56, column: 57, scope: !209) -!247 = !DILocation(line: 56, column: 14, scope: !209) -!248 = !DILocation(line: 56, column: 12, scope: !209) -!249 = !DILocation(line: 57, column: 5, scope: !209) -!250 = !DILocation(line: 58, column: 14, scope: !209) -!251 = !DILocation(line: 58, column: 12, scope: !209) -!252 = !DILocation(line: 59, column: 5, scope: !209) -!253 = !DILocation(line: 61, column: 58, scope: !209) -!254 = !DILocation(line: 61, column: 14, scope: !209) -!255 = !DILocation(line: 61, column: 12, scope: !209) -!256 = !DILocation(line: 62, column: 5, scope: !209) -!257 = !DILocation(line: 63, column: 14, scope: !209) -!258 = !DILocation(line: 63, column: 12, scope: !209) -!259 = !DILocation(line: 64, column: 5, scope: !209) -!260 = !DILocation(line: 66, column: 60, scope: !209) -!261 = !DILocation(line: 66, column: 14, scope: !209) -!262 = !DILocation(line: 66, column: 12, scope: !209) -!263 = !DILocation(line: 67, column: 5, scope: !209) -!264 = !DILocation(line: 68, column: 14, scope: !209) -!265 = !DILocation(line: 68, column: 12, scope: !209) -!266 = !DILocation(line: 69, column: 5, scope: !209) -!267 = !DILocation(line: 71, column: 33, scope: !209) -!268 = !DILocation(line: 71, column: 14, scope: !209) -!269 = !DILocation(line: 71, column: 12, scope: !209) -!270 = !DILocation(line: 72, column: 5, scope: !209) -!271 = !DILocation(line: 73, column: 14, scope: !209) -!272 = !DILocation(line: 73, column: 12, scope: !209) -!273 = !DILocation(line: 74, column: 5, scope: !209) -!274 = !DILocation(line: 75, column: 1, scope: !209) -!275 = distinct !DISubprogram(name: "mutex_destroy", scope: !2, file: !2, line: 77, type: !276, scopeLine: 78, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!276 = !DISubroutineType(types: !277) -!277 = !{null, !212} -!278 = !DILocalVariable(name: "lock", arg: 1, scope: !275, file: !2, line: 77, type: !212) -!279 = !DILocation(line: 77, column: 37, scope: !275) -!280 = !DILocalVariable(name: "status", scope: !275, file: !2, line: 79, type: !155) -!281 = !DILocation(line: 79, column: 9, scope: !275) -!282 = !DILocation(line: 79, column: 40, scope: !275) -!283 = !DILocation(line: 79, column: 18, scope: !275) -!284 = !DILocation(line: 80, column: 5, scope: !275) -!285 = !DILocation(line: 81, column: 1, scope: !275) -!286 = distinct !DISubprogram(name: "mutex_lock", scope: !2, file: !2, line: 83, type: !276, scopeLine: 84, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!287 = !DILocalVariable(name: "lock", arg: 1, scope: !286, file: !2, line: 83, type: !212) -!288 = !DILocation(line: 83, column: 34, scope: !286) -!289 = !DILocalVariable(name: "status", scope: !286, file: !2, line: 85, type: !155) -!290 = !DILocation(line: 85, column: 9, scope: !286) -!291 = !DILocation(line: 85, column: 37, scope: !286) -!292 = !DILocation(line: 85, column: 18, scope: !286) -!293 = !DILocation(line: 86, column: 5, scope: !286) -!294 = !DILocation(line: 87, column: 1, scope: !286) -!295 = distinct !DISubprogram(name: "mutex_trylock", scope: !2, file: !2, line: 89, type: !296, scopeLine: 90, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!296 = !DISubroutineType(types: !297) -!297 = !{!298, !212} -!298 = !DIBasicType(name: "_Bool", size: 8, encoding: DW_ATE_boolean) -!299 = !DILocalVariable(name: "lock", arg: 1, scope: !295, file: !2, line: 89, type: !212) -!300 = !DILocation(line: 89, column: 37, scope: !295) -!301 = !DILocalVariable(name: "status", scope: !295, file: !2, line: 91, type: !155) -!302 = !DILocation(line: 91, column: 9, scope: !295) -!303 = !DILocation(line: 91, column: 40, scope: !295) -!304 = !DILocation(line: 91, column: 18, scope: !295) -!305 = !DILocation(line: 93, column: 12, scope: !295) -!306 = !DILocation(line: 93, column: 19, scope: !295) -!307 = !DILocation(line: 93, column: 5, scope: !295) -!308 = distinct !DISubprogram(name: "mutex_unlock", scope: !2, file: !2, line: 96, type: !276, scopeLine: 97, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!309 = !DILocalVariable(name: "lock", arg: 1, scope: !308, file: !2, line: 96, type: !212) -!310 = !DILocation(line: 96, column: 36, scope: !308) -!311 = !DILocalVariable(name: "status", scope: !308, file: !2, line: 98, type: !155) -!312 = !DILocation(line: 98, column: 9, scope: !308) -!313 = !DILocation(line: 98, column: 39, scope: !308) -!314 = !DILocation(line: 98, column: 18, scope: !308) -!315 = !DILocation(line: 99, column: 5, scope: !308) -!316 = !DILocation(line: 100, column: 1, scope: !308) -!317 = distinct !DISubprogram(name: "mutex_test", scope: !2, file: !2, line: 102, type: !318, scopeLine: 103, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!318 = !DISubroutineType(types: !319) -!319 = !{null} -!320 = !DILocalVariable(name: "mutex0", scope: !317, file: !2, line: 104, type: !102) -!321 = !DILocation(line: 104, column: 21, scope: !317) -!322 = !DILocalVariable(name: "mutex1", scope: !317, file: !2, line: 105, type: !102) -!323 = !DILocation(line: 105, column: 21, scope: !317) -!324 = !DILocation(line: 107, column: 5, scope: !317) -!325 = !DILocation(line: 108, column: 5, scope: !317) -!326 = !DILocation(line: 111, column: 9, scope: !327) -!327 = distinct !DILexicalBlock(scope: !317, file: !2, line: 110, column: 5) -!328 = !DILocalVariable(name: "success", scope: !327, file: !2, line: 112, type: !298) -!329 = !DILocation(line: 112, column: 14, scope: !327) -!330 = !DILocation(line: 112, column: 24, scope: !327) -!331 = !DILocation(line: 113, column: 9, scope: !327) -!332 = !DILocation(line: 114, column: 9, scope: !327) -!333 = !DILocation(line: 118, column: 9, scope: !334) -!334 = distinct !DILexicalBlock(scope: !317, file: !2, line: 117, column: 5) -!335 = !DILocalVariable(name: "success", scope: !336, file: !2, line: 121, type: !298) -!336 = distinct !DILexicalBlock(scope: !334, file: !2, line: 120, column: 9) -!337 = !DILocation(line: 121, column: 18, scope: !336) -!338 = !DILocation(line: 121, column: 28, scope: !336) -!339 = !DILocation(line: 122, column: 13, scope: !336) -!340 = !DILocation(line: 123, column: 13, scope: !336) -!341 = !DILocalVariable(name: "success", scope: !342, file: !2, line: 127, type: !298) -!342 = distinct !DILexicalBlock(scope: !334, file: !2, line: 126, column: 9) -!343 = !DILocation(line: 127, column: 18, scope: !342) -!344 = !DILocation(line: 127, column: 28, scope: !342) -!345 = !DILocation(line: 128, column: 13, scope: !342) -!346 = !DILocation(line: 129, column: 13, scope: !342) -!347 = !DILocation(line: 139, column: 9, scope: !334) -!348 = !DILocation(line: 142, column: 5, scope: !317) -!349 = !DILocation(line: 143, column: 5, scope: !317) -!350 = !DILocation(line: 144, column: 1, scope: !317) -!351 = distinct !DISubprogram(name: "cond_init", scope: !2, file: !2, line: 148, type: !352, scopeLine: 149, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!352 = !DISubroutineType(types: !353) -!353 = !{null, !354} -!354 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !116, size: 64) -!355 = !DILocalVariable(name: "cond", arg: 1, scope: !351, file: !2, line: 148, type: !354) -!356 = !DILocation(line: 148, column: 32, scope: !351) -!357 = !DILocalVariable(name: "status", scope: !351, file: !2, line: 150, type: !155) -!358 = !DILocation(line: 150, column: 9, scope: !351) -!359 = !DILocalVariable(name: "attr", scope: !351, file: !2, line: 151, type: !360) -!360 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_condattr_t", file: !361, line: 31, baseType: !362) -!361 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h", directory: "") -!362 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_condattr_t", file: !105, line: 111, baseType: !363) -!363 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_condattr_t", file: !105, line: 73, size: 128, elements: !364) -!364 = !{!365, !366} -!365 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !363, file: !105, line: 74, baseType: !109, size: 64) -!366 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !363, file: !105, line: 75, baseType: !44, size: 64, offset: 64) -!367 = !DILocation(line: 151, column: 24, scope: !351) -!368 = !DILocation(line: 153, column: 14, scope: !351) -!369 = !DILocation(line: 153, column: 12, scope: !351) -!370 = !DILocation(line: 154, column: 5, scope: !351) -!371 = !DILocation(line: 156, column: 32, scope: !351) -!372 = !DILocation(line: 156, column: 14, scope: !351) -!373 = !DILocation(line: 156, column: 12, scope: !351) -!374 = !DILocation(line: 157, column: 5, scope: !351) -!375 = !DILocation(line: 159, column: 14, scope: !351) -!376 = !DILocation(line: 159, column: 12, scope: !351) -!377 = !DILocation(line: 160, column: 5, scope: !351) -!378 = !DILocation(line: 161, column: 1, scope: !351) -!379 = distinct !DISubprogram(name: "cond_destroy", scope: !2, file: !2, line: 163, type: !352, scopeLine: 164, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!380 = !DILocalVariable(name: "cond", arg: 1, scope: !379, file: !2, line: 163, type: !354) -!381 = !DILocation(line: 163, column: 35, scope: !379) -!382 = !DILocalVariable(name: "status", scope: !379, file: !2, line: 165, type: !155) -!383 = !DILocation(line: 165, column: 9, scope: !379) -!384 = !DILocation(line: 165, column: 39, scope: !379) -!385 = !DILocation(line: 165, column: 18, scope: !379) -!386 = !DILocation(line: 166, column: 5, scope: !379) -!387 = !DILocation(line: 167, column: 1, scope: !379) -!388 = distinct !DISubprogram(name: "cond_signal", scope: !2, file: !2, line: 169, type: !352, scopeLine: 170, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!389 = !DILocalVariable(name: "cond", arg: 1, scope: !388, file: !2, line: 169, type: !354) -!390 = !DILocation(line: 169, column: 34, scope: !388) -!391 = !DILocalVariable(name: "status", scope: !388, file: !2, line: 171, type: !155) -!392 = !DILocation(line: 171, column: 9, scope: !388) -!393 = !DILocation(line: 171, column: 38, scope: !388) -!394 = !DILocation(line: 171, column: 18, scope: !388) -!395 = !DILocation(line: 172, column: 5, scope: !388) -!396 = !DILocation(line: 173, column: 1, scope: !388) -!397 = distinct !DISubprogram(name: "cond_broadcast", scope: !2, file: !2, line: 175, type: !352, scopeLine: 176, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!398 = !DILocalVariable(name: "cond", arg: 1, scope: !397, file: !2, line: 175, type: !354) -!399 = !DILocation(line: 175, column: 37, scope: !397) -!400 = !DILocalVariable(name: "status", scope: !397, file: !2, line: 177, type: !155) -!401 = !DILocation(line: 177, column: 9, scope: !397) -!402 = !DILocation(line: 177, column: 41, scope: !397) -!403 = !DILocation(line: 177, column: 18, scope: !397) -!404 = !DILocation(line: 178, column: 5, scope: !397) -!405 = !DILocation(line: 179, column: 1, scope: !397) -!406 = distinct !DISubprogram(name: "cond_wait", scope: !2, file: !2, line: 181, type: !407, scopeLine: 182, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!407 = !DISubroutineType(types: !408) -!408 = !{null, !354, !212} -!409 = !DILocalVariable(name: "cond", arg: 1, scope: !406, file: !2, line: 181, type: !354) -!410 = !DILocation(line: 181, column: 32, scope: !406) -!411 = !DILocalVariable(name: "lock", arg: 2, scope: !406, file: !2, line: 181, type: !212) -!412 = !DILocation(line: 181, column: 55, scope: !406) -!413 = !DILocalVariable(name: "status", scope: !406, file: !2, line: 183, type: !155) -!414 = !DILocation(line: 183, column: 9, scope: !406) -!415 = !DILocation(line: 183, column: 36, scope: !406) -!416 = !DILocation(line: 183, column: 42, scope: !406) -!417 = !DILocation(line: 183, column: 18, scope: !406) -!418 = !DILocation(line: 185, column: 1, scope: !406) -!419 = distinct !DISubprogram(name: "cond_timedwait", scope: !2, file: !2, line: 187, type: !420, scopeLine: 188, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!420 = !DISubroutineType(types: !421) -!421 = !{null, !354, !212, !422} -!422 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed) -!423 = !DILocalVariable(name: "cond", arg: 1, scope: !419, file: !2, line: 187, type: !354) -!424 = !DILocation(line: 187, column: 37, scope: !419) -!425 = !DILocalVariable(name: "lock", arg: 2, scope: !419, file: !2, line: 187, type: !212) -!426 = !DILocation(line: 187, column: 60, scope: !419) -!427 = !DILocalVariable(name: "millis", arg: 3, scope: !419, file: !2, line: 187, type: !422) -!428 = !DILocation(line: 187, column: 76, scope: !419) -!429 = !DILocalVariable(name: "ts", scope: !419, file: !2, line: 190, type: !430) -!430 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "timespec", file: !431, line: 33, size: 128, elements: !432) -!431 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_timespec.h", directory: "") -!432 = !{!433, !436} -!433 = !DIDerivedType(tag: DW_TAG_member, name: "tv_sec", scope: !430, file: !431, line: 35, baseType: !434, size: 64) -!434 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_time_t", file: !435, line: 98, baseType: !109) -!435 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/arm/_types.h", directory: "") -!436 = !DIDerivedType(tag: DW_TAG_member, name: "tv_nsec", scope: !430, file: !431, line: 36, baseType: !109, size: 64, offset: 64) -!437 = !DILocation(line: 190, column: 21, scope: !419) -!438 = !DILocation(line: 194, column: 11, scope: !419) -!439 = !DILocalVariable(name: "status", scope: !419, file: !2, line: 195, type: !155) -!440 = !DILocation(line: 195, column: 9, scope: !419) -!441 = !DILocation(line: 195, column: 41, scope: !419) -!442 = !DILocation(line: 195, column: 47, scope: !419) -!443 = !DILocation(line: 195, column: 18, scope: !419) -!444 = !DILocation(line: 196, column: 1, scope: !419) -!445 = distinct !DISubprogram(name: "cond_worker", scope: !2, file: !2, line: 202, type: !167, scopeLine: 203, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!446 = !DILocalVariable(name: "message", arg: 1, scope: !445, file: !2, line: 202, type: !64) -!447 = !DILocation(line: 202, column: 25, scope: !445) -!448 = !DILocalVariable(name: "idle", scope: !445, file: !2, line: 204, type: !298) -!449 = !DILocation(line: 204, column: 10, scope: !445) -!450 = !DILocation(line: 206, column: 9, scope: !451) -!451 = distinct !DILexicalBlock(scope: !445, file: !2, line: 205, column: 5) -!452 = !DILocation(line: 207, column: 9, scope: !451) -!453 = !DILocation(line: 208, column: 9, scope: !451) -!454 = !DILocation(line: 209, column: 9, scope: !451) -!455 = !DILocation(line: 210, column: 16, scope: !451) -!456 = !DILocation(line: 210, column: 22, scope: !451) -!457 = !DILocation(line: 210, column: 14, scope: !451) -!458 = !DILocation(line: 211, column: 9, scope: !451) -!459 = !DILocation(line: 213, column: 9, scope: !460) -!460 = distinct !DILexicalBlock(scope: !445, file: !2, line: 213, column: 9) -!461 = !DILocation(line: 213, column: 9, scope: !445) -!462 = !DILocation(line: 214, column: 25, scope: !460) -!463 = !DILocation(line: 214, column: 34, scope: !460) -!464 = !DILocation(line: 214, column: 9, scope: !460) -!465 = !DILocation(line: 215, column: 10, scope: !445) -!466 = !DILocation(line: 217, column: 9, scope: !467) -!467 = distinct !DILexicalBlock(scope: !445, file: !2, line: 216, column: 5) -!468 = !DILocation(line: 218, column: 9, scope: !467) -!469 = !DILocation(line: 219, column: 9, scope: !467) -!470 = !DILocation(line: 220, column: 9, scope: !467) -!471 = !DILocation(line: 221, column: 16, scope: !467) -!472 = !DILocation(line: 221, column: 22, scope: !467) -!473 = !DILocation(line: 221, column: 14, scope: !467) -!474 = !DILocation(line: 222, column: 9, scope: !467) -!475 = !DILocation(line: 224, column: 9, scope: !476) -!476 = distinct !DILexicalBlock(scope: !445, file: !2, line: 224, column: 9) -!477 = !DILocation(line: 224, column: 9, scope: !445) -!478 = !DILocation(line: 225, column: 25, scope: !476) -!479 = !DILocation(line: 225, column: 34, scope: !476) -!480 = !DILocation(line: 225, column: 9, scope: !476) -!481 = !DILocation(line: 226, column: 12, scope: !445) -!482 = !DILocation(line: 226, column: 5, scope: !445) -!483 = !DILocation(line: 227, column: 1, scope: !445) -!484 = distinct !DISubprogram(name: "cond_test", scope: !2, file: !2, line: 229, type: !318, scopeLine: 230, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!485 = !DILocalVariable(name: "message", scope: !484, file: !2, line: 231, type: !64) -!486 = !DILocation(line: 231, column: 11, scope: !484) -!487 = !DILocation(line: 232, column: 5, scope: !484) -!488 = !DILocation(line: 233, column: 5, scope: !484) -!489 = !DILocalVariable(name: "worker", scope: !484, file: !2, line: 235, type: !128) -!490 = !DILocation(line: 235, column: 15, scope: !484) -!491 = !DILocation(line: 235, column: 51, scope: !484) -!492 = !DILocation(line: 235, column: 24, scope: !484) -!493 = !DILocation(line: 238, column: 9, scope: !494) -!494 = distinct !DILexicalBlock(scope: !484, file: !2, line: 237, column: 5) -!495 = !DILocation(line: 239, column: 9, scope: !494) -!496 = !DILocation(line: 240, column: 9, scope: !494) -!497 = !DILocation(line: 241, column: 9, scope: !494) -!498 = !DILocation(line: 245, column: 9, scope: !499) -!499 = distinct !DILexicalBlock(scope: !484, file: !2, line: 244, column: 5) -!500 = !DILocation(line: 246, column: 9, scope: !499) -!501 = !DILocation(line: 247, column: 9, scope: !499) -!502 = !DILocation(line: 248, column: 9, scope: !499) -!503 = !DILocalVariable(name: "result", scope: !484, file: !2, line: 251, type: !64) -!504 = !DILocation(line: 251, column: 11, scope: !484) -!505 = !DILocation(line: 251, column: 32, scope: !484) -!506 = !DILocation(line: 251, column: 20, scope: !484) -!507 = !DILocation(line: 252, column: 5, scope: !484) -!508 = !DILocation(line: 254, column: 5, scope: !484) -!509 = !DILocation(line: 255, column: 5, scope: !484) -!510 = !DILocation(line: 256, column: 1, scope: !484) -!511 = distinct !DISubprogram(name: "rwlock_init", scope: !2, file: !2, line: 263, type: !512, scopeLine: 264, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!512 = !DISubroutineType(types: !513) -!513 = !{null, !514, !155} -!514 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !515, size: 64) -!515 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlock_t", file: !516, line: 31, baseType: !517) -!516 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h", directory: "") -!517 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlock_t", file: !105, line: 116, baseType: !518) -!518 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlock_t", file: !105, line: 93, size: 1600, elements: !519) -!519 = !{!520, !521} -!520 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !518, file: !105, line: 94, baseType: !109, size: 64) -!521 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !518, file: !105, line: 95, baseType: !522, size: 1536, offset: 64) -!522 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 1536, elements: !523) -!523 = !{!524} -!524 = !DISubrange(count: 192) -!525 = !DILocalVariable(name: "lock", arg: 1, scope: !511, file: !2, line: 263, type: !514) -!526 = !DILocation(line: 263, column: 36, scope: !511) -!527 = !DILocalVariable(name: "shared", arg: 2, scope: !511, file: !2, line: 263, type: !155) -!528 = !DILocation(line: 263, column: 46, scope: !511) -!529 = !DILocalVariable(name: "status", scope: !511, file: !2, line: 265, type: !155) -!530 = !DILocation(line: 265, column: 9, scope: !511) -!531 = !DILocalVariable(name: "value", scope: !511, file: !2, line: 266, type: !155) -!532 = !DILocation(line: 266, column: 9, scope: !511) -!533 = !DILocalVariable(name: "attributes", scope: !511, file: !2, line: 267, type: !534) -!534 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlockattr_t", file: !535, line: 31, baseType: !536) -!535 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h", directory: "") -!536 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlockattr_t", file: !105, line: 117, baseType: !537) -!537 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlockattr_t", file: !105, line: 98, size: 192, elements: !538) -!538 = !{!539, !540} -!539 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !537, file: !105, line: 99, baseType: !109, size: 64) -!540 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !537, file: !105, line: 100, baseType: !541, size: 128, offset: 64) -!541 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 128, elements: !542) -!542 = !{!543} -!543 = !DISubrange(count: 16) -!544 = !DILocation(line: 267, column: 26, scope: !511) -!545 = !DILocation(line: 268, column: 14, scope: !511) -!546 = !DILocation(line: 268, column: 12, scope: !511) -!547 = !DILocation(line: 269, column: 5, scope: !511) -!548 = !DILocation(line: 271, column: 57, scope: !511) -!549 = !DILocation(line: 271, column: 14, scope: !511) -!550 = !DILocation(line: 271, column: 12, scope: !511) -!551 = !DILocation(line: 272, column: 5, scope: !511) -!552 = !DILocation(line: 273, column: 14, scope: !511) -!553 = !DILocation(line: 273, column: 12, scope: !511) -!554 = !DILocation(line: 274, column: 5, scope: !511) -!555 = !DILocation(line: 276, column: 34, scope: !511) -!556 = !DILocation(line: 276, column: 14, scope: !511) -!557 = !DILocation(line: 276, column: 12, scope: !511) -!558 = !DILocation(line: 277, column: 5, scope: !511) -!559 = !DILocation(line: 278, column: 14, scope: !511) -!560 = !DILocation(line: 278, column: 12, scope: !511) -!561 = !DILocation(line: 279, column: 5, scope: !511) -!562 = !DILocation(line: 280, column: 1, scope: !511) -!563 = distinct !DISubprogram(name: "rwlock_destroy", scope: !2, file: !2, line: 282, type: !564, scopeLine: 283, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!564 = !DISubroutineType(types: !565) -!565 = !{null, !514} -!566 = !DILocalVariable(name: "lock", arg: 1, scope: !563, file: !2, line: 282, type: !514) -!567 = !DILocation(line: 282, column: 39, scope: !563) -!568 = !DILocalVariable(name: "status", scope: !563, file: !2, line: 284, type: !155) -!569 = !DILocation(line: 284, column: 9, scope: !563) -!570 = !DILocation(line: 284, column: 41, scope: !563) -!571 = !DILocation(line: 284, column: 18, scope: !563) -!572 = !DILocation(line: 285, column: 5, scope: !563) -!573 = !DILocation(line: 286, column: 1, scope: !563) -!574 = distinct !DISubprogram(name: "rwlock_wrlock", scope: !2, file: !2, line: 288, type: !564, scopeLine: 289, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!575 = !DILocalVariable(name: "lock", arg: 1, scope: !574, file: !2, line: 288, type: !514) -!576 = !DILocation(line: 288, column: 38, scope: !574) -!577 = !DILocalVariable(name: "status", scope: !574, file: !2, line: 290, type: !155) -!578 = !DILocation(line: 290, column: 9, scope: !574) -!579 = !DILocation(line: 290, column: 40, scope: !574) -!580 = !DILocation(line: 290, column: 18, scope: !574) -!581 = !DILocation(line: 291, column: 5, scope: !574) -!582 = !DILocation(line: 292, column: 1, scope: !574) -!583 = distinct !DISubprogram(name: "rwlock_trywrlock", scope: !2, file: !2, line: 294, type: !584, scopeLine: 295, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!584 = !DISubroutineType(types: !585) -!585 = !{!298, !514} -!586 = !DILocalVariable(name: "lock", arg: 1, scope: !583, file: !2, line: 294, type: !514) -!587 = !DILocation(line: 294, column: 41, scope: !583) -!588 = !DILocalVariable(name: "status", scope: !583, file: !2, line: 296, type: !155) -!589 = !DILocation(line: 296, column: 9, scope: !583) -!590 = !DILocation(line: 296, column: 43, scope: !583) -!591 = !DILocation(line: 296, column: 18, scope: !583) -!592 = !DILocation(line: 298, column: 12, scope: !583) -!593 = !DILocation(line: 298, column: 19, scope: !583) -!594 = !DILocation(line: 298, column: 5, scope: !583) -!595 = distinct !DISubprogram(name: "rwlock_rdlock", scope: !2, file: !2, line: 301, type: !564, scopeLine: 302, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!596 = !DILocalVariable(name: "lock", arg: 1, scope: !595, file: !2, line: 301, type: !514) -!597 = !DILocation(line: 301, column: 38, scope: !595) -!598 = !DILocalVariable(name: "status", scope: !595, file: !2, line: 303, type: !155) -!599 = !DILocation(line: 303, column: 9, scope: !595) -!600 = !DILocation(line: 303, column: 40, scope: !595) -!601 = !DILocation(line: 303, column: 18, scope: !595) -!602 = !DILocation(line: 304, column: 5, scope: !595) -!603 = !DILocation(line: 305, column: 1, scope: !595) -!604 = distinct !DISubprogram(name: "rwlock_tryrdlock", scope: !2, file: !2, line: 307, type: !584, scopeLine: 308, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!605 = !DILocalVariable(name: "lock", arg: 1, scope: !604, file: !2, line: 307, type: !514) -!606 = !DILocation(line: 307, column: 41, scope: !604) -!607 = !DILocalVariable(name: "status", scope: !604, file: !2, line: 309, type: !155) -!608 = !DILocation(line: 309, column: 9, scope: !604) -!609 = !DILocation(line: 309, column: 43, scope: !604) -!610 = !DILocation(line: 309, column: 18, scope: !604) -!611 = !DILocation(line: 311, column: 12, scope: !604) -!612 = !DILocation(line: 311, column: 19, scope: !604) -!613 = !DILocation(line: 311, column: 5, scope: !604) -!614 = distinct !DISubprogram(name: "rwlock_unlock", scope: !2, file: !2, line: 314, type: !564, scopeLine: 315, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!615 = !DILocalVariable(name: "lock", arg: 1, scope: !614, file: !2, line: 314, type: !514) -!616 = !DILocation(line: 314, column: 38, scope: !614) -!617 = !DILocalVariable(name: "status", scope: !614, file: !2, line: 316, type: !155) -!618 = !DILocation(line: 316, column: 9, scope: !614) -!619 = !DILocation(line: 316, column: 40, scope: !614) -!620 = !DILocation(line: 316, column: 18, scope: !614) -!621 = !DILocation(line: 317, column: 5, scope: !614) -!622 = !DILocation(line: 318, column: 1, scope: !614) -!623 = distinct !DISubprogram(name: "rwlock_test", scope: !2, file: !2, line: 320, type: !318, scopeLine: 321, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!624 = !DILocalVariable(name: "lock", scope: !623, file: !2, line: 322, type: !515) -!625 = !DILocation(line: 322, column: 22, scope: !623) -!626 = !DILocation(line: 323, column: 5, scope: !623) -!627 = !DILocalVariable(name: "test_depth", scope: !623, file: !2, line: 324, type: !628) -!628 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !155) -!629 = !DILocation(line: 324, column: 15, scope: !623) -!630 = !DILocation(line: 327, column: 9, scope: !631) -!631 = distinct !DILexicalBlock(scope: !623, file: !2, line: 326, column: 5) -!632 = !DILocalVariable(name: "success", scope: !631, file: !2, line: 328, type: !298) -!633 = !DILocation(line: 328, column: 14, scope: !631) -!634 = !DILocation(line: 328, column: 24, scope: !631) -!635 = !DILocation(line: 329, column: 9, scope: !631) -!636 = !DILocation(line: 330, column: 19, scope: !631) -!637 = !DILocation(line: 330, column: 17, scope: !631) -!638 = !DILocation(line: 331, column: 9, scope: !631) -!639 = !DILocation(line: 332, column: 9, scope: !631) -!640 = !DILocation(line: 336, column: 9, scope: !641) -!641 = distinct !DILexicalBlock(scope: !623, file: !2, line: 335, column: 5) -!642 = !DILocalVariable(name: "i", scope: !643, file: !2, line: 337, type: !155) -!643 = distinct !DILexicalBlock(scope: !641, file: !2, line: 337, column: 9) -!644 = !DILocation(line: 337, column: 18, scope: !643) -!645 = !DILocation(line: 337, column: 14, scope: !643) -!646 = !DILocation(line: 337, column: 25, scope: !647) -!647 = distinct !DILexicalBlock(scope: !643, file: !2, line: 337, column: 9) -!648 = !DILocation(line: 337, column: 27, scope: !647) -!649 = !DILocation(line: 337, column: 9, scope: !643) -!650 = !DILocalVariable(name: "success", scope: !651, file: !2, line: 339, type: !298) -!651 = distinct !DILexicalBlock(scope: !647, file: !2, line: 338, column: 9) -!652 = !DILocation(line: 339, column: 18, scope: !651) -!653 = !DILocation(line: 339, column: 28, scope: !651) -!654 = !DILocation(line: 340, column: 13, scope: !651) -!655 = !DILocation(line: 341, column: 9, scope: !651) -!656 = !DILocation(line: 337, column: 42, scope: !647) -!657 = !DILocation(line: 337, column: 9, scope: !647) -!658 = distinct !{!658, !649, !659, !660} -!659 = !DILocation(line: 341, column: 9, scope: !643) -!660 = !{!"llvm.loop.mustprogress"} -!661 = !DILocalVariable(name: "success", scope: !662, file: !2, line: 344, type: !298) -!662 = distinct !DILexicalBlock(scope: !641, file: !2, line: 343, column: 9) -!663 = !DILocation(line: 344, column: 18, scope: !662) -!664 = !DILocation(line: 344, column: 28, scope: !662) -!665 = !DILocation(line: 345, column: 13, scope: !662) -!666 = !DILocation(line: 348, column: 9, scope: !641) -!667 = !DILocalVariable(name: "i", scope: !668, file: !2, line: 349, type: !155) -!668 = distinct !DILexicalBlock(scope: !641, file: !2, line: 349, column: 9) -!669 = !DILocation(line: 349, column: 18, scope: !668) -!670 = !DILocation(line: 349, column: 14, scope: !668) -!671 = !DILocation(line: 349, column: 25, scope: !672) -!672 = distinct !DILexicalBlock(scope: !668, file: !2, line: 349, column: 9) -!673 = !DILocation(line: 349, column: 27, scope: !672) -!674 = !DILocation(line: 349, column: 9, scope: !668) -!675 = !DILocation(line: 350, column: 13, scope: !676) -!676 = distinct !DILexicalBlock(scope: !672, file: !2, line: 349, column: 46) -!677 = !DILocation(line: 351, column: 9, scope: !676) -!678 = !DILocation(line: 349, column: 42, scope: !672) -!679 = !DILocation(line: 349, column: 9, scope: !672) -!680 = distinct !{!680, !674, !681, !660} -!681 = !DILocation(line: 351, column: 9, scope: !668) -!682 = !DILocation(line: 355, column: 9, scope: !683) -!683 = distinct !DILexicalBlock(scope: !623, file: !2, line: 354, column: 5) -!684 = !DILocalVariable(name: "success", scope: !683, file: !2, line: 356, type: !298) -!685 = !DILocation(line: 356, column: 14, scope: !683) -!686 = !DILocation(line: 356, column: 24, scope: !683) -!687 = !DILocation(line: 357, column: 9, scope: !683) -!688 = !DILocation(line: 360, column: 5, scope: !623) -!689 = !DILocation(line: 361, column: 1, scope: !623) -!690 = distinct !DISubprogram(name: "key_destroy", scope: !2, file: !2, line: 368, type: !141, scopeLine: 369, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!691 = !DILocalVariable(name: "unused_value", arg: 1, scope: !690, file: !2, line: 368, type: !64) -!692 = !DILocation(line: 368, column: 24, scope: !690) -!693 = !DILocation(line: 370, column: 21, scope: !690) -!694 = !DILocation(line: 370, column: 19, scope: !690) -!695 = !DILocation(line: 371, column: 1, scope: !690) -!696 = distinct !DISubprogram(name: "key_worker", scope: !2, file: !2, line: 373, type: !167, scopeLine: 374, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!697 = !DILocalVariable(name: "message", arg: 1, scope: !696, file: !2, line: 373, type: !64) -!698 = !DILocation(line: 373, column: 24, scope: !696) -!699 = !DILocalVariable(name: "my_secret", scope: !696, file: !2, line: 375, type: !155) -!700 = !DILocation(line: 375, column: 9, scope: !696) -!701 = !DILocalVariable(name: "status", scope: !696, file: !2, line: 377, type: !155) -!702 = !DILocation(line: 377, column: 9, scope: !696) -!703 = !DILocation(line: 377, column: 38, scope: !696) -!704 = !DILocation(line: 377, column: 18, scope: !696) -!705 = !DILocation(line: 378, column: 5, scope: !696) -!706 = !DILocalVariable(name: "my_local_data", scope: !696, file: !2, line: 380, type: !64) -!707 = !DILocation(line: 380, column: 11, scope: !696) -!708 = !DILocation(line: 380, column: 47, scope: !696) -!709 = !DILocation(line: 380, column: 27, scope: !696) -!710 = !DILocation(line: 381, column: 5, scope: !696) -!711 = !DILocation(line: 383, column: 12, scope: !696) -!712 = !DILocation(line: 383, column: 5, scope: !696) -!713 = distinct !DISubprogram(name: "key_test", scope: !2, file: !2, line: 386, type: !318, scopeLine: 387, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!714 = !DILocalVariable(name: "my_secret", scope: !713, file: !2, line: 388, type: !155) -!715 = !DILocation(line: 388, column: 9, scope: !713) -!716 = !DILocalVariable(name: "message", scope: !713, file: !2, line: 389, type: !64) -!717 = !DILocation(line: 389, column: 11, scope: !713) -!718 = !DILocalVariable(name: "status", scope: !713, file: !2, line: 390, type: !155) -!719 = !DILocation(line: 390, column: 9, scope: !713) -!720 = !DILocation(line: 392, column: 5, scope: !713) -!721 = !DILocalVariable(name: "worker", scope: !713, file: !2, line: 394, type: !128) -!722 = !DILocation(line: 394, column: 15, scope: !713) -!723 = !DILocation(line: 394, column: 50, scope: !713) -!724 = !DILocation(line: 394, column: 24, scope: !713) -!725 = !DILocation(line: 396, column: 34, scope: !713) -!726 = !DILocation(line: 396, column: 14, scope: !713) -!727 = !DILocation(line: 396, column: 12, scope: !713) -!728 = !DILocation(line: 397, column: 5, scope: !713) -!729 = !DILocalVariable(name: "my_local_data", scope: !713, file: !2, line: 399, type: !64) -!730 = !DILocation(line: 399, column: 11, scope: !713) -!731 = !DILocation(line: 399, column: 47, scope: !713) -!732 = !DILocation(line: 399, column: 27, scope: !713) -!733 = !DILocation(line: 400, column: 5, scope: !713) -!734 = !DILocation(line: 402, column: 34, scope: !713) -!735 = !DILocation(line: 402, column: 14, scope: !713) -!736 = !DILocation(line: 402, column: 12, scope: !713) -!737 = !DILocation(line: 403, column: 5, scope: !713) -!738 = !DILocalVariable(name: "result", scope: !713, file: !2, line: 405, type: !64) -!739 = !DILocation(line: 405, column: 11, scope: !713) -!740 = !DILocation(line: 405, column: 32, scope: !713) -!741 = !DILocation(line: 405, column: 20, scope: !713) -!742 = !DILocation(line: 406, column: 5, scope: !713) -!743 = !DILocation(line: 408, column: 33, scope: !713) -!744 = !DILocation(line: 408, column: 14, scope: !713) -!745 = !DILocation(line: 408, column: 12, scope: !713) -!746 = !DILocation(line: 409, column: 5, scope: !713) -!747 = !DILocation(line: 411, column: 5, scope: !713) -!748 = !DILocation(line: 412, column: 1, scope: !713) -!749 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 414, type: !750, scopeLine: 415, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !169) -!750 = !DISubroutineType(types: !751) -!751 = !{!155} -!752 = !DILocation(line: 416, column: 5, scope: !749) -!753 = !DILocation(line: 417, column: 5, scope: !749) -!754 = !DILocation(line: 418, column: 5, scope: !749) -!755 = !DILocation(line: 419, column: 5, scope: !749) -!756 = !DILocation(line: 420, column: 1, scope: !749) +!115 = distinct !DIGlobalVariable(name: "latest_thread", scope: !61, file: !2, line: 366, type: !116, isLocal: false, isDefinition: true) +!116 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_t", file: !117, line: 31, baseType: !118) +!117 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_t.h", directory: "") +!118 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_t", file: !93, line: 118, baseType: !119) +!119 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !120, size: 64) +!120 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_t", file: !93, line: 103, size: 65536, elements: !121) +!121 = !{!122, !123, !133} +!122 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !120, file: !93, line: 104, baseType: !97, size: 64) +!123 = !DIDerivedType(tag: DW_TAG_member, name: "__cleanup_stack", scope: !120, file: !93, line: 105, baseType: !124, size: 64, offset: 64) +!124 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !125, size: 64) +!125 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__darwin_pthread_handler_rec", file: !93, line: 57, size: 192, elements: !126) +!126 = !{!127, !131, !132} +!127 = !DIDerivedType(tag: DW_TAG_member, name: "__routine", scope: !125, file: !93, line: 58, baseType: !128, size: 64) +!128 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !129, size: 64) +!129 = !DISubroutineType(types: !130) +!130 = !{null, !64} +!131 = !DIDerivedType(tag: DW_TAG_member, name: "__arg", scope: !125, file: !93, line: 59, baseType: !64, size: 64, offset: 64) +!132 = !DIDerivedType(tag: DW_TAG_member, name: "__next", scope: !125, file: !93, line: 60, baseType: !124, size: 64, offset: 128) +!133 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !120, file: !93, line: 106, baseType: !134, size: 65408, offset: 128) +!134 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 65408, elements: !135) +!135 = !{!136} +!136 = !DISubrange(count: 8176) +!137 = !DIGlobalVariableExpression(var: !138, expr: !DIExpression()) +!138 = distinct !DIGlobalVariable(name: "local_data", scope: !61, file: !2, line: 367, type: !139, isLocal: false, isDefinition: true) +!139 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_key_t", file: !140, line: 31, baseType: !141) +!140 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_key_t.h", directory: "") +!141 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_key_t", file: !93, line: 112, baseType: !142) +!142 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned) +!143 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!144 = !{i32 7, !"Dwarf Version", i32 4} +!145 = !{i32 2, !"Debug Info Version", i32 3} +!146 = !{i32 1, !"wchar_size", i32 4} +!147 = !{i32 7, !"PIC Level", i32 2} +!148 = !{i32 7, !"uwtable", i32 2} +!149 = !{i32 7, !"frame-pointer", i32 1} +!150 = !{!"Homebrew clang version 15.0.7"} +!151 = distinct !DISubprogram(name: "thread_create", scope: !2, file: !2, line: 12, type: !152, scopeLine: 13, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!152 = !DISubroutineType(types: !153) +!153 = !{!116, !154, !64} +!154 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !155, size: 64) +!155 = !DISubroutineType(types: !156) +!156 = !{!64, !64} +!157 = !{} +!158 = !DILocalVariable(name: "runner", arg: 1, scope: !151, file: !2, line: 12, type: !154) +!159 = !DILocation(line: 12, column: 32, scope: !151) +!160 = !DILocalVariable(name: "data", arg: 2, scope: !151, file: !2, line: 12, type: !64) +!161 = !DILocation(line: 12, column: 54, scope: !151) +!162 = !DILocalVariable(name: "id", scope: !151, file: !2, line: 14, type: !116) +!163 = !DILocation(line: 14, column: 15, scope: !151) +!164 = !DILocalVariable(name: "attr", scope: !151, file: !2, line: 15, type: !165) +!165 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_attr_t", file: !166, line: 31, baseType: !167) +!166 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_attr_t.h", directory: "") +!167 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_attr_t", file: !93, line: 109, baseType: !168) +!168 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_attr_t", file: !93, line: 63, size: 512, elements: !169) +!169 = !{!170, !171} +!170 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !168, file: !93, line: 64, baseType: !97, size: 64) +!171 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !168, file: !93, line: 65, baseType: !99, size: 448, offset: 64) +!172 = !DILocation(line: 15, column: 20, scope: !151) +!173 = !DILocation(line: 16, column: 5, scope: !151) +!174 = !DILocalVariable(name: "status", scope: !151, file: !2, line: 17, type: !143) +!175 = !DILocation(line: 17, column: 9, scope: !151) +!176 = !DILocation(line: 17, column: 45, scope: !151) +!177 = !DILocation(line: 17, column: 53, scope: !151) +!178 = !DILocation(line: 17, column: 18, scope: !151) +!179 = !DILocation(line: 18, column: 5, scope: !151) +!180 = !DILocation(line: 19, column: 5, scope: !151) +!181 = !DILocation(line: 20, column: 12, scope: !151) +!182 = !DILocation(line: 20, column: 5, scope: !151) +!183 = distinct !DISubprogram(name: "thread_join", scope: !2, file: !2, line: 23, type: !184, scopeLine: 24, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!184 = !DISubroutineType(types: !185) +!185 = !{!64, !116} +!186 = !DILocalVariable(name: "id", arg: 1, scope: !183, file: !2, line: 23, type: !116) +!187 = !DILocation(line: 23, column: 29, scope: !183) +!188 = !DILocalVariable(name: "result", scope: !183, file: !2, line: 25, type: !64) +!189 = !DILocation(line: 25, column: 11, scope: !183) +!190 = !DILocalVariable(name: "status", scope: !183, file: !2, line: 26, type: !143) +!191 = !DILocation(line: 26, column: 9, scope: !183) +!192 = !DILocation(line: 26, column: 31, scope: !183) +!193 = !DILocation(line: 26, column: 18, scope: !183) +!194 = !DILocation(line: 27, column: 5, scope: !183) +!195 = !DILocation(line: 28, column: 12, scope: !183) +!196 = !DILocation(line: 28, column: 5, scope: !183) +!197 = distinct !DISubprogram(name: "mutex_init", scope: !2, file: !2, line: 43, type: !198, scopeLine: 44, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!198 = !DISubroutineType(types: !199) +!199 = !{null, !200, !143, !143, !143, !143} +!200 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !90, size: 64) +!201 = !DILocalVariable(name: "lock", arg: 1, scope: !197, file: !2, line: 43, type: !200) +!202 = !DILocation(line: 43, column: 34, scope: !197) +!203 = !DILocalVariable(name: "type", arg: 2, scope: !197, file: !2, line: 43, type: !143) +!204 = !DILocation(line: 43, column: 44, scope: !197) +!205 = !DILocalVariable(name: "protocol", arg: 3, scope: !197, file: !2, line: 43, type: !143) +!206 = !DILocation(line: 43, column: 54, scope: !197) +!207 = !DILocalVariable(name: "policy", arg: 4, scope: !197, file: !2, line: 43, type: !143) +!208 = !DILocation(line: 43, column: 68, scope: !197) +!209 = !DILocalVariable(name: "prioceiling", arg: 5, scope: !197, file: !2, line: 43, type: !143) +!210 = !DILocation(line: 43, column: 80, scope: !197) +!211 = !DILocalVariable(name: "status", scope: !197, file: !2, line: 45, type: !143) +!212 = !DILocation(line: 45, column: 9, scope: !197) +!213 = !DILocalVariable(name: "value", scope: !197, file: !2, line: 46, type: !143) +!214 = !DILocation(line: 46, column: 9, scope: !197) +!215 = !DILocalVariable(name: "attributes", scope: !197, file: !2, line: 47, type: !216) +!216 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_mutexattr_t", file: !217, line: 31, baseType: !218) +!217 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h", directory: "") +!218 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_mutexattr_t", file: !93, line: 114, baseType: !219) +!219 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_mutexattr_t", file: !93, line: 83, size: 128, elements: !220) +!220 = !{!221, !222} +!221 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !219, file: !93, line: 84, baseType: !97, size: 64) +!222 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !219, file: !93, line: 85, baseType: !44, size: 64, offset: 64) +!223 = !DILocation(line: 47, column: 25, scope: !197) +!224 = !DILocation(line: 48, column: 14, scope: !197) +!225 = !DILocation(line: 48, column: 12, scope: !197) +!226 = !DILocation(line: 49, column: 5, scope: !197) +!227 = !DILocation(line: 51, column: 53, scope: !197) +!228 = !DILocation(line: 51, column: 14, scope: !197) +!229 = !DILocation(line: 51, column: 12, scope: !197) +!230 = !DILocation(line: 52, column: 5, scope: !197) +!231 = !DILocation(line: 53, column: 14, scope: !197) +!232 = !DILocation(line: 53, column: 12, scope: !197) +!233 = !DILocation(line: 54, column: 5, scope: !197) +!234 = !DILocation(line: 56, column: 57, scope: !197) +!235 = !DILocation(line: 56, column: 14, scope: !197) +!236 = !DILocation(line: 56, column: 12, scope: !197) +!237 = !DILocation(line: 57, column: 5, scope: !197) +!238 = !DILocation(line: 58, column: 14, scope: !197) +!239 = !DILocation(line: 58, column: 12, scope: !197) +!240 = !DILocation(line: 59, column: 5, scope: !197) +!241 = !DILocation(line: 61, column: 58, scope: !197) +!242 = !DILocation(line: 61, column: 14, scope: !197) +!243 = !DILocation(line: 61, column: 12, scope: !197) +!244 = !DILocation(line: 62, column: 5, scope: !197) +!245 = !DILocation(line: 63, column: 14, scope: !197) +!246 = !DILocation(line: 63, column: 12, scope: !197) +!247 = !DILocation(line: 64, column: 5, scope: !197) +!248 = !DILocation(line: 66, column: 60, scope: !197) +!249 = !DILocation(line: 66, column: 14, scope: !197) +!250 = !DILocation(line: 66, column: 12, scope: !197) +!251 = !DILocation(line: 67, column: 5, scope: !197) +!252 = !DILocation(line: 68, column: 14, scope: !197) +!253 = !DILocation(line: 68, column: 12, scope: !197) +!254 = !DILocation(line: 69, column: 5, scope: !197) +!255 = !DILocation(line: 71, column: 33, scope: !197) +!256 = !DILocation(line: 71, column: 14, scope: !197) +!257 = !DILocation(line: 71, column: 12, scope: !197) +!258 = !DILocation(line: 72, column: 5, scope: !197) +!259 = !DILocation(line: 73, column: 14, scope: !197) +!260 = !DILocation(line: 73, column: 12, scope: !197) +!261 = !DILocation(line: 74, column: 5, scope: !197) +!262 = !DILocation(line: 75, column: 1, scope: !197) +!263 = distinct !DISubprogram(name: "mutex_destroy", scope: !2, file: !2, line: 77, type: !264, scopeLine: 78, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!264 = !DISubroutineType(types: !265) +!265 = !{null, !200} +!266 = !DILocalVariable(name: "lock", arg: 1, scope: !263, file: !2, line: 77, type: !200) +!267 = !DILocation(line: 77, column: 37, scope: !263) +!268 = !DILocalVariable(name: "status", scope: !263, file: !2, line: 79, type: !143) +!269 = !DILocation(line: 79, column: 9, scope: !263) +!270 = !DILocation(line: 79, column: 40, scope: !263) +!271 = !DILocation(line: 79, column: 18, scope: !263) +!272 = !DILocation(line: 80, column: 5, scope: !263) +!273 = !DILocation(line: 81, column: 1, scope: !263) +!274 = distinct !DISubprogram(name: "mutex_lock", scope: !2, file: !2, line: 83, type: !264, scopeLine: 84, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!275 = !DILocalVariable(name: "lock", arg: 1, scope: !274, file: !2, line: 83, type: !200) +!276 = !DILocation(line: 83, column: 34, scope: !274) +!277 = !DILocalVariable(name: "status", scope: !274, file: !2, line: 85, type: !143) +!278 = !DILocation(line: 85, column: 9, scope: !274) +!279 = !DILocation(line: 85, column: 37, scope: !274) +!280 = !DILocation(line: 85, column: 18, scope: !274) +!281 = !DILocation(line: 86, column: 5, scope: !274) +!282 = !DILocation(line: 87, column: 1, scope: !274) +!283 = distinct !DISubprogram(name: "mutex_trylock", scope: !2, file: !2, line: 89, type: !284, scopeLine: 90, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!284 = !DISubroutineType(types: !285) +!285 = !{!286, !200} +!286 = !DIBasicType(name: "_Bool", size: 8, encoding: DW_ATE_boolean) +!287 = !DILocalVariable(name: "lock", arg: 1, scope: !283, file: !2, line: 89, type: !200) +!288 = !DILocation(line: 89, column: 37, scope: !283) +!289 = !DILocalVariable(name: "status", scope: !283, file: !2, line: 91, type: !143) +!290 = !DILocation(line: 91, column: 9, scope: !283) +!291 = !DILocation(line: 91, column: 40, scope: !283) +!292 = !DILocation(line: 91, column: 18, scope: !283) +!293 = !DILocation(line: 93, column: 12, scope: !283) +!294 = !DILocation(line: 93, column: 19, scope: !283) +!295 = !DILocation(line: 93, column: 5, scope: !283) +!296 = distinct !DISubprogram(name: "mutex_unlock", scope: !2, file: !2, line: 96, type: !264, scopeLine: 97, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!297 = !DILocalVariable(name: "lock", arg: 1, scope: !296, file: !2, line: 96, type: !200) +!298 = !DILocation(line: 96, column: 36, scope: !296) +!299 = !DILocalVariable(name: "status", scope: !296, file: !2, line: 98, type: !143) +!300 = !DILocation(line: 98, column: 9, scope: !296) +!301 = !DILocation(line: 98, column: 39, scope: !296) +!302 = !DILocation(line: 98, column: 18, scope: !296) +!303 = !DILocation(line: 99, column: 5, scope: !296) +!304 = !DILocation(line: 100, column: 1, scope: !296) +!305 = distinct !DISubprogram(name: "mutex_test", scope: !2, file: !2, line: 102, type: !306, scopeLine: 103, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!306 = !DISubroutineType(types: !307) +!307 = !{null} +!308 = !DILocalVariable(name: "mutex0", scope: !305, file: !2, line: 104, type: !90) +!309 = !DILocation(line: 104, column: 21, scope: !305) +!310 = !DILocalVariable(name: "mutex1", scope: !305, file: !2, line: 105, type: !90) +!311 = !DILocation(line: 105, column: 21, scope: !305) +!312 = !DILocation(line: 107, column: 5, scope: !305) +!313 = !DILocation(line: 108, column: 5, scope: !305) +!314 = !DILocation(line: 111, column: 9, scope: !315) +!315 = distinct !DILexicalBlock(scope: !305, file: !2, line: 110, column: 5) +!316 = !DILocalVariable(name: "success", scope: !315, file: !2, line: 112, type: !286) +!317 = !DILocation(line: 112, column: 14, scope: !315) +!318 = !DILocation(line: 112, column: 24, scope: !315) +!319 = !DILocation(line: 113, column: 9, scope: !315) +!320 = !DILocation(line: 114, column: 9, scope: !315) +!321 = !DILocation(line: 118, column: 9, scope: !322) +!322 = distinct !DILexicalBlock(scope: !305, file: !2, line: 117, column: 5) +!323 = !DILocalVariable(name: "success", scope: !324, file: !2, line: 121, type: !286) +!324 = distinct !DILexicalBlock(scope: !322, file: !2, line: 120, column: 9) +!325 = !DILocation(line: 121, column: 18, scope: !324) +!326 = !DILocation(line: 121, column: 28, scope: !324) +!327 = !DILocation(line: 122, column: 13, scope: !324) +!328 = !DILocation(line: 123, column: 13, scope: !324) +!329 = !DILocalVariable(name: "success", scope: !330, file: !2, line: 127, type: !286) +!330 = distinct !DILexicalBlock(scope: !322, file: !2, line: 126, column: 9) +!331 = !DILocation(line: 127, column: 18, scope: !330) +!332 = !DILocation(line: 127, column: 28, scope: !330) +!333 = !DILocation(line: 128, column: 13, scope: !330) +!334 = !DILocation(line: 129, column: 13, scope: !330) +!335 = !DILocation(line: 139, column: 9, scope: !322) +!336 = !DILocation(line: 142, column: 5, scope: !305) +!337 = !DILocation(line: 143, column: 5, scope: !305) +!338 = !DILocation(line: 144, column: 1, scope: !305) +!339 = distinct !DISubprogram(name: "cond_init", scope: !2, file: !2, line: 148, type: !340, scopeLine: 149, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!340 = !DISubroutineType(types: !341) +!341 = !{null, !342} +!342 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !104, size: 64) +!343 = !DILocalVariable(name: "cond", arg: 1, scope: !339, file: !2, line: 148, type: !342) +!344 = !DILocation(line: 148, column: 32, scope: !339) +!345 = !DILocalVariable(name: "status", scope: !339, file: !2, line: 150, type: !143) +!346 = !DILocation(line: 150, column: 9, scope: !339) +!347 = !DILocalVariable(name: "attr", scope: !339, file: !2, line: 151, type: !348) +!348 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_condattr_t", file: !349, line: 31, baseType: !350) +!349 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h", directory: "") +!350 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_condattr_t", file: !93, line: 111, baseType: !351) +!351 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_condattr_t", file: !93, line: 73, size: 128, elements: !352) +!352 = !{!353, !354} +!353 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !351, file: !93, line: 74, baseType: !97, size: 64) +!354 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !351, file: !93, line: 75, baseType: !44, size: 64, offset: 64) +!355 = !DILocation(line: 151, column: 24, scope: !339) +!356 = !DILocation(line: 153, column: 14, scope: !339) +!357 = !DILocation(line: 153, column: 12, scope: !339) +!358 = !DILocation(line: 154, column: 5, scope: !339) +!359 = !DILocation(line: 156, column: 32, scope: !339) +!360 = !DILocation(line: 156, column: 14, scope: !339) +!361 = !DILocation(line: 156, column: 12, scope: !339) +!362 = !DILocation(line: 157, column: 5, scope: !339) +!363 = !DILocation(line: 159, column: 14, scope: !339) +!364 = !DILocation(line: 159, column: 12, scope: !339) +!365 = !DILocation(line: 160, column: 5, scope: !339) +!366 = !DILocation(line: 161, column: 1, scope: !339) +!367 = distinct !DISubprogram(name: "cond_destroy", scope: !2, file: !2, line: 163, type: !340, scopeLine: 164, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!368 = !DILocalVariable(name: "cond", arg: 1, scope: !367, file: !2, line: 163, type: !342) +!369 = !DILocation(line: 163, column: 35, scope: !367) +!370 = !DILocalVariable(name: "status", scope: !367, file: !2, line: 165, type: !143) +!371 = !DILocation(line: 165, column: 9, scope: !367) +!372 = !DILocation(line: 165, column: 39, scope: !367) +!373 = !DILocation(line: 165, column: 18, scope: !367) +!374 = !DILocation(line: 166, column: 5, scope: !367) +!375 = !DILocation(line: 167, column: 1, scope: !367) +!376 = distinct !DISubprogram(name: "cond_signal", scope: !2, file: !2, line: 169, type: !340, scopeLine: 170, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!377 = !DILocalVariable(name: "cond", arg: 1, scope: !376, file: !2, line: 169, type: !342) +!378 = !DILocation(line: 169, column: 34, scope: !376) +!379 = !DILocalVariable(name: "status", scope: !376, file: !2, line: 171, type: !143) +!380 = !DILocation(line: 171, column: 9, scope: !376) +!381 = !DILocation(line: 171, column: 38, scope: !376) +!382 = !DILocation(line: 171, column: 18, scope: !376) +!383 = !DILocation(line: 172, column: 5, scope: !376) +!384 = !DILocation(line: 173, column: 1, scope: !376) +!385 = distinct !DISubprogram(name: "cond_broadcast", scope: !2, file: !2, line: 175, type: !340, scopeLine: 176, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!386 = !DILocalVariable(name: "cond", arg: 1, scope: !385, file: !2, line: 175, type: !342) +!387 = !DILocation(line: 175, column: 37, scope: !385) +!388 = !DILocalVariable(name: "status", scope: !385, file: !2, line: 177, type: !143) +!389 = !DILocation(line: 177, column: 9, scope: !385) +!390 = !DILocation(line: 177, column: 41, scope: !385) +!391 = !DILocation(line: 177, column: 18, scope: !385) +!392 = !DILocation(line: 178, column: 5, scope: !385) +!393 = !DILocation(line: 179, column: 1, scope: !385) +!394 = distinct !DISubprogram(name: "cond_wait", scope: !2, file: !2, line: 181, type: !395, scopeLine: 182, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!395 = !DISubroutineType(types: !396) +!396 = !{null, !342, !200} +!397 = !DILocalVariable(name: "cond", arg: 1, scope: !394, file: !2, line: 181, type: !342) +!398 = !DILocation(line: 181, column: 32, scope: !394) +!399 = !DILocalVariable(name: "lock", arg: 2, scope: !394, file: !2, line: 181, type: !200) +!400 = !DILocation(line: 181, column: 55, scope: !394) +!401 = !DILocalVariable(name: "status", scope: !394, file: !2, line: 183, type: !143) +!402 = !DILocation(line: 183, column: 9, scope: !394) +!403 = !DILocation(line: 183, column: 36, scope: !394) +!404 = !DILocation(line: 183, column: 42, scope: !394) +!405 = !DILocation(line: 183, column: 18, scope: !394) +!406 = !DILocation(line: 185, column: 1, scope: !394) +!407 = distinct !DISubprogram(name: "cond_timedwait", scope: !2, file: !2, line: 187, type: !408, scopeLine: 188, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!408 = !DISubroutineType(types: !409) +!409 = !{null, !342, !200, !410} +!410 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed) +!411 = !DILocalVariable(name: "cond", arg: 1, scope: !407, file: !2, line: 187, type: !342) +!412 = !DILocation(line: 187, column: 37, scope: !407) +!413 = !DILocalVariable(name: "lock", arg: 2, scope: !407, file: !2, line: 187, type: !200) +!414 = !DILocation(line: 187, column: 60, scope: !407) +!415 = !DILocalVariable(name: "millis", arg: 3, scope: !407, file: !2, line: 187, type: !410) +!416 = !DILocation(line: 187, column: 76, scope: !407) +!417 = !DILocalVariable(name: "ts", scope: !407, file: !2, line: 190, type: !418) +!418 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "timespec", file: !419, line: 33, size: 128, elements: !420) +!419 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_timespec.h", directory: "") +!420 = !{!421, !424} +!421 = !DIDerivedType(tag: DW_TAG_member, name: "tv_sec", scope: !418, file: !419, line: 35, baseType: !422, size: 64) +!422 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_time_t", file: !423, line: 98, baseType: !97) +!423 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/arm/_types.h", directory: "") +!424 = !DIDerivedType(tag: DW_TAG_member, name: "tv_nsec", scope: !418, file: !419, line: 36, baseType: !97, size: 64, offset: 64) +!425 = !DILocation(line: 190, column: 21, scope: !407) +!426 = !DILocation(line: 194, column: 11, scope: !407) +!427 = !DILocalVariable(name: "status", scope: !407, file: !2, line: 195, type: !143) +!428 = !DILocation(line: 195, column: 9, scope: !407) +!429 = !DILocation(line: 195, column: 41, scope: !407) +!430 = !DILocation(line: 195, column: 47, scope: !407) +!431 = !DILocation(line: 195, column: 18, scope: !407) +!432 = !DILocation(line: 196, column: 1, scope: !407) +!433 = distinct !DISubprogram(name: "cond_worker", scope: !2, file: !2, line: 202, type: !155, scopeLine: 203, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!434 = !DILocalVariable(name: "message", arg: 1, scope: !433, file: !2, line: 202, type: !64) +!435 = !DILocation(line: 202, column: 25, scope: !433) +!436 = !DILocalVariable(name: "idle", scope: !433, file: !2, line: 204, type: !286) +!437 = !DILocation(line: 204, column: 10, scope: !433) +!438 = !DILocation(line: 206, column: 9, scope: !439) +!439 = distinct !DILexicalBlock(scope: !433, file: !2, line: 205, column: 5) +!440 = !DILocation(line: 207, column: 9, scope: !439) +!441 = !DILocation(line: 208, column: 9, scope: !439) +!442 = !DILocation(line: 209, column: 9, scope: !439) +!443 = !DILocation(line: 210, column: 16, scope: !439) +!444 = !DILocation(line: 210, column: 22, scope: !439) +!445 = !DILocation(line: 210, column: 14, scope: !439) +!446 = !DILocation(line: 211, column: 9, scope: !439) +!447 = !DILocation(line: 213, column: 9, scope: !448) +!448 = distinct !DILexicalBlock(scope: !433, file: !2, line: 213, column: 9) +!449 = !DILocation(line: 213, column: 9, scope: !433) +!450 = !DILocation(line: 214, column: 25, scope: !448) +!451 = !DILocation(line: 214, column: 34, scope: !448) +!452 = !DILocation(line: 214, column: 9, scope: !448) +!453 = !DILocation(line: 215, column: 10, scope: !433) +!454 = !DILocation(line: 217, column: 9, scope: !455) +!455 = distinct !DILexicalBlock(scope: !433, file: !2, line: 216, column: 5) +!456 = !DILocation(line: 218, column: 9, scope: !455) +!457 = !DILocation(line: 219, column: 9, scope: !455) +!458 = !DILocation(line: 220, column: 9, scope: !455) +!459 = !DILocation(line: 221, column: 16, scope: !455) +!460 = !DILocation(line: 221, column: 22, scope: !455) +!461 = !DILocation(line: 221, column: 14, scope: !455) +!462 = !DILocation(line: 222, column: 9, scope: !455) +!463 = !DILocation(line: 224, column: 9, scope: !464) +!464 = distinct !DILexicalBlock(scope: !433, file: !2, line: 224, column: 9) +!465 = !DILocation(line: 224, column: 9, scope: !433) +!466 = !DILocation(line: 225, column: 25, scope: !464) +!467 = !DILocation(line: 225, column: 34, scope: !464) +!468 = !DILocation(line: 225, column: 9, scope: !464) +!469 = !DILocation(line: 226, column: 12, scope: !433) +!470 = !DILocation(line: 226, column: 5, scope: !433) +!471 = !DILocation(line: 227, column: 1, scope: !433) +!472 = distinct !DISubprogram(name: "cond_test", scope: !2, file: !2, line: 229, type: !306, scopeLine: 230, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!473 = !DILocalVariable(name: "message", scope: !472, file: !2, line: 231, type: !64) +!474 = !DILocation(line: 231, column: 11, scope: !472) +!475 = !DILocation(line: 232, column: 5, scope: !472) +!476 = !DILocation(line: 233, column: 5, scope: !472) +!477 = !DILocalVariable(name: "worker", scope: !472, file: !2, line: 235, type: !116) +!478 = !DILocation(line: 235, column: 15, scope: !472) +!479 = !DILocation(line: 235, column: 51, scope: !472) +!480 = !DILocation(line: 235, column: 24, scope: !472) +!481 = !DILocation(line: 238, column: 9, scope: !482) +!482 = distinct !DILexicalBlock(scope: !472, file: !2, line: 237, column: 5) +!483 = !DILocation(line: 239, column: 9, scope: !482) +!484 = !DILocation(line: 240, column: 9, scope: !482) +!485 = !DILocation(line: 241, column: 9, scope: !482) +!486 = !DILocation(line: 245, column: 9, scope: !487) +!487 = distinct !DILexicalBlock(scope: !472, file: !2, line: 244, column: 5) +!488 = !DILocation(line: 246, column: 9, scope: !487) +!489 = !DILocation(line: 247, column: 9, scope: !487) +!490 = !DILocation(line: 248, column: 9, scope: !487) +!491 = !DILocalVariable(name: "result", scope: !472, file: !2, line: 251, type: !64) +!492 = !DILocation(line: 251, column: 11, scope: !472) +!493 = !DILocation(line: 251, column: 32, scope: !472) +!494 = !DILocation(line: 251, column: 20, scope: !472) +!495 = !DILocation(line: 254, column: 5, scope: !472) +!496 = !DILocation(line: 255, column: 5, scope: !472) +!497 = !DILocation(line: 256, column: 1, scope: !472) +!498 = distinct !DISubprogram(name: "rwlock_init", scope: !2, file: !2, line: 263, type: !499, scopeLine: 264, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!499 = !DISubroutineType(types: !500) +!500 = !{null, !501, !143} +!501 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !502, size: 64) +!502 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlock_t", file: !503, line: 31, baseType: !504) +!503 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h", directory: "") +!504 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlock_t", file: !93, line: 116, baseType: !505) +!505 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlock_t", file: !93, line: 93, size: 1600, elements: !506) +!506 = !{!507, !508} +!507 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !505, file: !93, line: 94, baseType: !97, size: 64) +!508 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !505, file: !93, line: 95, baseType: !509, size: 1536, offset: 64) +!509 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 1536, elements: !510) +!510 = !{!511} +!511 = !DISubrange(count: 192) +!512 = !DILocalVariable(name: "lock", arg: 1, scope: !498, file: !2, line: 263, type: !501) +!513 = !DILocation(line: 263, column: 36, scope: !498) +!514 = !DILocalVariable(name: "shared", arg: 2, scope: !498, file: !2, line: 263, type: !143) +!515 = !DILocation(line: 263, column: 46, scope: !498) +!516 = !DILocalVariable(name: "status", scope: !498, file: !2, line: 265, type: !143) +!517 = !DILocation(line: 265, column: 9, scope: !498) +!518 = !DILocalVariable(name: "value", scope: !498, file: !2, line: 266, type: !143) +!519 = !DILocation(line: 266, column: 9, scope: !498) +!520 = !DILocalVariable(name: "attributes", scope: !498, file: !2, line: 267, type: !521) +!521 = !DIDerivedType(tag: DW_TAG_typedef, name: "pthread_rwlockattr_t", file: !522, line: 31, baseType: !523) +!522 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h", directory: "") +!523 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_pthread_rwlockattr_t", file: !93, line: 117, baseType: !524) +!524 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_opaque_pthread_rwlockattr_t", file: !93, line: 98, size: 192, elements: !525) +!525 = !{!526, !527} +!526 = !DIDerivedType(tag: DW_TAG_member, name: "__sig", scope: !524, file: !93, line: 99, baseType: !97, size: 64) +!527 = !DIDerivedType(tag: DW_TAG_member, name: "__opaque", scope: !524, file: !93, line: 100, baseType: !528, size: 128, offset: 64) +!528 = !DICompositeType(tag: DW_TAG_array_type, baseType: !5, size: 128, elements: !529) +!529 = !{!530} +!530 = !DISubrange(count: 16) +!531 = !DILocation(line: 267, column: 26, scope: !498) +!532 = !DILocation(line: 268, column: 14, scope: !498) +!533 = !DILocation(line: 268, column: 12, scope: !498) +!534 = !DILocation(line: 269, column: 5, scope: !498) +!535 = !DILocation(line: 271, column: 57, scope: !498) +!536 = !DILocation(line: 271, column: 14, scope: !498) +!537 = !DILocation(line: 271, column: 12, scope: !498) +!538 = !DILocation(line: 272, column: 5, scope: !498) +!539 = !DILocation(line: 273, column: 14, scope: !498) +!540 = !DILocation(line: 273, column: 12, scope: !498) +!541 = !DILocation(line: 274, column: 5, scope: !498) +!542 = !DILocation(line: 276, column: 34, scope: !498) +!543 = !DILocation(line: 276, column: 14, scope: !498) +!544 = !DILocation(line: 276, column: 12, scope: !498) +!545 = !DILocation(line: 277, column: 5, scope: !498) +!546 = !DILocation(line: 278, column: 14, scope: !498) +!547 = !DILocation(line: 278, column: 12, scope: !498) +!548 = !DILocation(line: 279, column: 5, scope: !498) +!549 = !DILocation(line: 280, column: 1, scope: !498) +!550 = distinct !DISubprogram(name: "rwlock_destroy", scope: !2, file: !2, line: 282, type: !551, scopeLine: 283, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!551 = !DISubroutineType(types: !552) +!552 = !{null, !501} +!553 = !DILocalVariable(name: "lock", arg: 1, scope: !550, file: !2, line: 282, type: !501) +!554 = !DILocation(line: 282, column: 39, scope: !550) +!555 = !DILocalVariable(name: "status", scope: !550, file: !2, line: 284, type: !143) +!556 = !DILocation(line: 284, column: 9, scope: !550) +!557 = !DILocation(line: 284, column: 41, scope: !550) +!558 = !DILocation(line: 284, column: 18, scope: !550) +!559 = !DILocation(line: 285, column: 5, scope: !550) +!560 = !DILocation(line: 286, column: 1, scope: !550) +!561 = distinct !DISubprogram(name: "rwlock_wrlock", scope: !2, file: !2, line: 288, type: !551, scopeLine: 289, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!562 = !DILocalVariable(name: "lock", arg: 1, scope: !561, file: !2, line: 288, type: !501) +!563 = !DILocation(line: 288, column: 38, scope: !561) +!564 = !DILocalVariable(name: "status", scope: !561, file: !2, line: 290, type: !143) +!565 = !DILocation(line: 290, column: 9, scope: !561) +!566 = !DILocation(line: 290, column: 40, scope: !561) +!567 = !DILocation(line: 290, column: 18, scope: !561) +!568 = !DILocation(line: 291, column: 5, scope: !561) +!569 = !DILocation(line: 292, column: 1, scope: !561) +!570 = distinct !DISubprogram(name: "rwlock_trywrlock", scope: !2, file: !2, line: 294, type: !571, scopeLine: 295, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!571 = !DISubroutineType(types: !572) +!572 = !{!286, !501} +!573 = !DILocalVariable(name: "lock", arg: 1, scope: !570, file: !2, line: 294, type: !501) +!574 = !DILocation(line: 294, column: 41, scope: !570) +!575 = !DILocalVariable(name: "status", scope: !570, file: !2, line: 296, type: !143) +!576 = !DILocation(line: 296, column: 9, scope: !570) +!577 = !DILocation(line: 296, column: 43, scope: !570) +!578 = !DILocation(line: 296, column: 18, scope: !570) +!579 = !DILocation(line: 298, column: 12, scope: !570) +!580 = !DILocation(line: 298, column: 19, scope: !570) +!581 = !DILocation(line: 298, column: 5, scope: !570) +!582 = distinct !DISubprogram(name: "rwlock_rdlock", scope: !2, file: !2, line: 301, type: !551, scopeLine: 302, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!583 = !DILocalVariable(name: "lock", arg: 1, scope: !582, file: !2, line: 301, type: !501) +!584 = !DILocation(line: 301, column: 38, scope: !582) +!585 = !DILocalVariable(name: "status", scope: !582, file: !2, line: 303, type: !143) +!586 = !DILocation(line: 303, column: 9, scope: !582) +!587 = !DILocation(line: 303, column: 40, scope: !582) +!588 = !DILocation(line: 303, column: 18, scope: !582) +!589 = !DILocation(line: 304, column: 5, scope: !582) +!590 = !DILocation(line: 305, column: 1, scope: !582) +!591 = distinct !DISubprogram(name: "rwlock_tryrdlock", scope: !2, file: !2, line: 307, type: !571, scopeLine: 308, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!592 = !DILocalVariable(name: "lock", arg: 1, scope: !591, file: !2, line: 307, type: !501) +!593 = !DILocation(line: 307, column: 41, scope: !591) +!594 = !DILocalVariable(name: "status", scope: !591, file: !2, line: 309, type: !143) +!595 = !DILocation(line: 309, column: 9, scope: !591) +!596 = !DILocation(line: 309, column: 43, scope: !591) +!597 = !DILocation(line: 309, column: 18, scope: !591) +!598 = !DILocation(line: 311, column: 12, scope: !591) +!599 = !DILocation(line: 311, column: 19, scope: !591) +!600 = !DILocation(line: 311, column: 5, scope: !591) +!601 = distinct !DISubprogram(name: "rwlock_unlock", scope: !2, file: !2, line: 314, type: !551, scopeLine: 315, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!602 = !DILocalVariable(name: "lock", arg: 1, scope: !601, file: !2, line: 314, type: !501) +!603 = !DILocation(line: 314, column: 38, scope: !601) +!604 = !DILocalVariable(name: "status", scope: !601, file: !2, line: 316, type: !143) +!605 = !DILocation(line: 316, column: 9, scope: !601) +!606 = !DILocation(line: 316, column: 40, scope: !601) +!607 = !DILocation(line: 316, column: 18, scope: !601) +!608 = !DILocation(line: 317, column: 5, scope: !601) +!609 = !DILocation(line: 318, column: 1, scope: !601) +!610 = distinct !DISubprogram(name: "rwlock_test", scope: !2, file: !2, line: 320, type: !306, scopeLine: 321, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!611 = !DILocalVariable(name: "lock", scope: !610, file: !2, line: 322, type: !502) +!612 = !DILocation(line: 322, column: 22, scope: !610) +!613 = !DILocation(line: 323, column: 5, scope: !610) +!614 = !DILocalVariable(name: "test_depth", scope: !610, file: !2, line: 324, type: !615) +!615 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !143) +!616 = !DILocation(line: 324, column: 15, scope: !610) +!617 = !DILocation(line: 327, column: 9, scope: !618) +!618 = distinct !DILexicalBlock(scope: !610, file: !2, line: 326, column: 5) +!619 = !DILocalVariable(name: "success", scope: !618, file: !2, line: 328, type: !286) +!620 = !DILocation(line: 328, column: 14, scope: !618) +!621 = !DILocation(line: 328, column: 24, scope: !618) +!622 = !DILocation(line: 329, column: 9, scope: !618) +!623 = !DILocation(line: 330, column: 19, scope: !618) +!624 = !DILocation(line: 330, column: 17, scope: !618) +!625 = !DILocation(line: 331, column: 9, scope: !618) +!626 = !DILocation(line: 332, column: 9, scope: !618) +!627 = !DILocation(line: 336, column: 9, scope: !628) +!628 = distinct !DILexicalBlock(scope: !610, file: !2, line: 335, column: 5) +!629 = !DILocalVariable(name: "i", scope: !630, file: !2, line: 337, type: !143) +!630 = distinct !DILexicalBlock(scope: !628, file: !2, line: 337, column: 9) +!631 = !DILocation(line: 337, column: 18, scope: !630) +!632 = !DILocation(line: 337, column: 14, scope: !630) +!633 = !DILocation(line: 337, column: 25, scope: !634) +!634 = distinct !DILexicalBlock(scope: !630, file: !2, line: 337, column: 9) +!635 = !DILocation(line: 337, column: 27, scope: !634) +!636 = !DILocation(line: 337, column: 9, scope: !630) +!637 = !DILocalVariable(name: "success", scope: !638, file: !2, line: 339, type: !286) +!638 = distinct !DILexicalBlock(scope: !634, file: !2, line: 338, column: 9) +!639 = !DILocation(line: 339, column: 18, scope: !638) +!640 = !DILocation(line: 339, column: 28, scope: !638) +!641 = !DILocation(line: 340, column: 13, scope: !638) +!642 = !DILocation(line: 341, column: 9, scope: !638) +!643 = !DILocation(line: 337, column: 42, scope: !634) +!644 = !DILocation(line: 337, column: 9, scope: !634) +!645 = distinct !{!645, !636, !646, !647} +!646 = !DILocation(line: 341, column: 9, scope: !630) +!647 = !{!"llvm.loop.mustprogress"} +!648 = !DILocalVariable(name: "success", scope: !649, file: !2, line: 344, type: !286) +!649 = distinct !DILexicalBlock(scope: !628, file: !2, line: 343, column: 9) +!650 = !DILocation(line: 344, column: 18, scope: !649) +!651 = !DILocation(line: 344, column: 28, scope: !649) +!652 = !DILocation(line: 345, column: 13, scope: !649) +!653 = !DILocation(line: 348, column: 9, scope: !628) +!654 = !DILocalVariable(name: "i", scope: !655, file: !2, line: 349, type: !143) +!655 = distinct !DILexicalBlock(scope: !628, file: !2, line: 349, column: 9) +!656 = !DILocation(line: 349, column: 18, scope: !655) +!657 = !DILocation(line: 349, column: 14, scope: !655) +!658 = !DILocation(line: 349, column: 25, scope: !659) +!659 = distinct !DILexicalBlock(scope: !655, file: !2, line: 349, column: 9) +!660 = !DILocation(line: 349, column: 27, scope: !659) +!661 = !DILocation(line: 349, column: 9, scope: !655) +!662 = !DILocation(line: 350, column: 13, scope: !663) +!663 = distinct !DILexicalBlock(scope: !659, file: !2, line: 349, column: 46) +!664 = !DILocation(line: 351, column: 9, scope: !663) +!665 = !DILocation(line: 349, column: 42, scope: !659) +!666 = !DILocation(line: 349, column: 9, scope: !659) +!667 = distinct !{!667, !661, !668, !647} +!668 = !DILocation(line: 351, column: 9, scope: !655) +!669 = !DILocation(line: 355, column: 9, scope: !670) +!670 = distinct !DILexicalBlock(scope: !610, file: !2, line: 354, column: 5) +!671 = !DILocalVariable(name: "success", scope: !670, file: !2, line: 356, type: !286) +!672 = !DILocation(line: 356, column: 14, scope: !670) +!673 = !DILocation(line: 356, column: 24, scope: !670) +!674 = !DILocation(line: 357, column: 9, scope: !670) +!675 = !DILocation(line: 358, column: 9, scope: !670) +!676 = !DILocation(line: 361, column: 5, scope: !610) +!677 = !DILocation(line: 362, column: 1, scope: !610) +!678 = distinct !DISubprogram(name: "key_destroy", scope: !2, file: !2, line: 369, type: !129, scopeLine: 370, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!679 = !DILocalVariable(name: "unused_value", arg: 1, scope: !678, file: !2, line: 369, type: !64) +!680 = !DILocation(line: 369, column: 24, scope: !678) +!681 = !DILocation(line: 371, column: 21, scope: !678) +!682 = !DILocation(line: 371, column: 19, scope: !678) +!683 = !DILocation(line: 372, column: 1, scope: !678) +!684 = distinct !DISubprogram(name: "key_worker", scope: !2, file: !2, line: 374, type: !155, scopeLine: 375, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!685 = !DILocalVariable(name: "message", arg: 1, scope: !684, file: !2, line: 374, type: !64) +!686 = !DILocation(line: 374, column: 24, scope: !684) +!687 = !DILocalVariable(name: "my_secret", scope: !684, file: !2, line: 376, type: !143) +!688 = !DILocation(line: 376, column: 9, scope: !684) +!689 = !DILocalVariable(name: "status", scope: !684, file: !2, line: 378, type: !143) +!690 = !DILocation(line: 378, column: 9, scope: !684) +!691 = !DILocation(line: 378, column: 38, scope: !684) +!692 = !DILocation(line: 378, column: 18, scope: !684) +!693 = !DILocation(line: 379, column: 5, scope: !684) +!694 = !DILocalVariable(name: "my_local_data", scope: !684, file: !2, line: 381, type: !64) +!695 = !DILocation(line: 381, column: 11, scope: !684) +!696 = !DILocation(line: 381, column: 47, scope: !684) +!697 = !DILocation(line: 381, column: 27, scope: !684) +!698 = !DILocation(line: 382, column: 5, scope: !684) +!699 = !DILocation(line: 384, column: 12, scope: !684) +!700 = !DILocation(line: 384, column: 5, scope: !684) +!701 = distinct !DISubprogram(name: "key_test", scope: !2, file: !2, line: 387, type: !306, scopeLine: 388, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!702 = !DILocalVariable(name: "my_secret", scope: !701, file: !2, line: 389, type: !143) +!703 = !DILocation(line: 389, column: 9, scope: !701) +!704 = !DILocalVariable(name: "message", scope: !701, file: !2, line: 390, type: !64) +!705 = !DILocation(line: 390, column: 11, scope: !701) +!706 = !DILocalVariable(name: "status", scope: !701, file: !2, line: 391, type: !143) +!707 = !DILocation(line: 391, column: 9, scope: !701) +!708 = !DILocation(line: 393, column: 5, scope: !701) +!709 = !DILocalVariable(name: "worker", scope: !701, file: !2, line: 395, type: !116) +!710 = !DILocation(line: 395, column: 15, scope: !701) +!711 = !DILocation(line: 395, column: 50, scope: !701) +!712 = !DILocation(line: 395, column: 24, scope: !701) +!713 = !DILocation(line: 397, column: 34, scope: !701) +!714 = !DILocation(line: 397, column: 14, scope: !701) +!715 = !DILocation(line: 397, column: 12, scope: !701) +!716 = !DILocation(line: 398, column: 5, scope: !701) +!717 = !DILocalVariable(name: "my_local_data", scope: !701, file: !2, line: 400, type: !64) +!718 = !DILocation(line: 400, column: 11, scope: !701) +!719 = !DILocation(line: 400, column: 47, scope: !701) +!720 = !DILocation(line: 400, column: 27, scope: !701) +!721 = !DILocation(line: 401, column: 5, scope: !701) +!722 = !DILocation(line: 403, column: 34, scope: !701) +!723 = !DILocation(line: 403, column: 14, scope: !701) +!724 = !DILocation(line: 403, column: 12, scope: !701) +!725 = !DILocation(line: 404, column: 5, scope: !701) +!726 = !DILocalVariable(name: "result", scope: !701, file: !2, line: 406, type: !64) +!727 = !DILocation(line: 406, column: 11, scope: !701) +!728 = !DILocation(line: 406, column: 32, scope: !701) +!729 = !DILocation(line: 406, column: 20, scope: !701) +!730 = !DILocation(line: 409, column: 33, scope: !701) +!731 = !DILocation(line: 409, column: 14, scope: !701) +!732 = !DILocation(line: 409, column: 12, scope: !701) +!733 = !DILocation(line: 410, column: 5, scope: !701) +!734 = !DILocation(line: 413, column: 1, scope: !701) +!735 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 415, type: !736, scopeLine: 416, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !157) +!736 = !DISubroutineType(types: !737) +!737 = !{!143} +!738 = !DILocation(line: 417, column: 5, scope: !735) +!739 = !DILocation(line: 418, column: 5, scope: !735) +!740 = !DILocation(line: 419, column: 5, scope: !735) +!741 = !DILocation(line: 420, column: 5, scope: !735) +!742 = !DILocation(line: 421, column: 1, scope: !735) From 52fcc9208408c93019fbfd44fd8d00d51bb5745f Mon Sep 17 00:00:00 2001 From: Hernan Ponce de Leon Date: Sat, 23 Dec 2023 11:10:06 +0100 Subject: [PATCH 21/21] Use BV encoding for miscellaneous/pthread test Signed-off-by: Hernan Ponce de Leon --- .../test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java b/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java index 8e9f204cce..42067f5990 100644 --- a/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java +++ b/dartagnan/src/test/java/com/dat3m/dartagnan/c/MiscellaneousTest.java @@ -49,7 +49,9 @@ protected long getTimeout() { protected Provider getConfigurationProvider() { return Provider.fromSupplier(() -> { ConfigurationBuilder builder = Configuration.builder(); - builder.setOption(OptionNames.USE_INTEGERS, "true"); + if (!name.equals("pthread")) { + builder.setOption(OptionNames.USE_INTEGERS, "true"); + } if (name.equals("recursion")) { builder.setOption(OptionNames.RECURSION_BOUND, String.valueOf(bound)); }