#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_2(void *arg) {
  unsigned int *testInt = (unsigned int *)arg;
  if (2 != *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",
           45);
    printf("2"
           " (0x%x) != "
           "*testInt"
           " (0x%x)\n",
           (unsigned int)2, (unsigned int)*testInt);
    abort();
  } else {
    printf("2"
           " == "
           "*testInt"
           " validated OK\n");
  };
  return 0;
}


x86 assembly (clang, -O0):
<thread_func_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x2,%eax
cmp    (%rcx),%eax
je     118d <thread_func_2+0x6d>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x2d,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xf3f(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func_2>:
push   %rbx
cmpl   $0x2,(%rdi)
jne    1146 <thread_func_2+0x16>
lea    0xf81(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    %rdi,%rbx
lea    0xf89(%rip),%rdi
call   1040 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0xeb1(%rip),%rsi
mov    $0x2d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%edx
lea    0xf29(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0A---- TEST FAILED ----\0A\00"
@.str.1 = [20 x i8] c"File: %s, line: %d\0A\00"
@.str.2 = [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.3 = [29 x i8] c"2 (0x%x) != *testInt (0x%x)\0A\00"
@.str.4 = [28 x i8] c"2 == *testInt validated OK\0A\00"
define i8* @thread_func_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = icmp ne i32 2, %7
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.2, i64 0, i64 0), i32 45)
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %13)
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16
ret i8* null
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"File: %s, line: %d\0A\00"
@.str.2 = [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.3 = [29 x i8] c"2 (0x%x) != *testInt (0x%x)\0A\00"
@str = [27 x i8] c"2 == *testInt validated OK\00"
@str.5 = [23 x i8] c"\0A---- TEST FAILED ----\00"
define noalias i8* @thread_func_2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.2, i64 0, i64 0), i32 45)
%8 = load i32, i32* %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %8)
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i8* null
}