xunge/DecIR huggingface dataset:
unsigned add32_with_carry(unsigned a, unsigned b) {
  asm("addl %2,%0\n\t"
      "adcl $0,%0"
      : "=r"(a)
      : "0"(a), "r"(b));
  return a;
}


x86 assembly (clang, -O0):
<add32_with_carry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
adc    $0x0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add32_with_carry>:
mov    %edi,%eax
add    %esi,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @add32_with_carry(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 asm "addl $2,$0\0A\09adcl $$0,$0", "=r,0,r,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @add32_with_carry(i32 %0, i32 %1) {
%3 = tail call i32 asm "addl $2,$0\0A\09adcl $$0,$0", "=r,0,r,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
float pow(float, double);
float Rec1886_EOTF(float value) {
  return (value > 0.0) ? pow(value, 2.4) : 0.0;
}


x86 assembly (clang, -O0):
<Rec1886_EOTF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <Rec1886_EOTF+0x43>
movss  -0x4(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
call   1030 <pow@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1160 <Rec1886_EOTF+0x50>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1160 <Rec1886_EOTF+0x50>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rec1886_EOTF>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1125 <Rec1886_EOTF+0x15>
movsd  0xee0(%rip),%xmm1
jmp    1030 <pow@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Rec1886_EOTF(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = call float @pow(float %7, double 2.400000e+00)
%9 = fpext float %8 to double
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi double [ %9, %6 ], [ 0.000000e+00, %10 ]
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @Rec1886_EOTF(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call float @pow(float %0, double 2.400000e+00)
br label %5
5: ; preds = %1, %3
%6 = phi float [ %4, %3 ], [ 0.000000e+00, %1 ]
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ changerStatus(int);
int /*<<< orphan*/ printf(char *);
void quitterPartie(int joueur) {
  changerStatus(joueur);
  printf("Vous avez quittez la partie\n");
}


x86 assembly (clang, -O0):
<quitterPartie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <changerStatus@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitterPartie>:
push   %rax
call   1040 <changerStatus@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Vous avez quittez la partie\0A\00"
define void @quitterPartie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @changerStatus(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Vous avez quittez la partie\00"
define void @quitterPartie(i32 %0) {
%2 = tail call i32 @changerStatus(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
int multiply_by_two(int a) { return a * 2; }


x86 assembly (clang, -O0):
<multiply_by_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_by_two>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @multiply_by_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
ret i32 %4
}

LLVM IR (-O2):
define i32 @multiply_by_two(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t adjust_seed_16(uint32_t seed) { return seed ^ (seed << 16); }


x86 assembly (clang, -O0):
<adjust_seed_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_seed_16>:
mov    %edi,%eax
shl    $0x10,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @adjust_seed_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 16
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @adjust_seed_16(i32 %0) {
%2 = shl i32 %0, 16
%3 = xor i32 %2, %0
ret i32 %3
}
void RTDbgAsLastAddr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsLastAddr() {
ret void
}
void dv3_add(double *a, double *b) {
  a[0] += b[0];
  a[1] += b[1];
  a[2] += b[2];
}


x86 assembly (clang, -O0):
<dv3_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv3_add>:
movsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @dv3_add(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fadd double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fadd double %17, %14
store double %18, double* %16
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fadd double %24, %21
store double %25, double* %23
ret void
}

LLVM IR (-O2):
define void @dv3_add(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fadd double %3, %4
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fadd double %7, %9
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fadd double %12, %14
store double %15, double* %13
ret void
}
/* Variables and functions */
int close(int);
int daemon_release_lock(int lock_fd) { return (close(lock_fd)); }


x86 assembly (clang, -O0):
<daemon_release_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemon_release_lock>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @daemon_release_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @daemon_release_lock(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void foo2(void) {
  int i;
#pragma acc kernels copy(i)
  { i = 1; }
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo2() {
%1 = alloca i32
store i32 1, i32* %1
ret void
}

LLVM IR (-O2):
define void @foo2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void DieWithError(char *errorMessage) {
  perror(errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<DieWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<DieWithError>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @DieWithError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @DieWithError(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void quit(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @quit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
const char *sb1_datatype_name(int cmd) {
  switch (cmd) {
  case 0:
    return "uint32";
  case 1:
    return "uint16";
  case 2:
    return "uint8";
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<sb1_datatype_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <sb1_datatype_name+0x3c>
jmp    111a <sb1_datatype_name+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <sb1_datatype_name+0x4c>
jmp    112b <sb1_datatype_name+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <sb1_datatype_name+0x5c>
jmp    116c <sb1_datatype_name+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <sb1_datatype_name+0x77>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <sb1_datatype_name+0x77>
lea    0xeab(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <sb1_datatype_name+0x77>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb1_datatype_name>:
cmp    $0x2,%edi
ja     1117 <sb1_datatype_name+0x17>
movslq %edi,%rax
lea    0xf0d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"uint32\00"
@.str.1 = [7 x i8] c"uint16\00"
@.str.2 = [6 x i8] c"uint8\00"
@.str.3 = [8 x i8] c"unknown\00"
define i8* @sb1_datatype_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"uint32\00"
@.str.1 = [7 x i8] c"uint16\00"
@.str.2 = [6 x i8] c"uint8\00"
@.str.3 = [8 x i8] c"unknown\00"
@reltable.sb1_datatype_name = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.sb1_datatype_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.sb1_datatype_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.sb1_datatype_name to i64)) to i32)]
define i8* @sb1_datatype_name(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.sb1_datatype_name to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
dummy() {}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dummy() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @dummy() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int __strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc) {
  return strncasecmp(l, r, n);
}


x86 assembly (clang, -O0):
<__strncasecmp_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strncasecmp_l>:
jmp    1030 <strncasecmp@plt>

LLVM IR (-O0):
define i32 @__strncasecmp_l(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @strncasecmp(i8* %9, i8* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @__strncasecmp_l(i8* nocapture %0, i8* nocapture %1, i64 %2, i32 %3) {
%5 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %5
}
int testLib4(void) { return 0; }


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

x86 assembly (clang, -O2):
<testLib4>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @testLib4() {
ret i32 0
}

LLVM IR (-O2):
define i32 @testLib4() {
ret i32 0
}
__attribute__((no, noclone)) unsigned __int128 t157_5add(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_add_overflow(x, (signed __int128)(-2), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t157_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0xfffffffffffffffe,%rdx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t157_5add+0x77>
jmp    118e <t157_5add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t157_5add>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
mov    %rdi,%r14
add    $0xfffffffffffffffe,%r14
mov    %rsi,%rbx
adc    $0xffffffffffffffff,%rbx
mov    $0x1,%ecx
cmp    %rdi,%rcx
sbb    %rsi,%rax
jl     1138 <t157_5add+0x28>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t157_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %12, i129 -2)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t157_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nsw i129 %7, -2
%9 = icmp slt i128 %6, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xfa() {
  Assert_real((isodigit(250) == 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_isodigit.c",
              1255, ("isodigit should be 0 for 0xfa"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xfa>:
push   %rax
mov    $0xfa,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4e7,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xfa\00"
define void @t_isodigit_0xfa() {
%1 = call i64 @isodigit(i32 250)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1255, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xfa\00"
define void @t_isodigit_0xfa() {
%1 = tail call i64 @isodigit(i32 250)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1255, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
DISCRETE_RESET(dst_rcdiscN) {}


x86 assembly (clang, -O0):
<DISCRETE_RESET>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @DISCRETE_RESET(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @DISCRETE_RESET(i32 %0) {
ret i32 undef
}
/* Type definitions */
struct ip {
  int ip_sum;
};

/* Variables and functions */
int get_ip_checksum(struct ip *self) { return self->ip_sum; }


x86 assembly (clang, -O0):
<get_ip_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ip = type { i32 }
define i32 @get_ip_checksum(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = load %struct.ip*, %struct.ip** %2
%4 = getelementptr inbounds %struct.ip, %struct.ip* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @get_ip_checksum(%struct.ip* nocapture %0) {
%2 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
const char *PluginOpSupported() { return "^"; }


x86 assembly (clang, -O0):
<PluginOpSupported>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PluginOpSupported>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"^\00"
define i8* @PluginOpSupported() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"^\00"
define i8* @PluginOpSupported() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ i2c_lcd_write_command(int);
void i2c_lcd_clear(void) { i2c_lcd_write_command(0x01); }


x86 assembly (clang, -O0):
<i2c_lcd_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <i2c_lcd_write_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_lcd_clear>:
mov    $0x1,%edi
jmp    1030 <i2c_lcd_write_command@plt>

LLVM IR (-O0):
define void @i2c_lcd_clear() {
%1 = call i32 @i2c_lcd_write_command(i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c_lcd_clear() {
%1 = tail call i32 @i2c_lcd_write_command(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndirectIndexedE1(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op91E1(void) { STA8(DirectIndirectIndexedE1(2)); }


x86 assembly (clang, -O0):
<Op91E1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <DirectIndirectIndexedE1@plt>
mov    %eax,%edi
call   1030 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op91E1>:
push   %rax
mov    $0x2,%edi
call   1040 <DirectIndirectIndexedE1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STA8@plt>

LLVM IR (-O0):
define void @Op91E1() {
%1 = call i32 @DirectIndirectIndexedE1(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op91E1() {
%1 = tail call i32 @DirectIndirectIndexedE1(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
void __cdbgui_draw(void) {}


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

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

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

LLVM IR (-O2):
define void @__cdbgui_draw() {
ret void
}
int test_imm_C7uint16_reg(unsigned short val) {
  return ((val) & (0xC7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C7uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xc7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C7uint16_reg>:
test   $0xc7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C7uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 199
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C7uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 199
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ aes_decrypt_ecb();
scalar_t__ aes_encrypt_ecb();
int /*<<< orphan*/ printf(char *);
int main() {
  if (aes_encrypt_ecb())
    printf("aes_encrypt_ecb OK\n");
  if (aes_decrypt_ecb())
    printf("aes_decrypt_ecb OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <aes_encrypt_ecb@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <aes_decrypt_ecb@plt>
cmp    $0x0,%rax
je     1179 <main+0x49>
lea    0xea0(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <aes_encrypt_ecb@plt>
test   %rax,%rax
je     1149 <main+0x19>
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <aes_decrypt_ecb@plt>
test   %rax,%rax
je     1161 <main+0x31>
lea    0xea4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"aes_encrypt_ecb OK\0A\00"
@.str.1 = [20 x i8] c"aes_decrypt_ecb OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @aes_encrypt_ecb()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i64 (...) @aes_decrypt_ecb()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"aes_decrypt_ecb OK\00"
@str.2 = [19 x i8] c"aes_encrypt_ecb OK\00"
define i32 @main() {
%1 = tail call i64 (...) @aes_encrypt_ecb()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i64 (...) @aes_decrypt_ecb()
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __ompc_task_cutoff();
int __ompc_task_will_defer(int may_delay) {
  return may_delay && !__ompc_task_cutoff();
}


x86 assembly (clang, -O0):
<__ompc_task_will_defer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113c <__ompc_task_will_defer+0x2c>
mov    $0x0,%al
call   1030 <__ompc_task_cutoff@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ompc_task_will_defer>:
test   %edi,%edi
je     112a <__ompc_task_will_defer+0x1a>
push   %rax
xor    %eax,%eax
call   1030 <__ompc_task_cutoff@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__ompc_task_will_defer(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 %9
5: ; preds = %1
%6 = call i32 (...) @__ompc_task_cutoff()
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @__ompc_task_will_defer(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 (...) @__ompc_task_cutoff()
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int expect_gez(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ gettid_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testbreak();
int BasicGettid(void) {
  int passed;
  int block = 0;
  testbreak();
  passed = expect_gez(0, gettid_test());
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  testbreak();
  return block;
}


x86 assembly (clang, -O0):
<BasicGettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <testbreak@plt>
mov    $0x0,%al
call   1040 <gettid_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1070 <expect_gez@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     119f <BasicGettid+0x4f>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1060 <testbreak@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BasicGettid>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <testbreak@plt>
xor    %eax,%eax
call   1040 <gettid_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1070 <expect_gez@plt>
test   %eax,%eax
je     1186 <BasicGettid+0x36>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%ebx
xor    %eax,%eax
call   1060 <testbreak@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"\09Failed Phase 2: This call did something unexpected.\0A\00"
define i32 @BasicGettid() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (...) @testbreak()
%4 = call i32 (...) @gettid_test()
%5 = call i32 @expect_gez(i32 0, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @fflush(i32* null)
store i32 -1, i32* %2
br label %11
11: ; preds = %8, %0
%12 = call i32 (...) @testbreak()
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@str = [53 x i8] c"\09Failed Phase 2: This call did something unexpected.\00"
define i32 @BasicGettid() {
%1 = tail call i32 (...) @testbreak()
%2 = tail call i32 (...) @gettid_test()
%3 = tail call i32 @expect_gez(i32 0, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @fflush(i32* null)
br label %8
8: ; preds = %5, %0
%9 = phi i32 [ -1, %5 ], [ 0, %0 ]
%10 = tail call i32 (...) @testbreak()
ret i32 %9
}
/* Variables and functions */
scalar_t__ isspace(char);
char *ltrim(char *s) {
  char *p = s;
  while (p && (*p) && isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     115f <ltrim+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115f <ltrim+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <ltrim+0x5f>
jmp    1180 <ltrim+0x70>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ltrim+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %rbx
test   %rdi,%rdi
je     113b <ltrim+0x2b>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113d <ltrim+0x2d>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113d <ltrim+0x2d>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ltrim+0x10>
jmp    113d <ltrim+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ltrim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %20, %1
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = call i64 @isspace(i8 signext %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %13, %8, %5
%19 = phi i1 [ false, %8 ], [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %5
23: ; preds = %18
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @ltrim(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = tail call i64 @isspace(i8 signext %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %6 ], [ %12, %11 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  puts("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/cirosantilli/linux-kernel-module-cheat/refs/"
       "heads/master/userland/posix/sleep_forever.c");
  while (1)
    sleep(0xFFFFFFFF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <sleep@plt>
jmp    113b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
mov    $0xffffffff,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cirosantilli/linux-kernel-module-cheat/refs/heads/master/userland/posix/sleep_forever.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = call i32 @sleep(i32 -1)
br label %3
}

LLVM IR (-O2):
@.str = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cirosantilli/linux-kernel-module-cheat/refs/heads/master/userland/posix/sleep_forever.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 -1)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: pchk-to-alist [ -t ] [ -z ] pchk-file alist-file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: pchk-to-alist [ -t ] [ -z ] pchk-file alist-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: pchk-to-alist [ -t ] [ -z ] pchk-file alist-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
OP(dd, df) { op_df(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_df@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_df@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_df()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_df()
ret i32 undef
}
/* Variables and functions */
int sleep(int);
int main(void) { return sleep(600); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x258,%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x258,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 600)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 600)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ opjump(char *, int);
void jumpnc(int label) { opjump("nc,", label); }


x86 assembly (clang, -O0):
<jumpnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <opjump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumpnc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <opjump@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"nc,\00"
define void @jumpnc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @opjump(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"nc,\00"
define void @jumpnc(i32 %0) {
%2 = tail call i32 @opjump(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef float GLfloat;

/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void omul_matrix_identity(GLfloat m[]) {
  memset(m, 0, sizeof(GLfloat) * 16);
  m[0] = 1.0f;
  m[5] = 1.0f;
  m[10] = 1.0f;
  m[15] = 1.0f;
}


x86 assembly (clang, -O0):
<omul_matrix_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movss  0xec8(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xeb8(%rip),%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0xea7(%rip),%xmm0
movss  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movss  0xe96(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omul_matrix_identity>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x3f800000,(%rbx)
movl   $0x3f800000,0x14(%rbx)
movl   $0x3f800000,0x28(%rbx)
movl   $0x3f800000,0x3c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @omul_matrix_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 64)
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 0
store float 1.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 5
store float 1.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 10
store float 1.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 15
store float 1.000000e+00, float* %12
ret void
}

LLVM IR (-O2):
define void @omul_matrix_identity(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 64)
store float 1.000000e+00, float* %0
%3 = getelementptr inbounds float, float* %0, i64 5
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds float, float* %0, i64 10
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %5
ret void
}
int negate(int x) { return x * -1; }


x86 assembly (clang, -O0):
<negate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xffffffff,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negate>:
mov    %edi,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @negate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @negate(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int, char *, char *, int);
int /*<<< orphan*/ getc();
void _assert(int expression, char *file, int line) {
  if (expression) {
    fprintf(2, " *** Assert in %s, Line: %d ***\n", file, line);
    while (1) {
      getc();
    }
  }
}


x86 assembly (clang, -O0):
<_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1160 <_assert+0x40>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x2,%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <getc@plt>
jmp    1154 <_assert+0x34>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert>:
push   %rax
test   %edi,%edi
je     1149 <_assert+0x29>
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xecf(%rip),%rsi
mov    $0x2,%edi
call   1030 <fprintf@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getc@plt>
jmp    1140 <_assert+0x20>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c" *** Assert in %s, Line: %d ***\0A\00"
define void @_assert(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @fprintf(i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %13
13: ; preds = %9, %13
%14 = call i32 (...) @getc()
br label %13
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c" *** Assert in %s, Line: %d ***\0A\00"
define void @_assert(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 @fprintf(i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %7
7: ; preds = %5, %7
%8 = tail call i32 (...) @getc()
br label %7
9: ; preds = %3
ret void
}
void kasan_init_tags(void) {}


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

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

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

LLVM IR (-O2):
define void @kasan_init_tags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("hello world!\n"); }


x86 assembly (clang, -O0):
<say_hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_hello>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define void @say_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ div(int, int);
void uninitvar_div(void) {
  int num;
  int denom;
  (void)div(num, denom);
}


x86 assembly (clang, -O0):
<uninitvar_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <div@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_div>:
jmp    1030 <div@plt>

LLVM IR (-O0):
define void @uninitvar_div() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @div(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_div() {
%1 = tail call i32 @div(i32 undef, i32 undef)
ret void
}
/* Variables and functions */
double cos(double);
double ml_cos(double x) { return cos(x); }


x86 assembly (clang, -O0):
<ml_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_cos>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @ml_cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
ret double %4
}

LLVM IR (-O2):
define double @ml_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
int enter_ns(int pid, const char *type) { return 0; }


x86 assembly (clang, -O0):
<enter_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_ns>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @enter_ns(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @enter_ns(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
const char *utf8_previous_char(const char *utf8string) {
  while ((*--utf8string & 0xc0) == 0x80)
    ;
  return utf8string;
}


x86 assembly (clang, -O0):
<utf8_previous_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movsbl -0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1130 <utf8_previous_char+0x30>
jmp    1108 <utf8_previous_char+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_previous_char>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rax),%ecx
add    $0xffffffffffffffff,%rax
and    $0xc0,%cl
cmp    $0x80,%cl
je     1110 <utf8_previous_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @utf8_previous_char(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = and i8 %5, -64
%7 = icmp eq i8 %6, -128
br i1 %7, label %2, label %8
8: ; preds = %2
ret i8* %4
}