xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rstofill();
void untext(void) {
  rstofill();
  printf(".nf\n");
  printf(".ll \\n(%du\n", 34);
}


x86 assembly (clang, -O0):
<untext>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rstofill@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x22,%esi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<untext>:
push   %rax
xor    %eax,%eax
call   1030 <rstofill@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb5(%rip),%rdi
mov    $0x22,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".nf\0A\00"
@.str.1 = [12 x i8] c".ll \\n(%du\0A\00"
define void @untext() {
%1 = call i32 (...) @rstofill()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 34)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c".ll \\n(%du\0A\00"
@str = [4 x i8] c".nf\00"
define void @untext() {
%1 = tail call i32 (...) @rstofill()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 34)
ret void
}
int main() {
  char a;
  char b;
  a = 'a';
  b = 'b';
  if (a == 'a') {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jne    112c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1133 <main+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 98, i8* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 97
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ float_to_fixnum(int /*<<< orphan*/);
int /*<<< orphan*/ tag_fixnum(int /*<<< orphan*/);
void primitive_float_to_fixnum(void) {
  drepl(tag_fixnum(float_to_fixnum(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_float_to_fixnum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1060 <float_to_fixnum@plt>
mov    %eax,%edi
call   1040 <tag_fixnum@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_to_fixnum>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1060 <float_to_fixnum@plt>
mov    %eax,%edi
call   1040 <tag_fixnum@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_float_to_fixnum() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @float_to_fixnum(i32 %1)
%3 = call i32 @tag_fixnum(i32 %2)
%4 = call i32 @drepl(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_float_to_fixnum() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @float_to_fixnum(i32 %1)
%3 = tail call i32 @tag_fixnum(i32 %2)
%4 = tail call i32 @drepl(i32 %3)
ret void
}
__attribute__((always_)) unsigned long _wool_max(unsigned long a,
                                                 unsigned long b) {
  return b < a ? b : a;
}


x86 assembly (clang, -O0):
<_wool_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1127 <_wool_max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <_wool_max+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wool_max>:
mov    %rdi,%rax
cmp    %rdi,%rsi
cmovb  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @_wool_max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @_wool_max(i64 %0, i64 %1) {
%3 = icmp ult i64 %1, %0
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
void Bochs_puts(const char *Str) {
  while (*Str) {
    __asm__ __volatile__("outb %0, %1" : : "a"(*Str++), "Nd"(0xE9));
  }
}


x86 assembly (clang, -O0):
<Bochs_puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112d <Bochs_puts+0x2d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
out    %al,$0xe9
jmp    1108 <Bochs_puts+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bochs_puts>:
mov    (%rdi),%al
test   %al,%al
je     111d <Bochs_puts+0x1d>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
out    %al,$0xe9
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <Bochs_puts+0x10>
ret

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

LLVM IR (-O2):
define void @Bochs_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
tail call void asm sideeffect "outb $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %5, i32 233)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
int islower(char c) { return (c >= 'a') && (c <= 'z'); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <islower+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @islower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_BCint16_mem(short *val) {
  return ((*val) & (-0xBC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BCint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff44,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BCint16_mem>:
movzwl (%rdi),%eax
test   $0xff44,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BCint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -188
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
main() {
  double sum;
  char line[100];
  int getline(char line[], int max);
  sum = 0;
  while (getline(line, 100) > 0)
    printf("\t%g\n", sum += atof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
cmp    $0x0,%eax
jle    1185 <main+0x55>
lea    -0x80(%rbp),%rdi
call   1030 <atof@plt>
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
jmp    114a <main+0x1a>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1195 <main+0x65>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0xea0(%rip),%r14
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    %r14,%rdi
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [100 x i8]
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 100)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call double @atof(i8* %9)
%11 = load double, double* %2
%12 = fadd double %11, %10
store double %12, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %12)
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 100)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = phi double [ %8, %5 ], [ 0.000000e+00, %0 ]
%7 = call double @atof(i8* %2)
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call i32 @getline(i8* %2, i32 100)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *);
void f(int *a, int *b) {
  int M, N;
  scanf("%d %d", &M, &N);
  int *c = &M, *d = &N;
  if (M < N) {
    a = c;
    b = d;
  }
  if (M == 0) {
    f(b, a);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1170 <f+0x50>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1187 <f+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <f@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%r12
mov    %rsp,%r15
mov    %r12,%rsi
mov    %r15,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jne    1166 <f+0x46>
cmp    (%rsp),%eax
cmovl  %r12,%rbx
cmovl  %r15,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <f@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define void @f(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
store i32* %5, i32** %7
store i32* %6, i32** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32*, i32** %7
store i32* %14, i32** %3
%15 = load i32*, i32** %8
store i32* %15, i32** %4
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32*, i32** %4
%21 = load i32*, i32** %3
br label %22
22: ; preds = %19, %16
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @f(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = select i1 %10, i32* %3, i32* %0
%14 = select i1 %10, i32* %4, i32* %1
br label %15
15: ; preds = %12, %2
ret void
}
float foo(int a, double b, float c) { return c; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @foo(i32 %0, double %1, float %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca float
store i32 %0, i32* %4
store double %1, double* %5
store float %2, float* %6
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @foo(i32 %0, double %1, float returned %2) {
ret float %2
}
int is_undefined_div(int a, int b) { return b == 0; }


x86 assembly (clang, -O0):
<is_undefined_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_undefined_div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_undefined_div(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int get8();
int get16le(void) {
  int z = get8();
  return z + (get8() << 8);
}


x86 assembly (clang, -O0):
<get16le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16le>:
push   %rbx
xor    %eax,%eax
call   1030 <get8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get8@plt>
shl    $0x8,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get16le() {
%1 = alloca i32
%2 = call i32 (...) @get8()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (...) @get8()
%5 = shl i32 %4, 8
%6 = add nsw i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get16le() {
%1 = tail call i32 (...) @get8()
%2 = tail call i32 (...) @get8()
%3 = shl i32 %2, 8
%4 = add nsw i32 %3, %1
ret i32 %4
}
int test_api_irqctrl(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_api_irqctrl() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x1f() {
  Assert_real((iscntrl(31)),
              "/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_iscntrl.c",
              160, ("iscntrl should be 1 for 0x1f"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x1f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xa0,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x1f>:
push   %rax
mov    $0x1f,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xa0,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1f\00"
define void @t_iscntrl_0x1f() {
%1 = call i32 @iscntrl(i32 31)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1f\00"
define void @t_iscntrl_0x1f() {
%1 = tail call i32 @iscntrl(i32 31)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int vsprintf(char *, char const *, int /*<<< orphan*/);
int vfprintf(FILE *file_stream, const char *__restrict format,
             va_list arguments) {
  int lenght;
  char buffer[1024];
  lenght = vsprintf(buffer, format, arguments);
  fputs(buffer, file_stream);
  return lenght;
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vsprintf@plt>
mov    %eax,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x18(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <vsprintf@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    %ebp,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vfprintf(i32* %0, i8* noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca [1024 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @vsprintf(i8* %9, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%14 = load i32*, i32** %4
%15 = call i32 @fputs(i8* %13, i32* %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @vfprintf(i32* nocapture %0, i8* noalias nocapture %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @vsprintf(i8* %5, i8* %1, i32 %2)
%7 = call i32 @fputs(i8* %5, i32* %0)
ret i32 %6
}
void g30() {
#pragma pack(1)
  static struct {
    int : 1;
    int x;
  } a = {};
#pragma pack()
}


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

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

LLVM IR (-O0):
%struct.anon = type <{ i8, i32 }>
@g30.a = internal global %struct.anon <{ i8 undef, i32 0 }>
define void @g30() {
ret void
}

LLVM IR (-O2):
define void @g30() {
ret void
}
/* Variables and functions */
void *Mem_Alloc(int);
int /*<<< orphan*/ Mem_Dump();
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  void *ptr = Mem_Alloc(8);
  assert(ptr != NULL);
  Mem_Dump();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x8,%edi
call   1060 <Mem_Alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1040 <Mem_Dump@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
mov    $0x8,%edi
call   1060 <Mem_Alloc@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1040 <Mem_Dump@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @Mem_Init(i32 4096)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i8* @Mem_Alloc(i32 8)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 (...) @Mem_Dump()
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @Mem_Alloc(i32 8)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 (...) @Mem_Dump()
%10 = tail call i32 @exit(i32 0)
unreachable
}
void foo_2_2_1_1_2_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_1_2_2_2() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void add_xa_subheader(uint8_t *sector) {
  sector[16] = 0;
  sector[17] = 0;
  sector[18] = 8;
  sector[19] = 0;
  memcpy(sector + 20, sector + 16, 4);
}


x86 assembly (clang, -O0):
<add_xa_subheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x40(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x44(%rax)
mov    -0x8(%rbp),%rax
movl   $0x8,0x48(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4c(%rax)
mov    -0x8(%rbp),%rdi
add    $0x50,%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_xa_subheader>:
lea    0x40(%rdi),%rsi
movaps 0xee5(%rip),%xmm0
movups %xmm0,0x40(%rdi)
add    $0x50,%rdi
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @add_xa_subheader(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 16
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 17
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 18
store i32 8, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 19
store i32 0, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 20
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 16
%15 = call i32 @memcpy(i32* %12, i32* %14, i32 4)
ret void
}

LLVM IR (-O2):
define void @add_xa_subheader(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 16
%3 = bitcast i32* %2 to <4 x i32>*
store <4 x i32> <i32 0, i32 0, i32 8, i32 0>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %0, i64 20
%5 = tail call i32 @memcpy(i32* %4, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ddcl_FileInit();
int /*<<< orphan*/ ddcl_ServiceModuleInit(unsigned int);
int /*<<< orphan*/ ddcl_SocketModuleInit();
int /*<<< orphan*/ ddcl_TimerInit();
int ddcl_Init(unsigned work) {
  ddcl_FileInit();
  ddcl_TimerInit();
  ddcl_ServiceModuleInit(work);
  ddcl_SocketModuleInit();
  return 0;
}


x86 assembly (clang, -O0):
<ddcl_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ddcl_FileInit@plt>
mov    $0x0,%al
call   1040 <ddcl_TimerInit@plt>
mov    -0x4(%rbp),%edi
call   1060 <ddcl_ServiceModuleInit@plt>
mov    $0x0,%al
call   1050 <ddcl_SocketModuleInit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddcl_Init>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ddcl_FileInit@plt>
xor    %eax,%eax
call   1040 <ddcl_TimerInit@plt>
mov    %ebx,%edi
call   1060 <ddcl_ServiceModuleInit@plt>
xor    %eax,%eax
call   1050 <ddcl_SocketModuleInit@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ddcl_Init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ddcl_FileInit()
%4 = call i32 (...) @ddcl_TimerInit()
%5 = load i32, i32* %2
%6 = call i32 @ddcl_ServiceModuleInit(i32 %5)
%7 = call i32 (...) @ddcl_SocketModuleInit()
ret i32 0
}

LLVM IR (-O2):
define i32 @ddcl_Init(i32 %0) {
%2 = tail call i32 (...) @ddcl_FileInit()
%3 = tail call i32 (...) @ddcl_TimerInit()
%4 = tail call i32 @ddcl_ServiceModuleInit(i32 %0)
%5 = tail call i32 (...) @ddcl_SocketModuleInit()
ret i32 0
}
/* Variables and functions */
char *ultoa(long, char *, unsigned int);
char *ltoa(long num, char *res, int radix) {
  if (radix == 10 && num < 0) {
    *res++ = '-';
    num = -num;
  }
  return ultoa(num, res, (unsigned)radix);
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jne    1154 <ltoa+0x44>
cmpq   $0x0,-0x8(%rbp)
jge    1154 <ltoa+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
test   %rdi,%rdi
jns    1124 <ltoa+0x14>
cmp    $0xa,%edx
jne    1124 <ltoa+0x14>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %rdi
jmp    1030 <ultoa@plt>

LLVM IR (-O0):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i64, i64* %4
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
store i8 45, i8* %13
%15 = load i64, i64* %4
%16 = sub nsw i64 0, %15
store i64 %16, i64* %4
br label %17
17: ; preds = %12, %9, %3
%18 = load i64, i64* %4
%19 = load i8*, i8** %5
%20 = load i32, i32* %6
%21 = call i8* @ultoa(i64 %18, i8* %19, i32 %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 10
%5 = icmp slt i64 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%9 = sub nsw i64 0, %0
br label %10
10: ; preds = %7, %3
%11 = phi i8* [ %8, %7 ], [ %1, %3 ]
%12 = phi i64 [ %9, %7 ], [ %0, %3 ]
%13 = tail call i8* @ultoa(i64 %12, i8* %11, i32 %2)
ret i8* %13
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ this_comparison_is_not_decidable();
void bla2le(int var) {
  if (var + 10 <= INT_MIN + 10)
    this_comparison_is_not_decidable();
}


x86 assembly (clang, -O0):
<bla2le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jg     113c <bla2le+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_not_decidable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla2le>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jge    111c <bla2le+0xc>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_not_decidable@plt>

LLVM IR (-O0):
@INT_MIN = global i32 0
define void @bla2le(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = load i32, i32* @INT_MIN
%6 = add nsw i32 %5, 10
%7 = icmp sle i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_not_decidable()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define void @bla2le(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = icmp slt i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_not_decidable()
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct buddy_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buddy_list_init(struct buddy_list *);
int /*<<< orphan*/ buddy_list_replace(struct buddy_list *, struct buddy_list *);
void buddy_list_replace_init(struct buddy_list *old, struct buddy_list *new) {
  buddy_list_replace(old, new);
  buddy_list_init(old);
}


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

x86 assembly (clang, -O2):
<buddy_list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <buddy_list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <buddy_list_init@plt>

LLVM IR (-O0):
%struct.buddy_list = type { i32 }
define void @buddy_list_replace_init(%struct.buddy_list* %0, %struct.buddy_list* %1) {
%3 = alloca %struct.buddy_list*
%4 = alloca %struct.buddy_list*
store %struct.buddy_list* %0, %struct.buddy_list** %3
store %struct.buddy_list* %1, %struct.buddy_list** %4
%5 = load %struct.buddy_list*, %struct.buddy_list** %3
%6 = load %struct.buddy_list*, %struct.buddy_list** %4
%7 = call i32 @buddy_list_replace(%struct.buddy_list* %5, %struct.buddy_list* %6)
%8 = load %struct.buddy_list*, %struct.buddy_list** %3
%9 = call i32 @buddy_list_init(%struct.buddy_list* %8)
ret void
}

LLVM IR (-O2):
%struct.buddy_list = type { i32 }
define void @buddy_list_replace_init(%struct.buddy_list* %0, %struct.buddy_list* %1) {
%3 = tail call i32 @buddy_list_replace(%struct.buddy_list* %0, %struct.buddy_list* %1)
%4 = tail call i32 @buddy_list_init(%struct.buddy_list* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *proc) { printf("usage: %s [-s <signal>] <pid>\n", proc); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: %s [-s <signal>] <pid>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"usage: %s [-s <signal>] <pid>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_PCTX;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
scalar_t__ BIO_printf(int /*<<< orphan*/ *, char *, long);
int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent,
               const ASN1_PCTX *pctx) {
  if (BIO_printf(out, "%ld\n", *(long *)pval) <= 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<long_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xec3(%rip),%rsi
call   1030 <BIO_printf@plt>
cmp    $0x0,%rax
jg     1158 <long_print+0x48>
movl   $0x0,-0x4(%rbp)
jmp    115f <long_print+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_print>:
push   %rax
mov    (%rsi),%rdx
lea    0xee5(%rip),%rsi
call   1030 <BIO_printf@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @long_print(i32* %0, i32** %1, i32* %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32**
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
store i32* %0, i32** %7
store i32** %1, i32*** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
%12 = load i32*, i32** %7
%13 = load i32**, i32*** %8
%14 = bitcast i32** %13 to i64*
%15 = load i64, i64* %14
%16 = call i64 @BIO_printf(i32* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = icmp sle i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %5
store i32 0, i32* %6
br label %20
19: ; preds = %5
store i32 1, i32* %6
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @long_print(i32* %0, i32** nocapture %1, i32* nocapture readnone %2, i32 %3, i32* nocapture readnone %4) {
%6 = bitcast i32** %1 to i64*
%7 = load i64, i64* %6
%8 = tail call i64 @BIO_printf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
struct mmt_write {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_register_mmt_write(struct mmt_write *);
void demmt_memwrite(struct mmt_write *w, void *state) {
  buffer_register_mmt_write(w);
}


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

x86 assembly (clang, -O2):
<demmt_memwrite>:
jmp    1030 <buffer_register_mmt_write@plt>

LLVM IR (-O0):
%struct.mmt_write = type { i32 }
define void @demmt_memwrite(%struct.mmt_write* %0, i8* %1) {
%3 = alloca %struct.mmt_write*
%4 = alloca i8*
store %struct.mmt_write* %0, %struct.mmt_write** %3
store i8* %1, i8** %4
%5 = load %struct.mmt_write*, %struct.mmt_write** %3
%6 = call i32 @buffer_register_mmt_write(%struct.mmt_write* %5)
ret void
}

LLVM IR (-O2):
%struct.mmt_write = type { i32 }
define void @demmt_memwrite(%struct.mmt_write* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @buffer_register_mmt_write(%struct.mmt_write* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eval(char *);
int main() {
  eval("hello\nhello\nno\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <eval@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hello\0Ahello\0Ano\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @eval(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello\0Ahello\0Ano\0A\00"
define i32 @main() {
%1 = tail call i32 @eval(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double M_PI;
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
double sqrt(double);
int main(void) {
  double a;
  scanf("%lf", &a);
  double r = sqrt(a / M_PI);
  printf("Radius is %lf\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mov    0x2e8d(%rip),%rax
divsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mov    0x2e9c(%rip),%rax
divsd  (%rax),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1160 <main+0x30>
sqrtsd %xmm0,%xmm0
jmp    1165 <main+0x35>
call   1050 <sqrt@plt>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@M_PI = global double 0.000000e+00
@.str.1 = [15 x i8] c"Radius is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = load double, double* @M_PI
%7 = fdiv double %5, %6
%8 = call double @sqrt(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@M_PI = global double 0.000000e+00
@.str.1 = [15 x i8] c"Radius is %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
%7 = call double @sqrt(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void scl_low(void) { PUT32(0x20200028, 1 << 3); }


x86 assembly (clang, -O0):
<scl_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20200028,%edi
mov    $0x8,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scl_low>:
mov    $0x20200028,%edi
mov    $0x8,%esi
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @scl_low() {
%1 = call i32 @PUT32(i32 538968104, i32 8)
ret void
}

LLVM IR (-O2):
define void @scl_low() {
%1 = tail call i32 @PUT32(i32 538968104, i32 8)
ret void
}
void store() {
  asm volatile("popq %%rax\n\t"
               "movq %%rsp, (%%rax)\n\t"
               "subq $0x8, (%%rax)\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
mov    %rsp,(%rax)
subq   $0x8,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
pop    %rax
mov    %rsp,(%rax)
subq   $0x8,(%rax)
ret

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

LLVM IR (-O2):
define void @store() {
tail call void asm sideeffect "popq %rax\0A\09movq %rsp, (%rax)\0A\09subq $$0x8, (%rax)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void __l2_flush_wback_region(void *start, int size) {}


x86 assembly (clang, -O0):
<__l2_flush_wback_region>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__l2_flush_wback_region(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __gate_debug_str(char const *);
void gate_debug_str(const char *s) { __gate_debug_str(s); }


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

x86 assembly (clang, -O2):
<gate_debug_str>:
jmp    1030 <__gate_debug_str@plt>

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

LLVM IR (-O2):
define void @gate_debug_str(i8* %0) {
%2 = tail call i32 @__gate_debug_str(i8* %0)
ret void
}
int ReverseNumber(int number) {
  int reversedNumber = 0;
  while (number) {
    reversedNumber *= 10;
    reversedNumber += number % 10;
    number /= 10;
  }
  return reversedNumber;
}


x86 assembly (clang, -O0):
<ReverseNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <ReverseNumber+0x43>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <ReverseNumber+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseNumber>:
xor    %eax,%eax
test   %edi,%edi
je     113f <ReverseNumber+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ReverseNumber+0x10>
ret

LLVM IR (-O0):
define i32 @ReverseNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 10
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ReverseNumber(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
int bitcount1(int n) {
  int c;
  for (c = 0; n; c++)
    n = n & n - 1;
  return c;
}


x86 assembly (clang, -O0):
<bitcount1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <bitcount1+0x34>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount1+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount1>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount1+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount1+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ *ENGINE_get_first();
int /*<<< orphan*/ *ENGINE_get_next(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_register_pkey_meths(int /*<<< orphan*/ *);
void ENGINE_register_all_pkey_meths(void) {
  ENGINE *e;
  for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
    ENGINE_register_pkey_meths(e);
}


x86 assembly (clang, -O0):
<ENGINE_register_all_pkey_meths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ENGINE_get_first@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <ENGINE_register_all_pkey_meths+0x39>
mov    -0x8(%rbp),%rdi
call   1050 <ENGINE_register_pkey_meths@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ENGINE_get_next@plt>
mov    %rax,-0x8(%rbp)
jmp    1143 <ENGINE_register_all_pkey_meths+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_register_all_pkey_meths>:
push   %rbx
xor    %eax,%eax
call   1040 <ENGINE_get_first@plt>
test   %rax,%rax
je     1158 <ENGINE_register_all_pkey_meths+0x28>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1050 <ENGINE_register_pkey_meths@plt>
mov    %rbx,%rdi
call   1030 <ENGINE_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <ENGINE_register_all_pkey_meths+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ENGINE_register_all_pkey_meths() {
%1 = alloca i32*
%2 = call i32* (...) @ENGINE_get_first()
store i32* %2, i32** %1
br label %3
3: ; preds = %9, %0
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32*, i32** %1
%8 = call i32 @ENGINE_register_pkey_meths(i32* %7)
br label %9
9: ; preds = %6
%10 = load i32*, i32** %1
%11 = call i32* @ENGINE_get_next(i32* %10)
store i32* %11, i32** %1
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ENGINE_register_all_pkey_meths() {
%1 = tail call i32* (...) @ENGINE_get_first()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @ENGINE_register_pkey_meths(i32* %4)
%6 = tail call i32* @ENGINE_get_next(i32* %4)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}