xunge/DecIR huggingface dataset:
/* Variables and functions */
int tcp_setup_wrap(int, int, void **);
int tcp_wrap(int fd, bool client, void **ctxp) {
  return (tcp_setup_wrap(fd, client ? 0 : 2, ctxp));
}


x86 assembly (clang, -O0):
<tcp_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
mov    $0x2,%esi
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <tcp_setup_wrap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_wrap>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
add    %eax,%eax
mov    %eax,%esi
jmp    1030 <tcp_setup_wrap@plt>

LLVM IR (-O0):
define i32 @tcp_wrap(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 2
%12 = load i8**, i8*** %6
%13 = call i32 @tcp_setup_wrap(i32 %7, i32 %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @tcp_wrap(i32 %0, i32 %1, i8** %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 2, i32 0
%6 = tail call i32 @tcp_setup_wrap(i32 %0, i32 %5, i8** %2)
ret i32 %6
}
/* Variables and functions */
double cosf(double);
double powf(double, int);
double sinf(double);
double func(double x, double y) {
  double f;
  f = (x * sinf(y) + y * cosf(x)) / (powf(x, 3) - powf(y, 3));
  return f;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sinf@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cosf@plt>
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1040 <powf@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1040 <powf@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1030 <sinf@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cosf@plt>
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
mov    $0x3,%edi
call   1040 <powf@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x3,%edi
call   1040 <powf@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @func(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @sinf(double %7)
%9 = load double, double* %4
%10 = load double, double* %3
%11 = call double @cosf(double %10)
%12 = fmul double %9, %11
%13 = call double @llvm.fmuladd.f64(double %6, double %8, double %12)
%14 = load double, double* %3
%15 = call double @powf(double %14, i32 3)
%16 = load double, double* %4
%17 = call double @powf(double %16, i32 3)
%18 = fsub double %15, %17
%19 = fdiv double %13, %18
store double %19, double* %5
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @func(double %0, double %1) {
%3 = tail call double @sinf(double %1)
%4 = tail call double @cosf(double %0)
%5 = fmul double %4, %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %5)
%7 = tail call double @powf(double %0, i32 3)
%8 = tail call double @powf(double %1, i32 3)
%9 = fsub double %7, %8
%10 = fdiv double %6, %9
ret double %10
}
int fun789() { return 789; }


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

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

LLVM IR (-O0):
define i32 @fun789() {
ret i32 789
}

LLVM IR (-O2):
define i32 @fun789() {
ret i32 789
}
/* Variables and functions */
unsigned int *malloc(int);
unsigned int *uiptr(unsigned int value) {
  unsigned int *p = malloc(sizeof(unsigned int));
  *p = value;
  return p;
}


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

x86 assembly (clang, -O2):
<uiptr>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @uiptr(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @uiptr(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
void gtk_image_menu_item_new_with_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_menu_item_new_with_label() {
ret void
}
unsigned long nul_byte_index_b64(unsigned long long mask) {
  mask |= mask >> 1;
  mask |= mask >> 2;
  mask |= mask >> 4;
  mask |= mask >> 8;
  mask |= mask >> 16;
  mask |= mask >> 32;
  mask >>= 8;
  return 7 - (mask * 0x0001020304050608ull >> 56);
}


x86 assembly (clang, -O0):
<nul_byte_index_b64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x8(%rbp)
movabs $0x1020304050608,%rcx
imul   -0x8(%rbp),%rcx
shr    $0x38,%rcx
mov    $0x7,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nul_byte_index_b64>:
mov    %rdi,%rax
shr    %rax
or     %rdi,%rax
mov    %rax,%rcx
shr    $0x2,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x4,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x8,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x10,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x28,%rcx
shr    $0x8,%rax
or     %rcx,%rax
movabs $0x1020304050608,%rcx
imul   %rax,%rcx
shr    $0x38,%rcx
mov    $0x7,%eax
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @nul_byte_index_b64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 1
%5 = load i64, i64* %2
%6 = or i64 %5, %4
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = lshr i64 %7, 2
%9 = load i64, i64* %2
%10 = or i64 %9, %8
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = lshr i64 %11, 4
%13 = load i64, i64* %2
%14 = or i64 %13, %12
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = lshr i64 %15, 8
%17 = load i64, i64* %2
%18 = or i64 %17, %16
store i64 %18, i64* %2
%19 = load i64, i64* %2
%20 = lshr i64 %19, 16
%21 = load i64, i64* %2
%22 = or i64 %21, %20
store i64 %22, i64* %2
%23 = load i64, i64* %2
%24 = lshr i64 %23, 32
%25 = load i64, i64* %2
%26 = or i64 %25, %24
store i64 %26, i64* %2
%27 = load i64, i64* %2
%28 = lshr i64 %27, 8
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = mul i64 %29, 283686952306184
%31 = lshr i64 %30, 56
%32 = sub i64 7, %31
ret i64 %32
}

LLVM IR (-O2):
define i64 @nul_byte_index_b64(i64 %0) {
%2 = lshr i64 %0, 1
%3 = or i64 %2, %0
%4 = lshr i64 %3, 2
%5 = or i64 %4, %3
%6 = lshr i64 %5, 4
%7 = or i64 %6, %5
%8 = lshr i64 %7, 8
%9 = or i64 %8, %7
%10 = lshr i64 %9, 16
%11 = or i64 %10, %9
%12 = lshr i64 %11, 40
%13 = lshr i64 %11, 8
%14 = or i64 %12, %13
%15 = mul i64 %14, 283686952306184
%16 = lshr i64 %15, 56
%17 = sub nsw i64 7, %16
ret i64 %17
}
int powernv_get_random_real_mode(unsigned long *v) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @powernv_get_random_real_mode(i64* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(char const *progname) {
  fprintf(stderr, "Usage: %s /path/to/sysfs/device/directory\n", progname);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
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   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s /path/to/sysfs/device/directory\0A\00"
define void @usage(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 ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s /path/to/sysfs/device/directory\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
void file_lines_free(char **lines) {
  if (!lines) {
    return;
  }
  SAFE_FREE(lines[0]);
  SAFE_FREE(lines);
}


x86 assembly (clang, -O0):
<file_lines_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <file_lines_free+0x1c>
jmp    1145 <file_lines_free+0x35>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <SAFE_FREE@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <SAFE_FREE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_lines_free>:
test   %rdi,%rdi
je     112e <file_lines_free+0x1e>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <SAFE_FREE@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <SAFE_FREE@plt>
ret

LLVM IR (-O0):
define void @file_lines_free(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @SAFE_FREE to i32 (i8*, ...)*)(i8* %9)
%11 = load i8**, i8*** %2
%12 = call i32 (i8**, ...) bitcast (i32 (...)* @SAFE_FREE to i32 (i8**, ...)*)(i8** %11)
br label %13
13: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @file_lines_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @SAFE_FREE to i32 (i8*, ...)*)(i8* %4)
%6 = tail call i32 (i8**, ...) bitcast (i32 (...)* @SAFE_FREE to i32 (i8**, ...)*)(i8** %0)
br label %7
7: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void task_send(int fd, char *command) {
  printf("send buffer = [%s]\n", command);
  write(fd, command, strlen(command));
}


x86 assembly (clang, -O0):
<task_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_send>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"send buffer = [%s]\0A\00"
define void @task_send(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"send buffer = [%s]\0A\00"
define void @task_send(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %4)
ret void
}
/* Type definitions */
typedef scalar_t__ uint_fast8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int_fast16_t;

/* Variables and functions */
int /*<<< orphan*/ clamp(scalar_t__);
int /*<<< orphan*/ color(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
uint32_t applicate_color(uint_fast8_t c[3], int_fast16_t m) {
  return color(clamp(c[0] + m), clamp(c[1] + m), clamp(c[2] + m), 255);
}


x86 assembly (clang, -O0):
<applicate_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
add    -0x10(%rbp),%rdi
call   1030 <clamp@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
add    -0x10(%rbp),%rdi
call   1030 <clamp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
add    -0x10(%rbp),%rdi
call   1030 <clamp@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    $0xff,%ecx
call   1040 <color@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applicate_color>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%rdi
add    %rsi,%rdi
call   1030 <clamp@plt>
mov    %eax,%r15d
mov    0x8(%r14),%rdi
add    %rbx,%rdi
call   1030 <clamp@plt>
mov    %eax,%ebp
add    0x10(%r14),%rbx
mov    %rbx,%rdi
call   1030 <clamp@plt>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %eax,%edx
mov    $0xff,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <color@plt>

LLVM IR (-O0):
define i32 @applicate_color(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = add nsw i64 %7, %8
%10 = call i32 @clamp(i64 %9)
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = load i64, i64* %4
%15 = add nsw i64 %13, %14
%16 = call i32 @clamp(i64 %15)
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = load i64, i64* %4
%21 = add nsw i64 %19, %20
%22 = call i32 @clamp(i64 %21)
%23 = call i32 @color(i32 %10, i32 %16, i32 %22, i32 255)
ret i32 %23
}

LLVM IR (-O2):
define i32 @applicate_color(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = add nsw i64 %3, %1
%5 = tail call i32 @clamp(i64 %4)
%6 = getelementptr inbounds i64, i64* %0, i64 1
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %1
%9 = tail call i32 @clamp(i64 %8)
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %1
%13 = tail call i32 @clamp(i64 %12)
%14 = tail call i32 @color(i32 %5, i32 %9, i32 %13, i32 255)
ret i32 %14
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void Close(int fd) {
  if (close(fd) == -1) {
    perror("close error");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1162 <Close+0x32>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     113d <Close+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_coord_to_scr(int *, int *, int /*<<< orphan*/ *);
int /*<<< orphan*/ mvaddch(int, int, int);
void gui_mvaddch(int y, int x, int c) {
  gui_coord_to_scr(&y, &x, NULL);
  mvaddch(y, x, c);
}


x86 assembly (clang, -O0):
<gui_mvaddch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <gui_coord_to_scr@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_mvaddch>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <gui_coord_to_scr@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %ebx,%edx
call   1040 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @gui_mvaddch(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @gui_coord_to_scr(i32* %4, i32* %5, i32* null)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @mvaddch(i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @gui_mvaddch(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @gui_coord_to_scr(i32* %4, i32* %5, i32* null)
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @mvaddch(i32 %7, i32 %8, i32 %2)
ret void
}
/* Variables and functions */
size_t fread(void *, int, size_t, void *);
int mn_read(void *fp, void *buf, size_t size) {
  if (fread(buf, 1, size, fp) == size)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<mn_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x20(%rbp),%rax
jne    1150 <mn_read+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1157 <mn_read+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mn_read>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mn_read(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %6
%9 = load i64, i64* %7
%10 = load i8*, i8** %5
%11 = call i64 @fread(i8* %8, i32 1, i64 %9, i8* %10)
%12 = load i64, i64* %7
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 0, i32* %4
br label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @mn_read(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i8* %0)
%5 = icmp ne i64 %4, %2
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int atoi(char *);
int ExtractHour(const char *RawDate) {
  char RawHour[3];
  int Temp;
  RawHour[0] = RawDate[11];
  RawHour[1] = RawDate[12];
  RawHour[2] = 0;
  Temp = atoi(RawHour);
  return Temp;
}


x86 assembly (clang, -O0):
<ExtractHour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xb(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%al
mov    %al,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtractHour>:
push   %rax
mov    0xb(%rdi),%al
mov    %al,0x5(%rsp)
mov    0xc(%rdi),%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%rdi
call   1030 <atoi@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ExtractHour(i8* nocapture %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %0, i64 11
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = load i8, i8* %6
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 0, i8* %9
%10 = call i32 @atoi(i8* %3)
ret i32 %10
}
void delay(void) {
  unsigned long i;
  for (i = 0; i < 60000; i++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
cmpq   $0xea60,-0x8(%rbp)
jae    1130 <delay+0x30>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <delay+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %6, %0
%3 = load i64, i64* %1
%4 = icmp ult i64 %3, 60000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i64, i64* %1
%8 = add i64 %7, 1
store i64 %8, i64* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
ret void
}
__attribute__((always_)) void __NOP(void) {}


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

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

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

LLVM IR (-O2):
define void @__NOP() {
ret void
}
void OTG_HS_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @OTG_HS_IRQHandler() {
ret void
}
void AT91F_Spurious_handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<AT91F_Spurious_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <AT91F_Spurious_handler+0x9>
jmp    1109 <AT91F_Spurious_handler+0x9>

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

LLVM IR (-O0):
define void @AT91F_Spurious_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @AT91F_Spurious_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M30_f(char *s) {
  debug("M30_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M30_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M30_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M30_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M30_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M30_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M30_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
unsigned int bswap_int(unsigned int i) {
  i = ((i >> 8) & 0x00FF00FFU) | ((i << 8) & 0xFF00FF00U);
  i = ((i >> 16) & 0x0000FFFFU) | ((i << 16) & 0xFFFF0000U);
  return i;
}


x86 assembly (clang, -O0):
<bswap_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00ff00,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = and i32 %4, 16711935
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, -16711936
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 16
%12 = and i32 %11, 65535
%13 = load i32, i32* %2
%14 = shl i32 %13, 16
%15 = and i32 %14, -65536
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @bswap_int(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int ls_cost_nm3_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm3_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm3_n_out() {
ret i32 2
}
/* Variables and functions */
bool isLeftAssociative(char operator) {
  switch (operator) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '%':
    return true;
  case '^':
    return false;
  }
}


x86 assembly (clang, -O0):
<isLeftAssociative>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x25,%eax
je     1166 <isLeftAssociative+0x66>
jmp    111f <isLeftAssociative+0x1f>
mov    -0xc(%rbp),%eax
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     1166 <isLeftAssociative+0x66>
jmp    1133 <isLeftAssociative+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1166 <isLeftAssociative+0x66>
jmp    1144 <isLeftAssociative+0x44>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1166 <isLeftAssociative+0x66>
jmp    1155 <isLeftAssociative+0x55>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     1172 <isLeftAssociative+0x72>
jmp    1179 <isLeftAssociative+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1179 <isLeftAssociative+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeftAssociative>:
xor    %eax,%eax
cmp    $0x5e,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @isLeftAssociative(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
i32 37, label %6
i32 94, label %7
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %6, %7, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isLeftAssociative(i8 signext %0) {
%2 = icmp ne i8 %0, 94
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned int const S(unsigned int const *, int);
unsigned int Sig0(const unsigned int *x) {
  return S(x, 7) ^ S(x, 18) ^ (*x >> 3);
}


x86 assembly (clang, -O0):
<Sig0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1030 <S@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x12,%esi
call   1030 <S@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
shr    $0x3,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sig0>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x7,%esi
call   1030 <S@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x12,%esi
call   1030 <S@plt>
xor    %ebp,%eax
mov    (%rbx),%ecx
shr    $0x3,%ecx
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Sig0(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @S(i32* %3, i32 7)
%5 = load i32*, i32** %2
%6 = call i32 @S(i32* %5, i32 18)
%7 = xor i32 %4, %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = lshr i32 %9, 3
%11 = xor i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Sig0(i32* %0) {
%2 = tail call i32 @S(i32* %0, i32 7)
%3 = tail call i32 @S(i32* %0, i32 18)
%4 = xor i32 %3, %2
%5 = load i32, i32* %0
%6 = lshr i32 %5, 3
%7 = xor i32 %4, %6
ret i32 %7
}
void _gettimeofday(void) {}


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

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

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

LLVM IR (-O2):
define void @_gettimeofday() {
ret void
}
unsigned long long rl() {
  unsigned long long ll;
  ll = 0x123456789;
  return ll;
}


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

x86 assembly (clang, -O2):
<rl>:
movabs $0x123456789,%rax
ret

LLVM IR (-O0):
define i64 @rl() {
%1 = alloca i64
store i64 4886718345, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @rl() {
ret i64 4886718345
}
/* Variables and functions */
int GLOB_NOSORT;
int octave_glob_nosort_wrapper(void) { return GLOB_NOSORT; }


x86 assembly (clang, -O0):
<octave_glob_nosort_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_glob_nosort_wrapper>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@GLOB_NOSORT = global i32 0
define i32 @octave_glob_nosort_wrapper() {
%1 = load i32, i32* @GLOB_NOSORT
ret i32 %1
}

LLVM IR (-O2):
@GLOB_NOSORT = global i32 0
define i32 @octave_glob_nosort_wrapper() {
%1 = load i32, i32* @GLOB_NOSORT
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void world(void) { printf("world"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define void @world() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long baz(int, int, void *);
__attribute__((always_)) long foo(int x, int y, void *z) {
  if (y < 0)
    return baz(x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1144 <foo+0x34>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <baz@plt>
mov    %rax,-0x8(%rbp)
jmp    114c <foo+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %esi,%esi
js     1117 <foo+0x7>
xor    %eax,%eax
ret
jmp    1030 <baz@plt>

LLVM IR (-O0):
define i64 @foo(i32 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = call i64 @baz(i32 %11, i32 %12, i8* %13)
store i64 %14, i64* %4
br label %16
15: ; preds = %3
store i64 0, i64* %4
br label %16
16: ; preds = %15, %10
%17 = load i64, i64* %4
ret i64 %17
}

LLVM IR (-O2):
define i64 @foo(i32 %0, i32 %1, i8* %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @baz(i32 %0, i32 %1, i8* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i64 [ %6, %5 ], [ 0, %3 ]
ret i64 %8
}
/* Type definitions */
struct server_list {
  int dummy;
};
struct server {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_append(struct genlist *, struct server *);
void server_list_append(struct server_list *tthis, struct server *pfoo) {
  genlist_append(((struct genlist *)(tthis)), pfoo);
}


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

x86 assembly (clang, -O2):
<server_list_append>:
jmp    1030 <genlist_append@plt>

LLVM IR (-O0):
%struct.server_list = type { i32 }
%struct.server = type { i32 }
%struct.genlist = type { i32 }
define void @server_list_append(%struct.server_list* %0, %struct.server* %1) {
%3 = alloca %struct.server_list*
%4 = alloca %struct.server*
store %struct.server_list* %0, %struct.server_list** %3
store %struct.server* %1, %struct.server** %4
%5 = load %struct.server_list*, %struct.server_list** %3
%6 = bitcast %struct.server_list* %5 to %struct.genlist*
%7 = load %struct.server*, %struct.server** %4
%8 = call i32 @genlist_append(%struct.genlist* %6, %struct.server* %7)
ret void
}

LLVM IR (-O2):
%struct.server_list = type { i32 }
%struct.server = type { i32 }
%struct.genlist = type { i32 }
define void @server_list_append(%struct.server_list* %0, %struct.server* %1) {
%3 = bitcast %struct.server_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_append(%struct.genlist* %3, %struct.server* %1)
ret void
}
/* Variables and functions */
unsigned char *malloc(int);
int /*<<< orphan*/ memset(unsigned char *, unsigned char const, int);
unsigned char *expand_string(const unsigned char *message, int length) {
  unsigned char *temp = malloc(length + 1);
  memset(temp, message[0], length);
  temp[length] = 0x00;
  return temp;
}


x86 assembly (clang, -O0):
<expand_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_string>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movzbl (%r14),%esi
mov    %rax,%rdi
mov    %r15d,%edx
call   1030 <memset@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @expand_string(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 i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i32, i32* %4
%14 = call i32 @memset(i8* %9, i8 zeroext %12, i32 %13)
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @expand_string(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = load i8, i8* %0
%6 = tail call i32 @memset(i8* %4, i8 zeroext %5, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ strcmp(char const *, char *);
int main(void) {
  const char *t = "12";
  const char *u = "<:";
  if (strcmp(t, "1 %:%: 2") || strcmp(u, "<:"))
    abort();
  else
    return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1179 <main+0x59>
mov    -0x18(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1180 <main+0x60>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1151 <main+0x31>
lea    0xec3(%rip),%rdi
mov    %rdi,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1151 <main+0x31>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"12\00"
@.str.1 = [3 x i8] c"<:\00"
@.str.2 = [9 x i8] c"1 %:%: 2\00"
define i32 @main() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret i32 0
}
char *bldlen(str, dest)
char *str, *dest;
{
  int len;
  len = (int)strlen(str);
  if (len > 94)
    *dest = 32;
  else
    *dest = (char)(((len) + 32) & 0xFF);
  strcpy(dest + 1, str);
  return (dest + len + 1);
}


x86 assembly (clang, -O0):
<bldlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5e,-0x14(%rbp)
jle    1152 <bldlen+0x32>
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
jmp    1165 <bldlen+0x45>
mov    -0x14(%rbp),%eax
add    $0x20,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bldlen>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%rbx
add    $0x20,%al
cmp    $0x5f,%ebx
movzbl %al,%eax
mov    $0x20,%ecx
cmovl  %eax,%ecx
mov    %cl,(%r15)
lea    0x1(%r15),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
movslq %ebx,%rax
add    %r15,%rax
add    $0x1,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @bldlen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 94
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %4
store i8 32, i8* %12
br label %19
13: ; preds = %2
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
store i8 %17, i8* %18
br label %19
19: ; preds = %13, %11
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8*, i8** %3
%23 = call i8* @strcpy(i8* %21, i8* %22)
%24 = load i8*, i8** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = getelementptr inbounds i8, i8* %27, i64 1
ret i8* %28
}

LLVM IR (-O2):
define i8* @bldlen(i8* nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = icmp sgt i32 %4, 94
%6 = trunc i64 %3 to i8
%7 = add i8 %6, 32
%8 = select i1 %5, i8 32, i8 %7
store i8 %8, i8* %1
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = tail call i8* @strcpy(i8* %9, i8* dereferenceable(1) %0)
%11 = shl i64 %3, 32
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
ret i8* %14
}
int main(int argc, char **argv __attribute__((unused))) {
  if (argc > 1)
    return 1;
  int a = 1;
  (void)a;
  while (1)
    (void)0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1123 <main+0x23>
mov    $0x1,%eax
pop    %rbp
ret
movl   $0x1,-0x14(%rbp)
jmp    112a <main+0x2a>

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jle    1110 <main+0x10>
mov    $0x1,%eax
ret
nopl   0x0(%rax,%rax,1)
jmp    1110 <main+0x10>

LLVM IR (-O0):
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 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
ret i32 1
10: ; preds = %2
store i32 1, i32* %6
%11 = load i32, i32* %6
br label %12
12: ; preds = %10, %12
br label %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %5
4: ; preds = %2
ret i32 1
5: ; preds = %2, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M906_f(char *s) {
  debug("M906_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M906_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M906_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M906_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M906_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M906_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M906_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_summary(int hits, int misses, int evictions) {
  printf("hits:%d miss:%d evictions:%d\n", hits, misses, evictions);
}


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

x86 assembly (clang, -O2):
<print_summary>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"hits:%d miss:%d evictions:%d\0A\00"
define void @print_summary(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"hits:%d miss:%d evictions:%d\0A\00"
define void @print_summary(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}