xunge/DecIR huggingface dataset:
/* Variables and functions */
int dpdk_linux_tcpip_init(int, char **);
int /*<<< orphan*/ ipaugenblick_main_loop();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int ret = dpdk_linux_tcpip_init(argc, argv);
  if (ret < 0) {
    printf("Invalid arguments\n");
    return 1;
  }
  ipaugenblick_main_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <dpdk_linux_tcpip_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1177 <main+0x47>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1185 <main+0x55>
mov    $0x0,%al
call   1040 <ipaugenblick_main_loop@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <dpdk_linux_tcpip_init@plt>
test   %eax,%eax
js     1145 <main+0x15>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <ipaugenblick_main_loop@plt>
jmp    1156 <main+0x26>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [18 x i8] c"Invalid arguments\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @dpdk_linux_tcpip_init(i32 %0, i8** %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ipaugenblick_main_loop()
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %10
}
movstr(s, t) register char *s, *t;
{
  while (*t++ = *s++)
    continue;
}


x86 assembly (clang, -O0):
<movstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <movstr+0x3b>
jmp    110c <movstr+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movstr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <movstr+0x10>
ret

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

LLVM IR (-O2):
define i32 @movstr(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}
int sysctl(struct __sysctl_args *args) { return -1; }


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

x86 assembly (clang, -O2):
<sysctl>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.__sysctl_args = type opaque
define i32 @sysctl(%struct.__sysctl_args* %0) {
%2 = alloca %struct.__sysctl_args*
store %struct.__sysctl_args* %0, %struct.__sysctl_args** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.__sysctl_args = type opaque
define i32 @sysctl(%struct.__sysctl_args* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
__attribute__((always_)) __attribute__((warn_unused_result)) int32_t
clamp2(int32_t in, int32_t min, int32_t max) {
  return in >= max ? max : (in <= min ? min : in);
}


x86 assembly (clang, -O0):
<clamp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     112b <clamp2+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp2+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1146 <clamp2+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp2+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp2>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
cmp    %rdx,%rdi
cmovge %rdx,%rax
ret

LLVM IR (-O0):
define i64 @clamp2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %6
%9 = icmp sge i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %6
br label %22
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = icmp sle i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* %5
br label %20
18: ; preds = %12
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i64 [ %11, %10 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @clamp2(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %2
%5 = icmp sgt i64 %0, %1
%6 = select i1 %5, i64 %0, i64 %1
%7 = select i1 %4, i64 %6, i64 %2
ret i64 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int8_t i = 0xff;
  printf("%d\n", i);
  uint8_t u = 0xff;
  printf("%d\n", u);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 255)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 255)
ret i32 0
}
int shift_funktion1(int var, int shift) { return (var << shift); }


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

x86 assembly (clang, -O2):
<shift_funktion1>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @shift_funktion1(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *plot_name(char *name, double tau, double h1, double h2, int t) {
  sprintf(name, "t%02dh%02dh%02dl%d.log", (int)(tau * 100), (int)(h1 * 100),
          (int)(h2 * 100), t);
  return name;
}


x86 assembly (clang, -O0):
<plot_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xec6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edx
movsd  0xeb5(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
movsd  0xea4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%r8d
mov    -0x24(%rbp),%r9d
lea    0xe97(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_name>:
push   %rbx
movsd  0xee7(%rip),%xmm3
mulsd  %xmm3,%xmm0
cvttsd2si %xmm0,%edx
mulsd  %xmm3,%xmm1
cvttsd2si %xmm1,%ecx
mov    %esi,%r9d
mov    %rdi,%rbx
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%r8d
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"t%02dh%02dh%02dl%d.log\00"
define i8* @plot_name(i8* %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store i8* %0, i8** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load double, double* %7
%13 = fmul double %12, 1.000000e+02
%14 = fptosi double %13 to i32
%15 = load double, double* %8
%16 = fmul double %15, 1.000000e+02
%17 = fptosi double %16 to i32
%18 = load double, double* %9
%19 = fmul double %18, 1.000000e+02
%20 = fptosi double %19 to i32
%21 = load i32, i32* %10
%22 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17, i32 %20, i32 %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
@.str = [23 x i8] c"t%02dh%02dh%02dl%d.log\00"
define i8* @plot_name(i8* returned writeonly %0, double %1, double %2, double %3, i32 %4) {
%6 = fmul double %1, 1.000000e+02
%7 = fptosi double %6 to i32
%8 = fmul double %2, 1.000000e+02
%9 = fptosi double %8 to i32
%10 = fmul double %3, 1.000000e+02
%11 = fptosi double %10 to i32
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11, i32 %4)
ret i8* %0
}
void foo382(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo382(i32 %0) {
ret void
}
int fun1354() { return 1354; }


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

x86 assembly (clang, -O2):
<fun1354>:
mov    $0x54a,%eax
ret

LLVM IR (-O0):
define i32 @fun1354() {
ret i32 1354
}

LLVM IR (-O2):
define i32 @fun1354() {
ret i32 1354
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast8_t;

/* Variables and functions */
uint_fast8_t ip6tos(const void *ip6addr, char *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ip6tos(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(intptr_t);
void vmir_sysio_close(void *opaque, intptr_t fh) { close(fh); }


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

x86 assembly (clang, -O2):
<vmir_sysio_close>:
mov    %rsi,%rdi
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @vmir_sysio_close(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @close(i64 %5)
ret void
}

LLVM IR (-O2):
define void @vmir_sysio_close(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @close(i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
void smbus_delay(void) { inb(0x80); }


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

x86 assembly (clang, -O2):
<smbus_delay>:
mov    $0x80,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define void @smbus_delay() {
%1 = call i32 @inb(i32 128)
ret void
}

LLVM IR (-O2):
define void @smbus_delay() {
%1 = tail call i32 @inb(i32 128)
ret void
}
void ui_config_reloaded(void) {}


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

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

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

LLVM IR (-O2):
define void @ui_config_reloaded() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test() {
  int auto num = 123;
  register int num2 = 456;
  printf("%d\n", num);
  static int stc = 0;
  stc += 1;
  printf("%d\n", stc);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7b,-0x4(%rbp)
movl   $0x1c8,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee8(%rip)
mov    0x2ee2(%rip),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
mov    0x2f01(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2ef8(%rip)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@test.stc = internal global i32 0
define void @test() {
%1 = alloca i32
%2 = alloca i32
store i32 123, i32* %1
store i32 456, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @test.stc
%6 = add nsw i32 %5, 1
store i32 %6, i32* @test.stc
%7 = load i32, i32* @test.stc
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@test.stc = internal unnamed_addr global i32 0
define void @test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 123)
%2 = load i32, i32* @test.stc
%3 = add nsw i32 %2, 1
store i32 %3, i32* @test.stc
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
  case 'q':
  case 'Q':
    exit(0);
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     115b <keyboard+0x4b>
jmp    1139 <keyboard+0x29>
mov    -0x10(%rbp),%eax
sub    $0x51,%eax
je     115b <keyboard+0x4b>
jmp    114a <keyboard+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x71,%eax
jne    1162 <keyboard+0x52>
jmp    115b <keyboard+0x4b>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1123 <keyboard+0x13>
cmp    $0x71,%dil
je     1123 <keyboard+0x13>
cmp    $0x51,%dil
je     1123 <keyboard+0x13>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
i32 113, label %9
i32 81, label %9
]
9: ; preds = %3, %3, %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %6 [
i8 27, label %4
i8 113, label %4
i8 81, label %4
]
4: ; preds = %3, %3, %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
ret void
}
/* Type definitions */
struct AST_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void AST_parser_error(struct AST_parser *self, char *msg) {
  printf("parser error : cause by \"%s\"\n", msg);
  return;
}


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

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

LLVM IR (-O0):
%struct.AST_parser = type { i32 }
@.str = [30 x i8] c"parser error : cause by \22%s\22\0A\00"
define void @AST_parser_error(%struct.AST_parser* %0, i8* %1) {
%3 = alloca %struct.AST_parser*
%4 = alloca i8*
store %struct.AST_parser* %0, %struct.AST_parser** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
%struct.AST_parser = type { i32 }
@.str = [30 x i8] c"parser error : cause by \22%s\22\0A\00"
define void @AST_parser_error(%struct.AST_parser* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void init_fft32() {}


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

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

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

LLVM IR (-O2):
define void @init_fft32() {
ret void
}
int *f1(int *a, int *b) {
  int *c;
  a = b;
  c = a;
  return c;
}


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

x86 assembly (clang, -O2):
<f1>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i32* @f1(i32* nocapture readnone %0, i32* readnone returned %1) {
ret i32* %1
}
/* Type definitions */
struct GameMap {
  int dummy;
};

/* Variables and functions */
int map_leftop(struct GameMap *const);
int /*<<< orphan*/ map_rotate_left(struct GameMap *const, int);
int map_upop(struct GameMap *const map) {
  map_rotate_left(map, 1);
  int actions = map_leftop(map);
  map_rotate_left(map, 3);
  return actions;
}


x86 assembly (clang, -O0):
<map_upop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <map_rotate_left@plt>
mov    -0x8(%rbp),%rdi
call   1040 <map_leftop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <map_rotate_left@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_upop>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <map_rotate_left@plt>
mov    %rbx,%rdi
call   1040 <map_leftop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <map_rotate_left@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.GameMap = type { i32 }
define i32 @map_upop(%struct.GameMap* %0) {
%2 = alloca %struct.GameMap*
%3 = alloca i32
store %struct.GameMap* %0, %struct.GameMap** %2
%4 = load %struct.GameMap*, %struct.GameMap** %2
%5 = call i32 @map_rotate_left(%struct.GameMap* %4, i32 1)
%6 = load %struct.GameMap*, %struct.GameMap** %2
%7 = call i32 @map_leftop(%struct.GameMap* %6)
store i32 %7, i32* %3
%8 = load %struct.GameMap*, %struct.GameMap** %2
%9 = call i32 @map_rotate_left(%struct.GameMap* %8, i32 3)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.GameMap = type { i32 }
define i32 @map_upop(%struct.GameMap* %0) {
%2 = tail call i32 @map_rotate_left(%struct.GameMap* %0, i32 1)
%3 = tail call i32 @map_leftop(%struct.GameMap* %0)
%4 = tail call i32 @map_rotate_left(%struct.GameMap* %0, i32 3)
ret i32 %3
}
unsigned char unsignedchar_ignoring_shortint(unsigned char x, short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_shortint(i8 returned zeroext %0, i16 signext %1) {
ret i8 %0
}
/* Type definitions */
struct posix_acl {
  int dummy;
};

/* Variables and functions */
struct posix_acl *posix_acl_from_xattr(void const *, int);
struct posix_acl *zpl_acl_from_xattr(const void *value, int size) {
  return (posix_acl_from_xattr(value, size));
}


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

x86 assembly (clang, -O2):
<zpl_acl_from_xattr>:
jmp    1030 <posix_acl_from_xattr@plt>

LLVM IR (-O0):
%struct.posix_acl = type { i32 }
define %struct.posix_acl* @zpl_acl_from_xattr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call %struct.posix_acl* @posix_acl_from_xattr(i8* %5, i32 %6)
ret %struct.posix_acl* %7
}

LLVM IR (-O2):
%struct.posix_acl = type { i32 }
define %struct.posix_acl* @zpl_acl_from_xattr(i8* %0, i32 %1) {
%3 = tail call %struct.posix_acl* @posix_acl_from_xattr(i8* %0, i32 %1)
ret %struct.posix_acl* %3
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_SMOOTH);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_DEPTH_TEST);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1040 <glClearColor@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <glShadeModel@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1040 <glClearColor@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <glShadeModel@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_SMOOTH = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_SMOOTH
%3 = call i32 @glShadeModel(i32 %2)
%4 = load i32, i32* @GL_LIGHTING
%5 = call i32 @glEnable(i32 %4)
%6 = load i32, i32* @GL_LIGHT0
%7 = call i32 @glEnable(i32 %6)
%8 = load i32, i32* @GL_DEPTH_TEST
%9 = call i32 @glEnable(i32 %8)
ret void
}

LLVM IR (-O2):
@GL_SMOOTH = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_SMOOTH
%3 = tail call i32 @glShadeModel(i32 %2)
%4 = load i32, i32* @GL_LIGHTING
%5 = tail call i32 @glEnable(i32 %4)
%6 = load i32, i32* @GL_LIGHT0
%7 = tail call i32 @glEnable(i32 %6)
%8 = load i32, i32* @GL_DEPTH_TEST
%9 = tail call i32 @glEnable(i32 %8)
ret void
}
/* Type definitions */
struct file {
  int dummy;
};

/* Variables and functions */
scalar_t__ read_line(struct file *, char *, size_t);
int /*<<< orphan*/ *strchr(char *, char);
void skip_to_next_line(struct file *fp, char *buf, size_t bufsize) {
  while (strchr(buf, '\n') == NULL) {
    if (read_line(fp, buf, bufsize))
      break;
  }
}


x86 assembly (clang, -O0):
<skip_to_next_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    1171 <skip_to_next_line+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read_line@plt>
cmp    $0x0,%rax
je     116c <skip_to_next_line+0x4c>
jmp    1171 <skip_to_next_line+0x51>
jmp    1134 <skip_to_next_line+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_next_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1155 <skip_to_next_line+0x35>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <read_line@plt>
test   %rax,%rax
je     1130 <skip_to_next_line+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.file = type { i32 }
define void @skip_to_next_line(%struct.file* %0, i8* %1, i64 %2) {
%4 = alloca %struct.file*
%5 = alloca i8*
%6 = alloca i64
store %struct.file* %0, %struct.file** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %7
7: ; preds = %18, %3
%8 = load i8*, i8** %5
%9 = call i32* @strchr(i8* %8, i8 signext 10)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load %struct.file*, %struct.file** %4
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i64 @read_line(%struct.file* %12, i8* %13, i64 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
br label %19
18: ; preds = %11
br label %7
19: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
%struct.file = type { i32 }
define void @skip_to_next_line(%struct.file* %0, i8* %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32* @strchr(i8* %1, i8 signext 10)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 @read_line(%struct.file* %0, i8* %1, i64 %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %7, %4
ret void
}
void avcodec_close() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_resc_function_list();
void resc_init() { register_resc_function_list(); }


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

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

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

LLVM IR (-O2):
define void @resc_init() {
%1 = tail call i32 (...) @register_resc_function_list()
ret void
}
/* Variables and functions */
double errcheck(int /*<<< orphan*/, char *);
int /*<<< orphan*/ exp(double);
double Exp(double *args) { return errcheck(exp(*args), "exp"); }


x86 assembly (clang, -O0):
<Exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
lea    0xebe(%rip),%rsi
call   1030 <errcheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exp>:
push   %rax
movsd  (%rdi),%xmm0
call   1040 <exp@plt>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errcheck@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"exp\00"
define double @Exp(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call i32 @exp(double %4)
%6 = call double @errcheck(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret double %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"exp\00"
define double @Exp(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @exp(double %2)
%4 = tail call double @errcheck(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret double %4
}
char *hash_plugin_summary(void) {
  return ("msoffice \tMS Office 2007/2010/2013 plugin");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"msoffice \09MS Office 2007/2010/2013 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"msoffice \09MS Office 2007/2010/2013 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *block = malloc(sizeof(char) * 1024);
  printf("---- mallocTest: block address: %p\n", block);
  free(block);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"---- mallocTest: block address: %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 1024)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"---- mallocTest: block address: %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
char *ft_strupcase(char *str) {
  char *tmp;
  tmp = str;
  while (*tmp) {
    if (*tmp >= 'a' && *tmp <= 'z')
      (*tmp) -= 32;
    tmp++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_strupcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <ft_strupcase+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1149 <ft_strupcase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1149 <ft_strupcase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strupcase+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strupcase>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ft_strupcase+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <ft_strupcase+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <ft_strupcase+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <ft_strupcase+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <ft_strupcase+0x10>
ret

LLVM IR (-O0):
define i8* @ft_strupcase(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %25, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %28
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %14, %9
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %5
28: ; preds = %5
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @ft_strupcase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
int ft_grid_empty(char *buf) {
  int i;
  i = 0;
  while (buf[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_grid_empty>:
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     1132 <ft_grid_empty+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_grid_empty+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_grid_empty(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 %15
12: ; preds = %4
%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 @ft_grid_empty(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
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRF3_get(void) { return U_WMRCORENONE_get("U_WMRF3"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRF3\00"
define i32 @U_WMRF3_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF3\00"
define i32 @U_WMRF3_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_wpa_passphrase_usage(void) {
  printf("\nUsage : sys_cfg_wpa_passphrase [PASSPHRASE]\n");
  printf("\nIf PASSPHRASE is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_wpa_passphrase_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0AUsage : sys_cfg_wpa_passphrase [PASSPHRASE]\0A\00"
@.str.1 = [78 x i8] c"\0AIf PASSPHRASE is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
define void @print_sys_cfg_wpa_passphrase_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"\0AUsage : sys_cfg_wpa_passphrase [PASSPHRASE]\00"
@str.2 = [77 x i8] c"\0AIf PASSPHRASE is provided, a 'set' is performed, else a 'get' is performed.\00"
define void @print_sys_cfg_wpa_passphrase_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.2, i64 0, i64 0))
ret void
}
int test_imm_B0int16_reg(short val) {
  return ((val) & (0xB0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B0int16_reg(i16 signext %0) {
%2 = and i16 %0, 176
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void f1(int *p, int *q) {
  *p = 7;
  *q = 9;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x7,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x9,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movl   $0x7,(%rdi)
movl   $0x9,(%rsi)
ret

LLVM IR (-O0):
define void @f1(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
store i32 7, i32* %5
%6 = load i32*, i32** %4
store i32 9, i32* %6
ret void
}

LLVM IR (-O2):
define void @f1(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 7, i32* %0
store i32 9, i32* %1
ret void
}
/* Variables and functions */
double sin(double);
double horizontal_component(double comp, double angle) {
  return comp * sin(angle);
}


x86 assembly (clang, -O0):
<horizontal_component>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<horizontal_component>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @horizontal_component(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @sin(double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @horizontal_component(double %0, double %1) {
%3 = tail call double @sin(double %1)
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(float);
int /*<<< orphan*/ __print_int(int);
int main() {
  int a[5];
  float b[5][4][2];
  int i;
  int j;
  a[3] = 8;
  __print_int(a[3]);
  i = 2;
  j = 1;
  b[1 * i][j * 3][0] = 3.98;
  __print_float(b[1 * i][j * 3][0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <__print_int@plt>
movl   $0x2,-0xc4(%rbp)
movl   $0x1,-0xc8(%rbp)
mov    -0xc4(%rbp),%eax
shl    $0x0,%eax
movslq %eax,%rcx
lea    -0xc0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
imul   $0x3,-0xc8(%rbp),%ecx
movslq %ecx,%rcx
movss  0xe7f(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,8)
mov    -0xc4(%rbp),%eax
shl    $0x0,%eax
movslq %eax,%rcx
lea    -0xc0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
imul   $0x3,-0xc8(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,8),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <__print_int@plt>
movss  0xecd(%rip),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x [4 x [2 x float]]]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
store i32 8, i32* %6
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%8 = load i32, i32* %7
%9 = call i32 @__print_int(i32 %8)
store i32 2, i32* %4
store i32 1, i32* %5
%10 = load i32, i32* %4
%11 = mul nsw i32 1, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x [4 x [2 x float]]], [5 x [4 x [2 x float]]]* %3, i64 0, i64 %12
%14 = load i32, i32* %5
%15 = mul nsw i32 %14, 3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %13, i64 0, i64 %16
%18 = getelementptr inbounds [2 x float], [2 x float]* %17, i64 0, i64 0
store float 0x400FD70A40000000, float* %18
%19 = load i32, i32* %4
%20 = mul nsw i32 1, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [5 x [4 x [2 x float]]], [5 x [4 x [2 x float]]]* %3, i64 0, i64 %21
%23 = load i32, i32* %5
%24 = mul nsw i32 %23, 3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %22, i64 0, i64 %25
%27 = getelementptr inbounds [2 x float], [2 x float]* %26, i64 0, i64 0
%28 = load float, float* %27
%29 = call i32 @__print_float(float %28)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 8)
%2 = tail call i32 @__print_float(float 0x400FD70A40000000)
ret i32 0
}
int foo8() { return 1; }


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

x86 assembly (clang, -O2):
<foo8>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo8() {
ret i32 1
}

LLVM IR (-O2):
define i32 @foo8() {
ret i32 1
}
unsigned short read_be16(unsigned char *in) {
  unsigned short result = 0;
  result |= (unsigned short)in[0] << 8;
  result |= (unsigned short)in[1];
  return result;
}


x86 assembly (clang, -O0):
<read_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%ecx
shl    $0x8,%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
movzwl %ax,%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @read_be16(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = zext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = or i32 %11, %9
%13 = trunc i32 %12 to i16
store i16 %13, i16* %3
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i16
%18 = zext i16 %17 to i32
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = or i32 %20, %18
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @read_be16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stomperosc_note_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<stomperosc_note_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @stomperosc_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ptr_free(void *o) { return; }


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

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

LLVM IR (-O0):
define void @ptr_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @ptr_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int const);
void serialClose(const int fd) { close(fd); }


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

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

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

LLVM IR (-O2):
define void @serialClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}