#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, ...);
void *thread_func_1(void *arg) {
  printf("This is executed in a thread\n");
  unsigned int *testInt = (unsigned int *)arg;
  if (1 != *testInt) {
    printf("\n---- TEST FAILED ----\n");
    printf("File: %s, line: %d\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/ZaoLahma/C_FTPServer/refs/heads/master/"
           "test/test.c",
           37);
    printf("1"
           " (0x%x) != "
           "*testInt"
           " (0x%x)\n",
           (unsigned int)1, (unsigned int)*testInt);
    abort();
  } else {
    printf("1"
           " == "
           "*testInt"
           " validated OK\n");
  };
  return 0;
}


x86 assembly (clang, -O0):
<thread_func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
je     119b <thread_func_1+0x7b>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x25,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xf4f(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xf52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func_1>:
push   %rbx
mov    %rdi,%rbx
lea    0xf83(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x1,(%rbx)
jne    1155 <thread_func_1+0x25>
lea    0xf8f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xf9a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe98(%rip),%rdi
lea    0xea5(%rip),%rsi
mov    $0x25,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%edx
lea    0xf1d(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"This is executed in a thread\0A\00"
@.str.1 = [24 x i8] c"\0A---- TEST FAILED ----\0A\00"
@.str.2 = [20 x i8] c"File: %s, line: %d\0A\00"
@.str.3 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ZaoLahma/C_FTPServer/refs/heads/master/test/test.c\00"
@.str.4 = [29 x i8] c"1 (0x%x) != *testInt (0x%x)\0A\00"
@.str.5 = [28 x i8] c"1 == *testInt validated OK\0A\00"
define i8* @thread_func_1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp ne i32 1, %8
br i1 %9, label %10, label %17
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.3, i64 0, i64 0), i32 37)
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %14)
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %19
19: ; preds = %17
ret i8* null
}

LLVM IR (-O2):
@.str.2 = [20 x i8] c"File: %s, line: %d\0A\00"
@.str.3 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ZaoLahma/C_FTPServer/refs/heads/master/test/test.c\00"
@.str.4 = [29 x i8] c"1 (0x%x) != *testInt (0x%x)\0A\00"
@str = [29 x i8] c"This is executed in a thread\00"
@str.6 = [27 x i8] c"1 == *testInt validated OK\00"
@str.7 = [23 x i8] c"\0A---- TEST FAILED ----\00"
define noalias i8* @thread_func_1(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.3, i64 0, i64 0), i32 37)
%9 = load i32, i32* %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %9)
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
ret i8* null
}