xunge/DecIR huggingface dataset:
int len(char *s) {
  int i;
  for (i = 0; s[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <len+0x37>
jmp    1129 <len+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <len+0x10>
ret

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

LLVM IR (-O2):
define i32 @len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
unsigned int I2CSlaveIntRawStatusEx(unsigned int baseAdd,
                                    unsigned int intFlag) {
  return (((*((volatile unsigned int *)(baseAdd + (0x24))))) & (intFlag));
}


x86 assembly (clang, -O0):
<I2CSlaveIntRawStatusEx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntRawStatusEx>:
mov    %esi,%eax
add    $0x24,%edi
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CSlaveIntRawStatusEx(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 = add i32 %5, 36
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = load i32, i32* %4
%11 = and i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @I2CSlaveIntRawStatusEx(i32 %0, i32 %1) {
%3 = add i32 %0, 36
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
void main() {
  char *msg;
  while (1) {
    printf("%s\n", msg);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1128 <main+0x8>

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca i8*
br label %2
2: ; preds = %0, %2
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* undef)
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("skipped\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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [8 x i8] c"skipped\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putc(int);
void puti(int i) {
  if (i < 0) {
    putc('-');
    i = -i;
  }
  if (i >= 10)
    puti(i / 10);
  putc(i % 10 + '0');
}


x86 assembly (clang, -O0):
<puti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <puti+0x27>
mov    $0x2d,%edi
call   1030 <putc@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1163 <puti+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <puti@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puti>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <puti+0x16>
mov    $0x2d,%edi
call   1030 <putc@plt>
neg    %ebx
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <puti+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <puti@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @puti(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @putc(i32 45)
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
%17 = srem i32 %16, 10
%18 = add nsw i32 %17, 48
%19 = call i32 @putc(i32 %18)
ret void
}

LLVM IR (-O2):
define void @puti(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @putc(i32 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = icmp ugt i32 %7, 9
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @puti(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @putc(i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float cel, far;
  scanf("%f", &cel);
  far = (9 * cel / 4) + 32;
  printf("%f\n", far);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xec1(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeb0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xea0(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xec0(%rip),%xmm0
mulss  0xebc(%rip),%xmm0
addss  0xeb8(%rip),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fmul float 9.000000e+00, %5
%7 = fdiv float %6, 4.000000e+00
%8 = fadd float %7, 3.200000e+01
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 9.000000e+00
%6 = fmul float %5, 2.500000e-01
%7 = fadd float %6, 3.200000e+01
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}
int Foo(int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @Foo(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port10__enable();
void Msp430InterruptC__1__HplInterrupt__enable(void) {
  HplMsp430InterruptP__Port10__enable();
}


x86 assembly (clang, -O0):
<Msp430InterruptC__1__HplInterrupt__enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplMsp430InterruptP__Port10__enable@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Msp430InterruptC__1__HplInterrupt__enable() {
%1 = call i32 (...) @HplMsp430InterruptP__Port10__enable()
ret void
}

LLVM IR (-O2):
define void @Msp430InterruptC__1__HplInterrupt__enable() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port10__enable()
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
int strlen(char const *);
char *strchrnul(const char *s, int c) {
  char *p = strchr(s, c);
  if (!p)
    p = (char *)s + strlen(s);
  return p;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <strchrnul+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <strchrnul+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %3, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ gc_stack_root_pop();
void abandon_objects(int len) {
  int i;
  for (i = 0; i < len; i++) {
    gc_stack_root_pop();
  }
}


x86 assembly (clang, -O0):
<abandon_objects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <abandon_objects+0x33>
mov    $0x0,%al
call   1030 <gc_stack_root_pop@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <abandon_objects+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abandon_objects>:
push   %rbx
test   %edi,%edi
jle    112c <abandon_objects+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gc_stack_root_pop@plt>
add    $0xffffffff,%ebx
jne    1120 <abandon_objects+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @abandon_objects(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @gc_stack_root_pop()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @abandon_objects(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @gc_stack_root_pop()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int cmpint(const void *x, const void *y) {
  if (**(int **)x < **(int **)y)
    return -1;
  else if (**(int **)x > **(int **)y)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmpint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%eax
jge    1130 <cmpint+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <cmpint+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%eax
jle    1154 <cmpint+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <cmpint+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpint>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
setg   %dl
mov    $0xffffffff,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmpint(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32**
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32**
%12 = load i32*, i32** %11
%13 = load i32, i32* %12
%14 = icmp slt i32 %9, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %28
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32**
%19 = load i32*, i32** %18
%20 = load i32, i32* %19
%21 = load i8*, i8** %5
%22 = bitcast i8* %21 to i32**
%23 = load i32*, i32** %22
%24 = load i32, i32* %23
%25 = icmp sgt i32 %20, %24
br i1 %25, label %26, label %27
26: ; preds = %16
store i32 1, i32* %3
br label %28
27: ; preds = %16
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26, %15
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @cmpint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = icmp slt i32 %5, %8
%10 = icmp sgt i32 %5, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ check(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
char *mkstr(char const *, int);
int /*<<< orphan*/ stderr;
void expand(const char *text, int len) {
  char *s = mkstr(text, len);
  if (0)
    fprintf(stderr, "void expand(%s, %d)\n", s, len);
  check(5);
}


x86 assembly (clang, -O0):
<expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mkstr@plt>
mov    %rax,-0x18(%rbp)
mov    $0x5,%edi
call   1040 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand>:
push   %rax
call   1030 <mkstr@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <check@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @expand(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @mkstr(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = call i32 @check(i32 5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @expand(i8* %0, i32 %1) {
%3 = tail call i8* @mkstr(i8* %0, i32 %1)
%4 = tail call i32 @check(i32 5)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
int timer_start(struct timeval *tvp) {
  struct timezone tz;
  return gettimeofday(tvp, &tz);
}


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

x86 assembly (clang, -O2):
<timer_start>:
push   %rax
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @timer_start(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timezone
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, %struct.timezone* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @timer_start(%struct.timeval* nocapture %0) {
%2 = alloca %struct.timezone
%3 = bitcast %struct.timezone* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %0, %struct.timezone* %2)
ret i32 %4
}
unsigned int pack_g(int g) { return (unsigned int)g << 8; }


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

x86 assembly (clang, -O2):
<pack_g>:
mov    %edi,%eax
shl    $0x8,%eax
ret

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

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

/* Variables and functions */
void DESReset(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) |= 0x00000002;
  while (((*((volatile uint32_t *)(ui32Base + 0x00000038))) & 0x00000001) ==
         0) {
  }
}


x86 assembly (clang, -O0):
<DESReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1131 <DESReset+0x31>
jmp    1116 <DESReset+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESReset>:
movslq %edi,%rax
orl    $0x2,0x34(%rax)
nopw   0x0(%rax,%rax,1)
testl  $0x1,0x38(%rax)
je     1110 <DESReset+0x10>
ret

LLVM IR (-O0):
define void @DESReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 52
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
br label %9
9: ; preds = %17, %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 56
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @DESReset(i32 %0) {
%2 = add nsw i32 %0, 52
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
%7 = add nsw i32 %0, 56
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %10, %1
%11 = load volatile i32, i32* %9
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/lower.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/lower.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/lower.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn_BA(void) { printf("B=>A\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"B=>A\00"
define void @fn_BA() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int dobulk(int, void *, size_t, char *);
int /*<<< orphan*/ printf(char *, int);
int recv_bulk(int EndPt, void *pvBuf, size_t cbBuf) {
  int cb = dobulk(EndPt | 0x80, pvBuf, cbBuf, "recv_bulk");
  if (cb > 0)
    printf("cb=%d\n", cb);
  return cb;
}


x86 assembly (clang, -O0):
<recv_bulk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
or     $0x80,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb5(%rip),%rcx
call   1040 <dobulk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    116c <recv_bulk+0x4c>
mov    -0x1c(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_bulk>:
push   %rbx
or     $0x80,%edi
lea    0xed2(%rip),%rcx
call   1040 <dobulk@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1147 <recv_bulk+0x27>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"recv_bulk\00"
@.str.1 = [7 x i8] c"cb=%d\0A\00"
define i32 @recv_bulk(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = or i32 %8, 128
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @dobulk(i32 %9, i8* %10, i64 %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i32, i32* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [10 x i8] c"recv_bulk\00"
@.str.1 = [7 x i8] c"cb=%d\0A\00"
define i32 @recv_bulk(i32 %0, i8* %1, i64 %2) {
%4 = or i32 %0, 128
%5 = tail call i32 @dobulk(i32 %4, i8* %1, i64 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %9
9: ; preds = %7, %3
ret i32 %5
}
float decrad(float dec) { return dec * 3.141592653589793 / 180; }


x86 assembly (clang, -O0):
<decrad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrad>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @decrad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @decrad(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
struct animal_builder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void animal_builder_ops_build_tail(struct animal_builder *animal_builder) {
  printf("animal_builder::build_tail()\n");
}


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

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

LLVM IR (-O0):
%struct.animal_builder = type { i32 }
@.str = [30 x i8] c"animal_builder::build_tail()\0A\00"
define void @animal_builder_ops_build_tail(%struct.animal_builder* %0) {
%2 = alloca %struct.animal_builder*
store %struct.animal_builder* %0, %struct.animal_builder** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.animal_builder = type { i32 }
@str = [29 x i8] c"animal_builder::build_tail()\00"
define void @animal_builder_ops_build_tail(%struct.animal_builder* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void budd_panic_cstring(const char *a, const char *b) {
  fprintf(stderr, "error: %s: %s\n", a, b);
  exit(1);
}


x86 assembly (clang, -O0):
<budd_panic_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<budd_panic_cstring>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"error: %s: %s\0A\00"
define void @budd_panic_cstring(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"error: %s: %s\0A\00"
define void @budd_panic_cstring(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ declaration();
int /*<<< orphan*/ function_definition();
int yyselect();
external_declaration() {
  switch (yyselect()) {
  case 2: {
    function_definition();
  } break;
  case 3: {
    declaration();
  } break;
  }
}


x86 assembly (clang, -O0):
<external_declaration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x2,%eax
je     1163 <external_declaration+0x33>
jmp    1152 <external_declaration+0x22>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     116f <external_declaration+0x3f>
jmp    1176 <external_declaration+0x46>
mov    $0x0,%al
call   1030 <function_definition@plt>
jmp    1176 <external_declaration+0x46>
mov    $0x0,%al
call   1050 <declaration@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<external_declaration>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x3,%eax
je     114b <external_declaration+0x1b>
cmp    $0x2,%eax
jne    1152 <external_declaration+0x22>
xor    %eax,%eax
call   1030 <function_definition@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <declaration@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @external_declaration() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %7 [
i32 2, label %3
i32 3, label %5
]
3: ; preds = %0
%4 = call i32 (...) @function_definition()
br label %7
5: ; preds = %0
%6 = call i32 (...) @declaration()
br label %7
7: ; preds = %0, %5, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @external_declaration() {
%1 = tail call i32 (...) @yyselect()
switch i32 %1, label %6 [
i32 2, label %2
i32 3, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @function_definition()
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @declaration()
br label %6
6: ; preds = %0, %4, %2
ret i32 undef
}
/* Variables and functions */
scalar_t__ stu__accept(int);
int stu__err(char *);
int stu__demand(int p) {
  if (stu__accept(p))
    return 1;
  return stu__err("Didn't find expected stu__tok");
}


x86 assembly (clang, -O0):
<stu__demand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <stu__accept@plt>
cmp    $0x0,%rax
je     1149 <stu__demand+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1158 <stu__demand+0x38>
lea    0xeb0(%rip),%rdi
call   1040 <stu__err@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stu__demand>:
push   %rax
call   1030 <stu__accept@plt>
test   %rax,%rax
je     1132 <stu__demand+0x12>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <stu__err@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Didn't find expected stu__tok\00"
define i32 @stu__demand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @stu__accept(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 @stu__err(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [30 x i8] c"Didn't find expected stu__tok\00"
define i32 @stu__demand(i32 %0) {
%2 = tail call i64 @stu__accept(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @stu__err(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 1, %1 ]
ret i32 %7
}
int Interpret24bitAsInt32(unsigned char *byteArray) {
  int newInt = 0;
  newInt = (((0xFF & byteArray[0]) << 16) | ((0xFF & byteArray[1]) << 8) |
            ((0xFF & byteArray[2])));
  if ((newInt & 0x00800000) > 0) {
    newInt |= 0xFF000000;
  } else {
    newInt &= 0x00FFFFFF;
  }
  return newInt;
}


x86 assembly (clang, -O0):
<Interpret24bitAsInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x800000,%eax
cmp    $0x0,%eax
jle    1165 <Interpret24bitAsInt32+0x65>
mov    -0xc(%rbp),%eax
or     $0xff000000,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <Interpret24bitAsInt32+0x70>
mov    -0xc(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interpret24bitAsInt32>:
movzbl (%rdi),%eax
mov    %eax,%ecx
shl    $0x10,%ecx
movzbl 0x1(%rdi),%edx
shl    $0x8,%edx
or     %ecx,%edx
movzbl 0x2(%rdi),%ecx
lea    (%rdx,%rcx,1),%esi
test   $0x80,%al
lea    -0x1000000(%rcx,%rdx,1),%eax
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @Interpret24bitAsInt32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 255, %7
%9 = shl i32 %8, 16
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 255, %13
%15 = shl i32 %14, 8
%16 = or i32 %9, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 255, %20
%22 = or i32 %16, %21
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = and i32 %23, 8388608
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %1
%27 = load i32, i32* %3
%28 = or i32 %27, -16777216
store i32 %28, i32* %3
br label %32
29: ; preds = %1
%30 = load i32, i32* %3
%31 = and i32 %30, 16777215
store i32 %31, i32* %3
br label %32
32: ; preds = %29, %26
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @Interpret24bitAsInt32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = and i32 %3, 128
%15 = icmp eq i32 %14, 0
%16 = or i32 %13, -16777216
%17 = select i1 %15, i32 %13, i32 %16
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void jge_near_rj(unsigned int saut) {
  put8(0x0F);
  put8(0x8D);
  put32(saut);
}


x86 assembly (clang, -O0):
<jge_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8d,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jge_near_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8d,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jge_near_rj(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 141)
%5 = load i32, i32* %2
%6 = call i32 @put32(i32 %5)
ret void
}

LLVM IR (-O2):
define void @jge_near_rj(i32 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 141)
%4 = tail call i32 @put32(i32 %0)
ret void
}
int CheckCount(count)
long count;
{
  if (count < 0)
    return -4;
  else
    return 0;
}


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

x86 assembly (clang, -O2):
<CheckCount>:
mov    %rdi,%rax
sar    $0x3f,%rax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @CheckCount(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -4, 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):
define i32 @CheckCount(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = select i1 %2, i32 -4, i32 0
ret i32 %3
}
void foo() {
  for (; 1;) {
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
mov    $0x1,%al
test   $0x1,%al
jne    1118 <foo+0x18>
jmp    111d <foo+0x1d>
jmp    1109 <foo+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %2, %0
br i1 true, label %2, label %3
2: ; preds = %1
br label %1
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sin(int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopNumber();
int /*<<< orphan*/ wStackPushNumber(int /*<<< orphan*/);
void wBuiltinSin() { wStackPushNumber(sin(wStackPopNumber())); }


x86 assembly (clang, -O0):
<wBuiltinSin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    %eax,%edi
call   1040 <wStackPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinSin>:
push   %rax
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <wStackPushNumber@plt>

LLVM IR (-O0):
define void @wBuiltinSin() {
%1 = call i32 (...) @wStackPopNumber()
%2 = call i32 @sin(i32 %1)
%3 = call i32 @wStackPushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @wBuiltinSin() {
%1 = tail call i32 (...) @wStackPopNumber()
%2 = tail call i32 @sin(i32 %1)
%3 = tail call i32 @wStackPushNumber(i32 %2)
ret void
}
__attribute__((always_)) void flush_write_buffers(void) {
  __asm__ __volatile__("lock; addl $0,0(%%esp)" : : : "memory");
}


x86 assembly (clang, -O0):
<flush_write_buffers>:
push   %rbp
mov    %rsp,%rbp
lock addl $0x0,(%esp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_write_buffers>:
lock addl $0x0,(%esp)
ret

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

LLVM IR (-O2):
define void @flush_write_buffers() {
tail call void asm sideeffect "lock; addl $$0,0(%esp)", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
double cgo_callback_conv_get_double(void *addr) {
  return *(double *)((char *)addr);
}


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

x86 assembly (clang, -O2):
<cgo_callback_conv_get_double>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @cgo_callback_conv_get_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @cgo_callback_conv_get_double(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
int compare(void const *a, void const *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int ec_config_map_group(void *, int /*<<< orphan*/);
int ec_config_map(void *pIOmap) { return ec_config_map_group(pIOmap, 0); }


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

x86 assembly (clang, -O2):
<ec_config_map>:
xor    %esi,%esi
jmp    1030 <ec_config_map_group@plt>

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

LLVM IR (-O2):
define i32 @ec_config_map(i8* %0) {
%2 = tail call i32 @ec_config_map_group(i8* %0, i32 0)
ret i32 %2
}
int cmp_uchar_des(const void *x, const void *y) {
  if (*(unsigned char *)x > *(unsigned char *)y) {
    return -1;
  } else if (*(unsigned char *)x < *(unsigned char *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_uchar_des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jle    112e <cmp_uchar_des+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <cmp_uchar_des+0x5c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1150 <cmp_uchar_des+0x50>
movl   $0x1,-0x4(%rbp)
jmp    115c <cmp_uchar_des+0x5c>
jmp    1155 <cmp_uchar_des+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uchar_des>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_uchar_des(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = icmp slt i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %25
23: ; preds = %14
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @cmp_uchar_des(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ugt i8 %3, %4
%6 = icmp ult i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void IF_FALSE() {}


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

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

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

LLVM IR (-O2):
define void @IF_FALSE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void mill_panic(const char *text) {
  fprintf(stderr, "panic: %s\n", text);
  abort();
}


x86 assembly (clang, -O0):
<mill_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<mill_panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @mill_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @mill_panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
unsigned int inl_p(unsigned short int port) {
  unsigned int value;
  __asm__ __volatile__("inl %w1,%0\noutb %%al,$0x80"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inl_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
out    %al,$0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl_p>:
mov    %edi,%edx
in     (%dx),%eax
out    %al,$0x80
ret

LLVM IR (-O0):
define i32 @inl_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl_p(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}