xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error(char *);
size_t fread(void *, int, size_t, int /*<<< orphan*/ *);
void Fread(void *ptr, size_t size, FILE *stream) {
  size_t r = fread(ptr, 1, size, stream);
  if (r != size)
    error("Can't read a file\n");
}


x86 assembly (clang, -O0):
<Fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1168 <Fread+0x48>
lea    0xe9d(%rip),%rdi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fread>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    113b <Fread+0x1b>
pop    %rbx
ret
lea    0xebe(%rip),%rdi
pop    %rbx
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Can't read a file\0A\00"
define void @Fread(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i32*, i32** %6
%11 = call i64 @fread(i8* %8, i32 1, i64 %9, i32* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %5
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Can't read a file\0A\00"
define void @Fread(i8* nocapture %0, i64 %1, i32* nocapture %2) {
%4 = tail call i64 @fread(i8* %0, i32 1, i64 %1, i32* %2)
%5 = icmp eq i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
void firstexit(void) {
  printf("%s, %d, %s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/"
         "base-usage/cplusplus/client-server/test_atexit.c",
         13, __func__);
}


x86 assembly (clang, -O0):
<firstexit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0xd,%edx
lea    0xf93(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstexit>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf9c(%rip),%rcx
mov    $0xd,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %d, %s\0A\00"
@.str.1 = [181 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/cplusplus/client-server/test_atexit.c\00"
@__func__.firstexit = [10 x i8] c"firstexit\00"
define void @firstexit() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.firstexit, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %d, %s\0A\00"
@.str.1 = [181 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/cplusplus/client-server/test_atexit.c\00"
@__func__.firstexit = [10 x i8] c"firstexit\00"
define void @firstexit() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.firstexit, i64 0, i64 0))
ret void
}
/* Type definitions */
struct nlmsghdr {
  int nlmsg_len;
};

/* Variables and functions */
int NLMSG_SPACE(int /*<<< orphan*/);
int nlmsg_datalen(struct nlmsghdr *p) { return p->nlmsg_len - NLMSG_SPACE(0); }


x86 assembly (clang, -O0):
<nlmsg_datalen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1030 <NLMSG_SPACE@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_datalen>:
push   %rbx
mov    (%rdi),%ebx
xor    %edi,%edi
call   1030 <NLMSG_SPACE@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define i32 @nlmsg_datalen(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%3 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%4 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @NLMSG_SPACE(i32 0)
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define i32 @nlmsg_datalen(%struct.nlmsghdr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @NLMSG_SPACE(i32 0)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
void attente(int n) {
  if (n)
    attente(n - 1);
}


x86 assembly (clang, -O0):
<attente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <attente+0x20>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <attente@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attente>:
ret

LLVM IR (-O0):
define void @attente(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @attente(i32 %0) {
ret void
}
int core_spinlock_lock_private(int *lock) {
  int reads;
  while (__sync_bool_compare_and_swap(lock, 0, 1) != 0) {
    if (8 > 0) {
      reads = 8;
      while (*lock != 0 && reads > 0) {
        --reads;
      }
    } else {
      while (*lock != 0) {
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<core_spinlock_lock_private>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    $0x1,%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1170 <core_spinlock_lock_private+0x70>
movl   $0x8,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0xd(%rbp)
je     114d <core_spinlock_lock_private+0x4d>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115d <core_spinlock_lock_private+0x5d>
jmp    116b <core_spinlock_lock_private+0x6b>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <core_spinlock_lock_private+0x31>
jmp    1108 <core_spinlock_lock_private+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_spinlock_lock_private>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
lock cmpxchg %ecx,(%rdi)
je     1110 <core_spinlock_lock_private+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @core_spinlock_lock_private(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %23, %1
%5 = load i32*, i32** %2
%6 = cmpxchg i32* %5, i32 0, i32 1 seq_cst seq_cst
%7 = extractvalue { i32, i1 } %6, 1
%8 = zext i1 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %4
store i32 8, i32* %3
br label %11
11: ; preds = %20, %10
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 0
br label %18
18: ; preds = %15, %11
%19 = phi i1 [ false, %11 ], [ %17, %15 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %11
23: ; preds = %18
br label %4
24: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @core_spinlock_lock_private(i32* nocapture %0) {
%2 = cmpxchg i32* %0, i32 0, i32 1 seq_cst seq_cst
%3 = extractvalue { i32, i1 } %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1, %4
%5 = cmpxchg i32* %0, i32 0, i32 1 seq_cst seq_cst
%6 = extractvalue { i32, i1 } %5, 1
br i1 %6, label %4, label %7
7: ; preds = %4, %1
ret i32 0
}
void test6_T_targetInit__I() {}


x86 assembly (clang, -O0):
<test6_T_targetInit__I>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6_T_targetInit__I>:
ret

LLVM IR (-O0):
define void @test6_T_targetInit__I() {
ret void
}

LLVM IR (-O2):
define void @test6_T_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ rpush(int /*<<< orphan*/);
void primitive_to_r_impl(void) { rpush(dpop()); }


x86 assembly (clang, -O0):
<primitive_to_r_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <rpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_to_r_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <rpush@plt>

LLVM IR (-O0):
define void @primitive_to_r_impl() {
%1 = call i32 (...) @dpop()
%2 = call i32 @rpush(i32 %1)
ret void
}

LLVM IR (-O2):
define void @primitive_to_r_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @rpush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int);
void timer(int val) {
  glutPostRedisplay();
  glutTimerFunc(30, timer, 1);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    $0x1e,%edi
mov    0x2ea2(%rip),%rsi
mov    $0x1,%edx
call   1030 <glutTimerFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
xor    %eax,%eax
call   1040 <glutPostRedisplay@plt>
mov    0x2eb1(%rip),%rsi
mov    $0x1e,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <glutTimerFunc@plt>

LLVM IR (-O0):
define void @timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @glutPostRedisplay()
%4 = call i32 @glutTimerFunc(i32 30, void (i32)* @timer, i32 1)
ret void
}

LLVM IR (-O2):
define void @timer(i32 %0) {
%2 = tail call i32 (...) @glutPostRedisplay()
%3 = tail call i32 @glutTimerFunc(i32 30, void (i32)* @timer, i32 1)
ret void
}
/* Variables and functions */
int log(int);
double ssim_db(double ssim, double weight) {
  return 10 * (log(weight) / log(10) - log(weight - ssim) / log(10));
}


x86 assembly (clang, -O0):
<ssim_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%edi
call   1030 <log@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xa,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mov    %eax,-0x18(%rbp)
mov    $0xa,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssim_db>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mov    %eax,%ebp
mov    $0xa,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
sub    %eax,%ebx
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @ssim_db(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = call i32 @log(i32 %6)
%8 = call i32 @log(i32 10)
%9 = sdiv i32 %7, %8
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = fptosi double %12 to i32
%14 = call i32 @log(i32 %13)
%15 = call i32 @log(i32 10)
%16 = sdiv i32 %14, %15
%17 = sub nsw i32 %9, %16
%18 = mul nsw i32 10, %17
%19 = sitofp i32 %18 to double
ret double %19
}

LLVM IR (-O2):
define double @ssim_db(double %0, double %1) {
%3 = fptosi double %1 to i32
%4 = tail call i32 @log(i32 %3)
%5 = tail call i32 @log(i32 10)
%6 = sdiv i32 %4, %5
%7 = fsub double %1, %0
%8 = fptosi double %7 to i32
%9 = tail call i32 @log(i32 %8)
%10 = tail call i32 @log(i32 10)
%11 = sdiv i32 %9, %10
%12 = sub nsw i32 %6, %11
%13 = mul nsw i32 %12, 10
%14 = sitofp i32 %13 to double
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int *, int);
int main(int argc, char **argv) {
  int array[] = {1, 2, 5, 6, 18, 19, 30};
  binary_search(array, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <binary_search@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <binary_search@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 1, i32 2, i32 5, i32 6, i32 18, i32 19, i32 30]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [7 x i32]* %6 to i8*
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%9 = call i32 @binary_search(i32* %8, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 1, i32 2, i32 5, i32 6, i32 18, i32 19, i32 30]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @binary_search(i32* %5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ndb_milli_sleep(unsigned int);
unsigned int rand();
void ndb_retry_sleep(unsigned milli_sleep) {
  ndb_milli_sleep(milli_sleep + 5 * (rand() % (milli_sleep / 5)));
}


x86 assembly (clang, -O0):
<ndb_retry_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0xc(%rbp),%edi
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %edx,%edx
div    %ecx
imul   $0x5,%edx,%eax
add    %eax,%edi
call   1030 <ndb_milli_sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_retry_sleep>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %ebx,%ecx
mov    $0xcccccccd,%esi
imul   %rcx,%rsi
shr    $0x22,%rsi
xor    %edx,%edx
div    %esi
lea    (%rdx,%rdx,4),%edi
add    %ebx,%edi
pop    %rbx
jmp    1030 <ndb_milli_sleep@plt>

LLVM IR (-O0):
define void @ndb_retry_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = udiv i32 %5, 5
%7 = urem i32 %4, %6
%8 = mul i32 5, %7
%9 = add i32 %3, %8
%10 = call i32 @ndb_milli_sleep(i32 %9)
ret void
}

LLVM IR (-O2):
define void @ndb_retry_sleep(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = udiv i32 %0, 5
%4 = urem i32 %2, %3
%5 = mul nuw i32 %4, 5
%6 = add i32 %5, %0
%7 = tail call i32 @ndb_milli_sleep(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M113_f(char *s) {
  debug("M113_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M113_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M113_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M113_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M113_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M113_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M113_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int main(void) {
  volatile unsigned x = 0, y = 1;
  while (x++ || y++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1146 <main+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1156 <main+0x56>
jmp    115b <main+0x5b>
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
movl   $0x1,-0x8(%rsp)
mov    -0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,-0x4(%rsp)
test   %eax,%eax
jne    1110 <main+0x10>
mov    -0x8(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,-0x8(%rsp)
test   %eax,%eax
jne    1110 <main+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
store volatile i32 1, i32* %3
br label %4
4: ; preds = %14, %0
%5 = load volatile i32, i32* %2
%6 = add i32 %5, 1
store volatile i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = load volatile i32, i32* %3
%10 = add i32 %9, 1
store volatile i32 %10, i32* %3
%11 = icmp ne i32 %9, 0
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ true, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* %1
%7 = add i32 %6, 1
store volatile i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %10, label %9
9: ; preds = %5, %10
br label %5
10: ; preds = %5
%11 = load volatile i32, i32* %2
%12 = add i32 %11, 1
store volatile i32 %12, i32* %2
%13 = icmp eq i32 %11, 0
br i1 %13, label %14, label %9
14: ; preds = %10
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DD_encoder2Get_int32();
int /*<<< orphan*/ message(char *, char *, int /*<<< orphan*/);
int appTask(void) {
  message("msg", "oencoder value is %ld", DD_encoder2Get_int32());
}


x86 assembly (clang, -O0):
<appTask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <DD_encoder2Get_int32@plt>
mov    %eax,%edx
lea    0xec8(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1030 <message@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appTask>:
push   %rax
xor    %eax,%eax
call   1040 <DD_encoder2Get_int32@plt>
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rsi
mov    %eax,%edx
pop    %rax
jmp    1030 <message@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"msg\00"
@.str.1 = [22 x i8] c"oencoder value is %ld\00"
define i32 @appTask() {
%1 = alloca i32
%2 = call i32 (...) @DD_encoder2Get_int32()
%3 = call i32 @message(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"msg\00"
@.str.1 = [22 x i8] c"oencoder value is %ld\00"
define i32 @appTask() {
%1 = tail call i32 (...) @DD_encoder2Get_int32()
%2 = tail call i32 @message(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x3a() {
  Assert_real((isdigit(58) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              295, ("isdigit should be 0 for :"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x3a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x127,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x3a>:
push   %rax
mov    $0x3a,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x127,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for :\00"
define void @t_isdigit_0x3a() {
%1 = call i64 @isdigit(i32 58)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for :\00"
define void @t_isdigit_0x3a() {
%1 = tail call i64 @isdigit(i32 58)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void INT_Excep_ICU_GROUPAL0(void) {}


x86 assembly (clang, -O0):
<INT_Excep_ICU_GROUPAL0>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_Excep_ICU_GROUPAL0>:
ret

LLVM IR (-O0):
define void @INT_Excep_ICU_GROUPAL0() {
ret void
}

LLVM IR (-O2):
define void @INT_Excep_ICU_GROUPAL0() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *_time(void) {
  time_t now = time(NULL);
  char *str = ctime(&now);
  str[strlen(str) - 1] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_time>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_time() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void swap_uint16(uint16_t *value1, uint16_t *value2) {
  uint16_t tmp = *value1;
  *value1 = *value2;
  *value2 = tmp;
}


x86 assembly (clang, -O0):
<swap_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint16>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_uint16(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_uint16(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dccp_kmalloc_pad();
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ timer_kmalloc_pad();
int /*<<< orphan*/ udp_kmalloc_pad();
void kmalloc_pad() {
  debug("dccp kmalloc pad");
  dccp_kmalloc_pad();
  debug("timer kmalloc pad");
  timer_kmalloc_pad();
  debug("udp kmalloc pad");
  udp_kmalloc_pad();
}


x86 assembly (clang, -O0):
<kmalloc_pad>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <debug@plt>
mov    $0x0,%al
call   1050 <dccp_kmalloc_pad@plt>
lea    0xeb3(%rip),%rdi
call   1030 <debug@plt>
mov    $0x0,%al
call   1060 <timer_kmalloc_pad@plt>
lea    0xeb2(%rip),%rdi
call   1030 <debug@plt>
mov    $0x0,%al
call   1040 <udp_kmalloc_pad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmalloc_pad>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <debug@plt>
xor    %eax,%eax
call   1050 <dccp_kmalloc_pad@plt>
lea    0xeb6(%rip),%rdi
call   1030 <debug@plt>
xor    %eax,%eax
call   1060 <timer_kmalloc_pad@plt>
lea    0xeb5(%rip),%rdi
call   1030 <debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <udp_kmalloc_pad@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"dccp kmalloc pad\00"
@.str.1 = [18 x i8] c"timer kmalloc pad\00"
@.str.2 = [16 x i8] c"udp kmalloc pad\00"
define void @kmalloc_pad() {
%1 = call i32 @debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @dccp_kmalloc_pad()
%3 = call i32 @debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @timer_kmalloc_pad()
%5 = call i32 @debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @udp_kmalloc_pad()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"dccp kmalloc pad\00"
@.str.1 = [18 x i8] c"timer kmalloc pad\00"
@.str.2 = [16 x i8] c"udp kmalloc pad\00"
define void @kmalloc_pad() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @dccp_kmalloc_pad()
%3 = tail call i32 @debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @timer_kmalloc_pad()
%5 = tail call i32 @debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @udp_kmalloc_pad()
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ read(int, char *, int);
int disconnect_client(int sockfd) {
  char c;
  while (read(sockfd, &c, 1) > 0)
    ;
  if (close(sockfd) != 0) {
    perror("ERROR on connection closing");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<disconnect_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jle    115b <disconnect_client+0x2b>
jmp    113b <disconnect_client+0xb>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1185 <disconnect_client+0x55>
lea    0xe8c(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <disconnect_client+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect_client>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jg     1140 <disconnect_client+0x10>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    116d <disconnect_client+0x3d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe8c(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
jmp    1165 <disconnect_client+0x35>

LLVM IR (-O0):
@.str = [28 x i8] c"ERROR on connection closing\00"
define i32 @disconnect_client(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %3
%7 = call i64 @read(i32 %6, i8* %4, i32 1)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i32, i32* %3
%12 = call i64 @close(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %17
16: ; preds = %10
store i32 0, i32* %2
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [28 x i8] c"ERROR on connection closing\00"
define i32 @disconnect_client(i32 %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i64 @read(i32 %0, i8* %2, i32 1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call i64 @close(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ -1, %9 ], [ 0, %6 ]
ret i32 %12
}
/* Type definitions */
struct chmcTreeNode {
  int dummy;
};
struct chmcFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct chmcFile *);
struct chmcTreeNode *chmc_add_entry(struct chmcFile *, char const *,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
struct chmcTreeNode *chmc_add_empty(struct chmcFile *chm, const char *file) {
  assert(chm);
  return chmc_add_entry(chm, file, 0, 0, NULL, 0, 0);
}


x86 assembly (clang, -O0):
<chmc_add_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%edx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
call   1040 <chmc_add_entry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmc_add_empty>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <chmc_add_entry@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.chmcTreeNode = type { i32 }
%struct.chmcFile = type { i32 }
define %struct.chmcTreeNode* @chmc_add_empty(%struct.chmcFile* %0, i8* %1) {
%3 = alloca %struct.chmcFile*
%4 = alloca i8*
store %struct.chmcFile* %0, %struct.chmcFile** %3
store i8* %1, i8** %4
%5 = load %struct.chmcFile*, %struct.chmcFile** %3
%6 = call i32 @assert(%struct.chmcFile* %5)
%7 = load %struct.chmcFile*, %struct.chmcFile** %3
%8 = load i8*, i8** %4
%9 = call %struct.chmcTreeNode* @chmc_add_entry(%struct.chmcFile* %7, i8* %8, i32 0, i32 0, i32* null, i32 0, i32 0)
ret %struct.chmcTreeNode* %9
}

LLVM IR (-O2):
%struct.chmcTreeNode = type { i32 }
%struct.chmcFile = type { i32 }
define %struct.chmcTreeNode* @chmc_add_empty(%struct.chmcFile* %0, i8* %1) {
%3 = tail call i32 @assert(%struct.chmcFile* %0)
%4 = tail call %struct.chmcTreeNode* @chmc_add_entry(%struct.chmcFile* %0, i8* %1, i32 0, i32 0, i32* null, i32 0, i32 0)
ret %struct.chmcTreeNode* %4
}
/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/);
void puts(const char *s) {
  while (*s) {
    putc(*s++);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc@plt>
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @putc(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int is_aligned(void *p, size_t alignment, size_t offset) {
  return !((((size_t)p) + offset) & (alignment - 1));
}


x86 assembly (clang, -O0):
<is_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_aligned>:
add    %rdx,%rdi
add    $0xffffffffffffffff,%rsi
xor    %eax,%eax
test   %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_aligned(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i64, i64* %6
%10 = add i64 %8, %9
%11 = load i64, i64* %5
%12 = sub i64 %11, 1
%13 = and i64 %10, %12
%14 = icmp ne i64 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_aligned(i8* %0, i64 %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = add i64 %4, %2
%6 = add i64 %1, -1
%7 = and i64 %5, %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ qstrstr(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  char *a = "asbdoiwfpfqwof_11_nqoekgnwih-13r013jidnancjasnc";
  qstrstr(a, strlen(a), "_11_");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
lea    0xed8(%rip),%rdx
call   1040 <qstrstr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xef9(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <qstrstr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"asbdoiwfpfqwof_11_nqoekgnwih-13r013jidnancjasnc\00"
@.str.1 = [5 x i8] c"_11_\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @qstrstr(i8* %3, i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"asbdoiwfpfqwof_11_nqoekgnwih-13r013jidnancjasnc\00"
@.str.1 = [5 x i8] c"_11_\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @qstrstr(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x / 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1146 <main+0x36>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 2
store i32 %9, i32* %2
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ out52(char);
int /*<<< orphan*/ qbyte(char);
void out52nn(char c, char n, char m) {
  out52(c);
  qbyte(n);
  qbyte(m);
}


x86 assembly (clang, -O0):
<out52nn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <out52@plt>
movsbl -0x2(%rbp),%edi
call   1030 <qbyte@plt>
movsbl -0x3(%rbp),%edi
call   1030 <qbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out52nn>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1040 <out52@plt>
mov    %ebp,%edi
call   1030 <qbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <qbyte@plt>

LLVM IR (-O0):
define void @out52nn(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = call i32 @out52(i8 signext %7)
%9 = load i8, i8* %5
%10 = call i32 @qbyte(i8 signext %9)
%11 = load i8, i8* %6
%12 = call i32 @qbyte(i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @out52nn(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @out52(i8 signext %0)
%5 = tail call i32 @qbyte(i8 signext %1)
%6 = tail call i32 @qbyte(i8 signext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_new_from_pid(void **ret, pid_t pid, uint64_t mask) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_new_from_pid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ec9(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_new_from_pid>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_new_from_pid(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_new_from_pid(i8** nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putstr(char *, int);
void term_cursor_on(void) { putstr("\x1b[?25h", 6); }


x86 assembly (clang, -O0):
<term_cursor_on>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6,%esi
call   1030 <putstr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_cursor_on>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <putstr@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
define void @term_cursor_on() {
%1 = call i32 @putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @term_cursor_on() {
%1 = tail call i32 @putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
void glGetTexParameteriv(void) { return; }


x86 assembly (clang, -O0):
<glGetTexParameteriv>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glGetTexParameteriv>:
ret

LLVM IR (-O0):
define void @glGetTexParameteriv() {
ret void
}

LLVM IR (-O2):
define void @glGetTexParameteriv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_msg(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gen_err_msg(char *, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ put_err_str(int /*<<< orphan*/);
int ssl_err_exit(char *string) {
  if (!0)
    put_err_str(
        gen_err_msg("[1;31mERROR:[0m ", build_msg("%s", string),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/janLo/"
                    "htw-computer-networks-mailserver/refs/heads/master/ssl.c",
                    78));
  exit(0);
}


x86 assembly (clang, -O0):
<ssl_err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1050 <build_msg@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
lea    0xeaa(%rip),%rdx
mov    $0x4e,%ecx
call   1040 <gen_err_msg@plt>
mov    %eax,%edi
call   1030 <put_err_str@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<ssl_err_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xec8(%rip),%rdi
call   1050 <build_msg@plt>
lea    0xea9(%rip),%rdi
lea    0xeb8(%rip),%rdx
mov    %eax,%esi
mov    $0x4e,%ecx
call   1040 <gen_err_msg@plt>
mov    %eax,%edi
call   1030 <put_err_str@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[1;31mERROR:\1B[0m \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janLo/htw-computer-networks-mailserver/refs/heads/master/ssl.c\00"
define i32 @ssl_err_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @build_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @gen_err_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.2, i64 0, i64 0), i32 78)
%6 = call i32 @put_err_str(i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[1;31mERROR:\1B[0m \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janLo/htw-computer-networks-mailserver/refs/heads/master/ssl.c\00"
define i32 @ssl_err_exit(i8* %0) {
%2 = tail call i32 @build_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @gen_err_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.2, i64 0, i64 0), i32 78)
%4 = tail call i32 @put_err_str(i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
int /*<<< orphan*/ fb_hExitConsole();
int /*<<< orphan*/ fb_hInitConsole();
void fb_DylibFree(void *library) {
  fb_hExitConsole();
  dlclose(library);
  fb_hInitConsole();
}


x86 assembly (clang, -O0):
<fb_DylibFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fb_hExitConsole@plt>
mov    -0x8(%rbp),%rdi
call   1050 <dlclose@plt>
mov    $0x0,%al
call   1030 <fb_hInitConsole@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_DylibFree>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fb_hExitConsole@plt>
mov    %rbx,%rdi
call   1050 <dlclose@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <fb_hInitConsole@plt>

LLVM IR (-O0):
define void @fb_DylibFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @fb_hExitConsole()
%4 = load i8*, i8** %2
%5 = call i32 @dlclose(i8* %4)
%6 = call i32 (...) @fb_hInitConsole()
ret void
}

LLVM IR (-O2):
define void @fb_DylibFree(i8* %0) {
%2 = tail call i32 (...) @fb_hExitConsole()
%3 = tail call i32 @dlclose(i8* %0)
%4 = tail call i32 (...) @fb_hInitConsole()
ret void
}
void enable_interrupts() { asm volatile("cli"); }


x86 assembly (clang, -O0):
<enable_interrupts>:
push   %rbp
mov    %rsp,%rbp
cli
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_interrupts>:
cli
ret

LLVM IR (-O0):
define void @enable_interrupts() {
ret void
}

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}