xunge/DecIR huggingface dataset:
/* Variables and functions */
int bsd_rand();
int /*<<< orphan*/ printf(char *, int, int, unsigned int);
int rand();
int bsd_rand_wrapper(void) {
  static unsigned cidx = 0;
  int ret = bsd_rand();
  int cmp = rand();
  if (ret != cmp) {
    printf("ERROR: rand() inconsistency %i (system) vs %i (custom) at call "
           "number %u\n",
           cmp, ret, cidx);
  }
  ++cidx;
  return ret;
}


x86 assembly (clang, -O0):
<bsd_rand_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <bsd_rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1170 <bsd_rand_wrapper+0x40>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    0x2ed8(%rip),%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ec6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ebd(%rip)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsd_rand_wrapper>:
push   %rbx
xor    %eax,%eax
call   1040 <bsd_rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <rand@plt>
cmp    %eax,%ebx
je     115b <bsd_rand_wrapper+0x2b>
mov    0x2ef1(%rip),%ecx
lea    0xeae(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
addl   $0x1,0x2eda(%rip)
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@bsd_rand_wrapper.cidx = internal global i32 0
@.str = [74 x i8] c"ERROR: rand() inconsistency %i (system) vs %i (custom) at call number %u\0A\00"
define i32 @bsd_rand_wrapper() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @bsd_rand()
store i32 %3, i32* %1
%4 = call i32 (...) @rand()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = load i32, i32* @bsd_rand_wrapper.cidx
%12 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
br label %13
13: ; preds = %8, %0
%14 = load i32, i32* @bsd_rand_wrapper.cidx
%15 = add i32 %14, 1
store i32 %15, i32* @bsd_rand_wrapper.cidx
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@bsd_rand_wrapper.cidx = internal unnamed_addr global i32 0
@.str = [74 x i8] c"ERROR: rand() inconsistency %i (system) vs %i (custom) at call number %u\0A\00"
define i32 @bsd_rand_wrapper() {
%1 = tail call i32 (...) @bsd_rand()
%2 = tail call i32 (...) @rand()
%3 = icmp eq i32 %1, %2
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load i32, i32* @bsd_rand_wrapper.cidx
%6 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1, i32 %5)
br label %7
7: ; preds = %4, %0
%8 = load i32, i32* @bsd_rand_wrapper.cidx
%9 = add i32 %8, 1
store i32 %9, i32* @bsd_rand_wrapper.cidx
ret i32 %1
}
/* Variables and functions */
int LZ5_compress_fast(char const *, char *, int, int, int);
int LZ5_compress_default(const char *source, char *dest, int inputSize,
                         int maxOutputSize) {
  return LZ5_compress_fast(source, dest, inputSize, maxOutputSize, 1);
}


x86 assembly (clang, -O0):
<LZ5_compress_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <LZ5_compress_fast@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ5_compress_default>:
mov    $0x1,%r8d
jmp    1030 <LZ5_compress_fast@plt>

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

LLVM IR (-O2):
define i32 @LZ5_compress_default(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @LZ5_compress_fast(i8* %0, i8* %1, i32 %2, i32 %3, i32 1)
ret i32 %5
}
double lgamma(double __d) {
  signed int __local_signgam = 0;
  double return_value_lgamma_r$1;
  return_value_lgamma_r$1 = lgamma_r(__d, &__local_signgam);
  return return_value_lgamma_r$1;
}


x86 assembly (clang, -O0):
<lgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
mov    $0x1,%al
call   1030 <lgamma_r@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgamma>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%al
call   1030 <lgamma_r@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lgamma(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
store i32 0, i32* %3
%5 = load double, double* %2
%6 = call i32 (double, i32*, ...) bitcast (i32 (...)* @lgamma_r to i32 (double, i32*, ...)*)(double %5, i32* %3)
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @lgamma(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 (double, i32*, ...) bitcast (i32 (...)* @lgamma_r to i32 (double, i32*, ...)*)(double %0, i32* %2)
%5 = sitofp i32 %4 to double
ret double %5
}
void rop3_111_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_111_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_111_0_0>:
xor    (%rdi),%sil
not    %dl
or     %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_111_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_111_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %2, -1
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
void wait() {
  printf("Press [ENTER] to continue\n");
  while (getchar() != '\n')
    ;
  getchar();
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1148 <wait+0x28>
jmp    1130 <wait+0x10>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1130 <wait+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Press [ENTER] to continue\0A\00"
define void @wait() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call signext i8 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Press [ENTER] to continue\00"
define void @wait() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call signext i8 (...) @getchar()
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ z_ms_sprint(struct timeval *, char *);
void z_now_ms_sprint(char *buf) {
  struct timeval t;
  gettimeofday(&t, NULL);
  z_ms_sprint(&t, buf);
}


x86 assembly (clang, -O0):
<z_now_ms_sprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1040 <z_ms_sprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_now_ms_sprint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <z_ms_sprint@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @z_now_ms_sprint(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.timeval
store i8* %0, i8** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = load i8*, i8** %2
%6 = call i32 @z_ms_sprint(%struct.timeval* %3, i8* %5)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @z_now_ms_sprint(i8* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = call i32 @z_ms_sprint(%struct.timeval* %2, i8* %0)
ret void
}
/* Variables and functions */
int *g(int *);
int *f(int *x) {
  switch (*x) {
  case 1:
    return g(x);
  case 2:
    return g(x);
  case 3:
    return g(x);
  default:
    return g(x);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1155 <f+0x45>
jmp    1133 <f+0x23>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1167 <f+0x57>
jmp    1144 <f+0x34>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     1179 <f+0x69>
jmp    118b <f+0x7b>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <f+0x88>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <f+0x88>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <f+0x88>
mov    -0x10(%rbp),%rdi
call   1030 <g@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32* @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
switch i32 %5, label %15 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
]
6: ; preds = %1
%7 = load i32*, i32** %3
%8 = call i32* @g(i32* %7)
store i32* %8, i32** %2
br label %18
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32* @g(i32* %10)
store i32* %11, i32** %2
br label %18
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = call i32* @g(i32* %13)
store i32* %14, i32** %2
br label %18
15: ; preds = %1
%16 = load i32*, i32** %3
%17 = call i32* @g(i32* %16)
store i32* %17, i32** %2
br label %18
18: ; preds = %15, %12, %9, %6
%19 = load i32*, i32** %2
ret i32* %19
}

LLVM IR (-O2):
define i32* @f(i32* %0) {
%2 = tail call i32* @g(i32* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int main(void) {
  int senha;
  while (scanf("%d\n", &senha), senha != 2002) {
    printf("Senha Invalida\n");
  }
  printf("Acesso Permitido\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x7d2,-0x8(%rbp)
je     115d <main+0x3d>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x7d2,0xc(%rsp)
je     117d <main+0x5d>
lea    0xeca(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x7d2,0xc(%rsp)
jne    1160 <main+0x40>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [16 x i8] c"Senha Invalida\0A\00"
@.str.2 = [18 x i8] c"Acesso Permitido\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 2002
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %3
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [17 x i8] c"Acesso Permitido\00"
@str.3 = [15 x i8] c"Senha Invalida\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2002
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 2002
br i1 %10, label %11, label %6
11: ; preds = %6, %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ds_record_destroy(void *);
void ds_record_destructor(void *record) { ds_record_destroy(record); }


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

x86 assembly (clang, -O2):
<ds_record_destructor>:
jmp    1030 <ds_record_destroy@plt>

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

LLVM IR (-O2):
define void @ds_record_destructor(i8* %0) {
%2 = tail call i32 @ds_record_destroy(i8* %0)
ret void
}
void stop() {
  int status;
  asm volatile("mov %%eax,%0" : "=r"(status));
  exit(status);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<stop>:
push   %rax
mov    %eax,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @stop() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov %eax,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
unreachable
}

LLVM IR (-O2):
define void @stop() {
%1 = tail call i32 asm sideeffect "mov %eax,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
tail call void @exit(i32 %1)
unreachable
}
/* Variables and functions */
int CN_NETLINK_USERS;
int /*<<< orphan*/ printf(char *, int, int);
void usage(void) {
  printf("Usage: ucon [options] [output file]\n"
         "\n"
         "\t-h\tthis help screen\n"
         "\t-s\tsend buffers to the test module\n"
         "\n"
         "The default behavior of ucon is to sudirribe to the test module\n"
         "and wait for state messages.  Any ones received are dumped to the\n"
         "specified output file (or stdout).  The test module is assumed to\n"
         "have an id of {%u.%u}\n"
         "\n"
         "If you get no output, then verify the cn_test module id matches\n"
         "the expected id above.\n",
         CN_NETLINK_USERS + 3, 0x456);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
add    $0x3,%esi
lea    0xed9(%rip),%rdi
mov    $0x456,%edx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
add    $0x3,%esi
lea    0xedd(%rip),%rdi
mov    $0x456,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [402 x i8] c"Usage: ucon [options] [output file]\0A\0A\09-h\09this help screen\0A\09-s\09send buffers to the test module\0A\0AThe default behavior of ucon is to sudirribe to the test module\0Aand wait for state messages. Any ones received are dumped to the\0Aspecified output file (or stdout). The test module is assumed to\0Ahave an id of {%u.%u}\0A\0AIf you get no output, then verify the cn_test module id matches\0Athe expected id above.\0A\00"
@CN_NETLINK_USERS = global i32 0
define void @usage() {
%1 = load i32, i32* @CN_NETLINK_USERS
%2 = add nsw i32 %1, 3
%3 = call i32 @printf(i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1110)
ret void
}

LLVM IR (-O2):
@.str = [402 x i8] c"Usage: ucon [options] [output file]\0A\0A\09-h\09this help screen\0A\09-s\09send buffers to the test module\0A\0AThe default behavior of ucon is to sudirribe to the test module\0Aand wait for state messages. Any ones received are dumped to the\0Aspecified output file (or stdout). The test module is assumed to\0Ahave an id of {%u.%u}\0A\0AIf you get no output, then verify the cn_test module id matches\0Athe expected id above.\0A\00"
@CN_NETLINK_USERS = global i32 0
define void @usage() {
%1 = load i32, i32* @CN_NETLINK_USERS
%2 = add nsw i32 %1, 3
%3 = tail call i32 @printf(i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1110)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void to_binary(int num) {
  if (2 <= num)
    to_binary(num / 2);
  fprintf(stderr, "%d", num % 2);
}


x86 assembly (clang, -O0):
<to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%eax
cmp    -0x4(%rbp),%eax
jg     114b <to_binary+0x2b>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <to_binary@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_binary>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1131 <to_binary+0x11>
mov    %ebx,%edi
shr    %edi
call   1030 <to_binary@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
lea    0xeb3(%rip),%rsi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @to_binary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 2, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @to_binary(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 1
tail call void @to_binary(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = load i32, i32* @stderr
%7 = srem i32 %0, 2
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
int _dictIntCopyHTKeyCompare(void *privdata, const void *key1,
                             const void *key2) {
  ((void)privdata);
  return (long)key1 == (long)key2;
}


x86 assembly (clang, -O0):
<_dictIntCopyHTKeyCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictIntCopyHTKeyCompare>:
xor    %eax,%eax
cmp    %rdx,%rsi
sete   %al
ret

LLVM IR (-O0):
define i32 @_dictIntCopyHTKeyCompare(i8* %0, i8* %1, i8* %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 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = icmp eq i64 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @_dictIntCopyHTKeyCompare(i8* nocapture readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp eq i8* %1, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
int getgde_(m)
int *m;
{ return ((int)getgdesc((long)*m)); }


x86 assembly (clang, -O0):
<getgde_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    $0x0,%al
call   1030 <getgdesc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgde_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <getgdesc@plt>

LLVM IR (-O0):
define i32 @getgde_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = call i32 (i64, ...) bitcast (i32 (...)* @getgdesc to i32 (i64, ...)*)(i64 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @getgde_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @getgdesc to i32 (i64, ...)*)(i64 %3)
ret i32 %4
}
void foo649() {}


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

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

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

LLVM IR (-O2):
define void @foo649() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_arithm_shift_right();
int /*<<< orphan*/ gen_immediate();
int /*<<< orphan*/ gen_push(int);
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_number(int);
gen_divide_by_two() {
  gen_push(1);
  gen_immediate();
  output_number(1);
  newline();
  gen_arithm_shift_right();
}


x86 assembly (clang, -O0):
<gen_divide_by_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <gen_push@plt>
mov    $0x0,%al
call   1070 <gen_immediate@plt>
mov    $0x1,%edi
call   1060 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    $0x0,%al
call   1040 <gen_arithm_shift_right@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_divide_by_two>:
push   %rax
mov    $0x1,%edi
call   1050 <gen_push@plt>
xor    %eax,%eax
call   1070 <gen_immediate@plt>
mov    $0x1,%edi
call   1060 <output_number@plt>
xor    %eax,%eax
call   1030 <newline@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <gen_arithm_shift_right@plt>

LLVM IR (-O0):
define i32 @gen_divide_by_two() {
%1 = alloca i32
%2 = call i32 @gen_push(i32 1)
%3 = call i32 (...) @gen_immediate()
%4 = call i32 @output_number(i32 1)
%5 = call i32 (...) @newline()
%6 = call i32 (...) @gen_arithm_shift_right()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @gen_divide_by_two() {
%1 = tail call i32 @gen_push(i32 1)
%2 = tail call i32 (...) @gen_immediate()
%3 = tail call i32 @output_number(i32 1)
%4 = tail call i32 (...) @newline()
%5 = tail call i32 (...) @gen_arithm_shift_right()
ret i32 undef
}
int test_imm_17int16_reg(short val) {
  return ((val) & (0x17 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_17int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 23
%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_17int16_reg(i16 signext %0) {
%2 = and i16 %0, 23
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void GotoScreenXY(int Xpos, int Ypos) {
  Xpos = (Xpos > 25) ? 25 : Xpos;
  Xpos = (Xpos < 1) ? 1 : Xpos;
  Ypos = (Ypos > 80) ? 80 : Ypos;
  Ypos = (Ypos < 1) ? 1 : Ypos;
}


x86 assembly (clang, -O0):
<GotoScreenXY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x19,-0x4(%rbp)
jle    1121 <GotoScreenXY+0x21>
mov    $0x19,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <GotoScreenXY+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1144 <GotoScreenXY+0x44>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <GotoScreenXY+0x4a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x50,-0x8(%rbp)
jle    1167 <GotoScreenXY+0x67>
mov    $0x50,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <GotoScreenXY+0x6d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    118a <GotoScreenXY+0x8a>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1190 <GotoScreenXY+0x90>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GotoScreenXY(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 = icmp sgt i32 %5, 25
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 25, %7 ], [ %9, %8 ]
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
br label %17
15: ; preds = %10
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 1, %14 ], [ %16, %15 ]
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 80
br i1 %20, label %21, label %22
21: ; preds = %17
br label %24
22: ; preds = %17
%23 = load i32, i32* %4
br label %24
24: ; preds = %22, %21
%25 = phi i32 [ 80, %21 ], [ %23, %22 ]
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %24
br label %31
29: ; preds = %24
%30 = load i32, i32* %4
br label %31
31: ; preds = %29, %28
%32 = phi i32 [ 1, %28 ], [ %30, %29 ]
store i32 %32, i32* %4
ret void
}

LLVM IR (-O2):
define void @GotoScreenXY(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int recursive_unlink_helper(int, char const *, char const *);
int recursive_unlink_children(const char *name) {
  return recursive_unlink_helper(-1, name, name);
}


x86 assembly (clang, -O0):
<recursive_unlink_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%edi
call   1030 <recursive_unlink_helper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_unlink_children>:
mov    %rdi,%rdx
mov    $0xffffffff,%edi
mov    %rdx,%rsi
jmp    1030 <recursive_unlink_helper@plt>

LLVM IR (-O0):
define i32 @recursive_unlink_children(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @recursive_unlink_helper(i32 -1, i8* %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @recursive_unlink_children(i8* %0) {
%2 = tail call i32 @recursive_unlink_helper(i32 -1, i8* %0, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ libfun(int);
int main(void) {
  libfun(42);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <libfun@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @libfun(i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_dealloc1(char *);
int gen_dealloc(char *dirname) {
  gen_dealloc1(dirname);
  return (0);
}


x86 assembly (clang, -O0):
<gen_dealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gen_dealloc1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gen_dealloc(i8* %0) {
%2 = tail call i32 @gen_dealloc1(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ callee1(int, char *, double);
int /*<<< orphan*/ printf(char *);
main() {
  callee1(2, "A string argument.", 3.5);
  callee1(2, "A string argument.", 3.5);
  printf("Hello, World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xecd(%rip),%rsi
movsd  0xebd(%rip),%xmm0
call   1030 <callee1@plt>
mov    $0x2,%edi
lea    0xeb4(%rip),%rsi
movsd  0xea4(%rip),%xmm0
call   1030 <callee1@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rbx
movsd  0xed0(%rip),%xmm0
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <callee1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
movsd  0xeb3(%rip),%xmm0
call   1030 <callee1@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"A string argument.\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"A string argument.\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%2 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int g1(int a, int b) {
  int c = (a + b) * b;
  printf("g1:   a = %d, b = %d, c = %d\n", a, b, c);
  return c;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%ebx
imul   %edx,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"g1: a = %d, b = %d, c = %d\0A\00"
define i32 @g1(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* %4
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [30 x i8] c"g1: a = %d, b = %d, c = %d\0A\00"
define i32 @g1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = mul nsw i32 %3, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sx_set_mode(int);
void sx_standby() { sx_set_mode(0x1); }


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

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

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

LLVM IR (-O2):
define void @sx_standby() {
%1 = tail call i32 @sx_set_mode(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xf1() {
  Assert_real((isspace(241) == 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_isspace.c",
              1210, ("isspace should be 0 for 0xf1"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xf1>:
push   %rax
mov    $0xf1,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ba,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xf1\00"
define void @t_isspace_0xf1() {
%1 = call i64 @isspace(i32 241)
%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 1210, i8* getelementptr inbounds ([29 x i8], [29 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xf1\00"
define void @t_isspace_0xf1() {
%1 = tail call i64 @isspace(i32 241)
%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 1210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initSet();
int /*<<< orphan*/ testSet();
int main(void) {
  initSet();
  testSet();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initSet@plt>
mov    $0x0,%al
call   1030 <testSet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initSet()
%2 = tail call i32 (...) @testSet()
ret i32 0
}
int pwd() {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(12)
          : "memory");
  return retval;
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%eax
int    $0x80
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
mov    $0xc,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @pwd() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char const *, char const);
int distinct_chars(const char *a) {
  int dist = 0;
  while (*a != '\0') {
    if (!strchr(a + 1, *a))
      dist++;
    a++;
  }
  return dist;
}


x86 assembly (clang, -O0):
<distinct_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116a <distinct_chars+0x5a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    1159 <distinct_chars+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <distinct_chars+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distinct_chars>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114e <distinct_chars+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <strchr@plt>
cmp    $0x1,%eax
adc    $0x0,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <distinct_chars+0x20>
jmp    1150 <distinct_chars+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @distinct_chars(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @strchr(i8* %8, i8 signext %5)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %6, %11
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
void outw(short port, short data) {
  __asm__("outw %%ax,%%dx" ::"a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    -0x2(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outw(i16 signext %0, i16 signext %1) {
tail call void asm sideeffect "outw %ax,%dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
void sw(char type) {
  if (type == 4 || type == 5)
    callrts("l_long_case");
  else
    callrts("l_case");
}


x86 assembly (clang, -O0):
<sw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x4,%eax
je     1138 <sw+0x28>
movsbl -0x1(%rbp),%eax
cmp    $0x5,%eax
jne    1149 <sw+0x39>
lea    0xec1(%rip),%rdi
call   1030 <callrts@plt>
jmp    1155 <sw+0x45>
lea    0xebc(%rip),%rdi
call   1030 <callrts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw>:
and    $0xfe,%dil
cmp    $0x4,%dil
lea    0xee1(%rip),%rax
lea    0xee6(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <callrts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"l_long_case\00"
@.str.1 = [7 x i8] c"l_case\00"
define void @sw(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = call i32 @callrts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %6
%13 = call i32 @callrts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"l_long_case\00"
@.str.1 = [7 x i8] c"l_case\00"
define void @sw(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 4
%4 = select i1 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @callrts(i8* %4)
ret void
}
/* Variables and functions */
int strcmp(void *, void *);
int hashmap_compare_cstring(void *in_context, void *in_left, void *in_right) {
  return strcmp(in_left, in_right);
}


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

x86 assembly (clang, -O2):
<hashmap_compare_cstring>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @hashmap_compare_cstring(i8* %0, i8* %1, i8* %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** %5
%8 = load i8*, i8** %6
%9 = call i32 @strcmp(i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @hashmap_compare_cstring(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int CVBBoolChars(char *Sorc) {
  if (!strcmp(Sorc, "True"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CVBBoolChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <CVBBoolChars+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <CVBBoolChars+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CVBBoolChars>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"True\00"
define i32 @CVBBoolChars(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SysPerfTimerConfig(int);
void PerfTimerStart(void) { SysPerfTimerConfig(1); }


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

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

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

LLVM IR (-O2):
define void @PerfTimerStart() {
%1 = tail call i32 @SysPerfTimerConfig(i32 1)
ret void
}
/* Type definitions */
struct node_avl {
  int dummy;
};

/* Variables and functions */
int estaVazia_ArvAVL(struct node_avl *raiz) {
  if (raiz == NULL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<estaVazia_ArvAVL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <estaVazia_ArvAVL+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <estaVazia_ArvAVL+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estaVazia_ArvAVL>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.node_avl = type { i32 }
define i32 @estaVazia_ArvAVL(%struct.node_avl* %0) {
%2 = alloca i32
%3 = alloca %struct.node_avl*
store %struct.node_avl* %0, %struct.node_avl** %3
%4 = load %struct.node_avl*, %struct.node_avl** %3
%5 = icmp eq %struct.node_avl* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.node_avl = type { i32 }
define i32 @estaVazia_ArvAVL(%struct.node_avl* readnone %0) {
%2 = icmp eq %struct.node_avl* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int __raw_readb(int);
int ts72xx_model(void) { return __raw_readb(0xfebff000) & 0x07; }


x86 assembly (clang, -O0):
<ts72xx_model>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfebff000,%edi
call   1030 <__raw_readb@plt>
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts72xx_model>:
push   %rax
mov    $0xfebff000,%edi
call   1030 <__raw_readb@plt>
and    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ts72xx_model() {
%1 = call i32 @__raw_readb(i32 -20975616)
%2 = and i32 %1, 7
ret i32 %2
}

LLVM IR (-O2):
define i32 @ts72xx_model() {
%1 = tail call i32 @__raw_readb(i32 -20975616)
%2 = and i32 %1, 7
ret i32 %2
}