xunge/DecIR huggingface dataset:
/* Variables and functions */
char tolower(char);
void lowercase(char *text) {
  char *ptr;
  for (ptr = text; *ptr != '\000'; ptr++)
    *ptr = tolower(*ptr);
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <lowercase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <lowercase+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lowercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowercase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @lowercase(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 = %15, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call signext i8 @tolower(i8 signext %12)
%14 = load i8*, i8** %3
store i8 %13, i8* %14
br label %15
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
unsigned long get_time_now() {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<get_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0xc(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i64 @get_time_now() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i64 @get_time_now() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %11, %8
%13 = sext i32 %12 to i64
ret i64 %13
}
const char *deviceIOExpanderGetName(void) { return "IO EXPANDER"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"IO EXPANDER\00"
define i8* @deviceIOExpanderGetName() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"IO EXPANDER\00"
define i8* @deviceIOExpanderGetName() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void XtRemoveSignal() {}


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

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

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

LLVM IR (-O2):
define void @XtRemoveSignal() {
ret void
}
void foo77() {}


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

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

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

LLVM IR (-O2):
define void @foo77() {
ret void
}
int az_num_waves_at_once_for_wave(int wave) {
  if (wave >= 20)
    return 4;
  else if (wave >= 10)
    return 3;
  else
    return 2;
}


x86 assembly (clang, -O0):
<az_num_waves_at_once_for_wave>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jl     111d <az_num_waves_at_once_for_wave+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    113a <az_num_waves_at_once_for_wave+0x3a>
cmpl   $0xa,-0x8(%rbp)
jl     1133 <az_num_waves_at_once_for_wave+0x33>
movl   $0x3,-0x4(%rbp)
jmp    113a <az_num_waves_at_once_for_wave+0x3a>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_num_waves_at_once_for_wave>:
xor    %ecx,%ecx
cmp    $0xa,%edi
setge  %cl
or     $0x2,%ecx
cmp    $0x14,%edi
mov    $0x4,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @az_num_waves_at_once_for_wave(i32 %0) {
%2 = icmp sgt i32 %0, 19
%3 = icmp sgt i32 %0, 9
%4 = select i1 %3, i32 3, i32 2
%5 = select i1 %2, i32 4, i32 %4
ret i32 %5
}
void sk_membar_acquire__after_atomic_dec() {}


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

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

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

LLVM IR (-O2):
define void @sk_membar_acquire__after_atomic_dec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
mult() { ol("imull %edx"); }


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"imull %edx\00"
define i32 @mult() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [11 x i8] c"imull %edx\00"
define i32 @mult() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
extern int __attribute__((always_)) gui_ksys_get_key(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(2));
  return (value);
}


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

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

LLVM IR (-O0):
define i32 @gui_ksys_get_key() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_get_key() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 2)
ret i32 %1
}
struct object *prim_list(void *workspace, struct object *args) {
  return (args);
}


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

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

LLVM IR (-O0):
%struct.object = type opaque
define %struct.object* @prim_list(i8* %0, %struct.object* %1) {
%3 = alloca i8*
%4 = alloca %struct.object*
store i8* %0, i8** %3
store %struct.object* %1, %struct.object** %4
%5 = load %struct.object*, %struct.object** %4
ret %struct.object* %5
}

LLVM IR (-O2):
%struct.object = type opaque
define %struct.object* @prim_list(i8* nocapture readnone %0, %struct.object* readnone returned %1) {
ret %struct.object* %1
}
insspace(f, n) int f, n;
{
  linsert(n, ' ', 1);
  backchar(f, n);
}


x86 assembly (clang, -O0):
<insspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x20,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <linsert@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <backchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insspace>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x20,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <linsert@plt>
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <backchar@plt>

LLVM IR (-O0):
define i32 @insspace(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @linsert to i32 (i32, i32, i32, ...)*)(i32 %6, i32 32, i32 1)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @backchar to i32 (i32, i32, ...)*)(i32 %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @insspace(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @linsert to i32 (i32, i32, i32, ...)*)(i32 %1, i32 32, i32 1)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @backchar to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ putenv(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strdup(char *);
void set_environment(char *environment, char *datum) {
  char statement[4096];
  sprintf(statement, "%s=%s", environment, datum);
  putenv(strdup(statement));
}


x86 assembly (clang, -O0):
<set_environment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x1010(%rbp),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1030 <putenv@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_environment>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xebb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1030 <putenv@plt>
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s=%s\00"
define void @set_environment(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [4096 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%11 = call i32 @strdup(i8* %10)
%12 = call i32 @putenv(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s=%s\00"
define void @set_environment(i8* %0, i8* %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @strdup(i8* %4)
%7 = call i32 @putenv(i32 %6)
ret void
}
int d_eq_mm2(double *a1, double *a2) { return !(((*a1) == (*a2))); }


x86 assembly (clang, -O0):
<d_eq_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_mm2>:
movsd  (%rsi),%xmm0
cmpneqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_mm2(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* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oeq double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_eq_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ cvtColor(int const, int const, int const, int const,
                            int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
void pencil_cvtColor(const int rows, const int cols, const int src_step,
                     const int dst_step, const uint8_t src[], uint8_t dst[]) {
  cvtColor(rows, cols, src_step, dst_step, src, dst);
}


x86 assembly (clang, -O0):
<pencil_cvtColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <cvtColor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pencil_cvtColor>:
jmp    1030 <cvtColor@plt>

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

LLVM IR (-O2):
define void @pencil_cvtColor(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = tail call i32 @cvtColor(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5)
ret void
}
int setBit(int in, int index) { return (in | (0x1 << index)); }


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

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

LLVM IR (-O0):
define i32 @setBit(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 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setBit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
void gtk_tree_view_row_activated() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_row_activated() {
ret void
}
int main(void) {
  int x;
  int y = x ? 2 : 4;
  int z = x || y;
  if (x && y) {
    return 0;
  } else {
    return 1;
  }
  if (x && y || z) {
    x++;
    y++;
    z++;
    x++;
    y++;
    return z;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x4,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    113a <main+0x3a>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1165 <main+0x65>
cmpl   $0x0,-0xc(%rbp)
je     1165 <main+0x65>
movl   $0x0,-0x4(%rbp)
jmp    116c <main+0x6c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void writePipe(char *s, int pipe) { write(pipe, s, strlen(s)); }


x86 assembly (clang, -O0):
<writePipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%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):
<writePipe>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
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):
define void @writePipe(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @writePipe(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
int g(int p) {
  p = 100;
  return 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x64,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 1
}
/* Type definitions */
struct pot {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ecs_mixdown(char *);
char *scene_file(struct pot *);
void cmd_mixdown(struct pot *pot) {
  char *ecs = scene_file(pot);
  ecs_mixdown(ecs);
}


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

x86 assembly (clang, -O2):
<cmd_mixdown>:
push   %rax
call   1040 <scene_file@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <ecs_mixdown@plt>

LLVM IR (-O0):
%struct.pot = type { i32 }
define void @cmd_mixdown(%struct.pot* %0) {
%2 = alloca %struct.pot*
%3 = alloca i8*
store %struct.pot* %0, %struct.pot** %2
%4 = load %struct.pot*, %struct.pot** %2
%5 = call i8* @scene_file(%struct.pot* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ecs_mixdown(i8* %6)
ret void
}

LLVM IR (-O2):
%struct.pot = type { i32 }
define void @cmd_mixdown(%struct.pot* %0) {
%2 = tail call i8* @scene_file(%struct.pot* %0)
%3 = tail call i32 @ecs_mixdown(i8* %2)
ret void
}
int git_skip_dos_drive_prefix(char **path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @git_skip_dos_drive_prefix(i8** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ nocbreak();
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
void CRT_disableDelay() {
  nocbreak();
  cbreak();
  nodelay(stdscr, TRUE);
}


x86 assembly (clang, -O0):
<CRT_disableDelay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <nocbreak@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1040 <nodelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRT_disableDelay>:
push   %rax
xor    %eax,%eax
call   1050 <nocbreak@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1040 <nodelay@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @CRT_disableDelay() {
%1 = call i32 (...) @nocbreak()
%2 = call i32 (...) @cbreak()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @nodelay(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @CRT_disableDelay() {
%1 = tail call i32 (...) @nocbreak()
%2 = tail call i32 (...) @cbreak()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @nodelay(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
char strcmp(char *s1, char *s2) {
  for (; *s1 == *s2; s1++, s2++)
    if (*s1 == '\0')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115d <strcmp+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113b <strcmp+0x3b>
movb   $0x0,-0x1(%rbp)
jmp    1161 <strcmp+0x61>
jmp    1140 <strcmp+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%cl
mov    $0x1,%al
cmp    (%rsi),%cl
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <strcmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <strcmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i8 [ 1, %2 ], [ 1, %11 ], [ 0, %6 ]
ret i8 %18
}
/* Variables and functions */
double exp2(double);
int myexp2(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  double x, y;
  x = 3.0;
  y = exp2(x);
  printf("2^%d = %d\n", (int)x, (int)y);
  printf("2^%d = %d\n", 8, myexp2(8));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <exp2@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x10(%rbp),%esi
cvttsd2si -0x18(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1050 <myexp2@plt>
mov    %eax,%edx
lea    0xe84(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <myexp2@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"2^%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 3.000000e+00, double* %2
%4 = load double, double* %2
%5 = call double @exp2(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = fptosi double %6 to i32
%8 = load double, double* %3
%9 = fptosi double %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = call i32 @myexp2(i32 8)
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 8, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"2^%d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 8)
%2 = tail call i32 @myexp2(i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 8, i32 %2)
ret i32 0
}
/* Variables and functions */
double __ocml_erfcx_f64(double);
double erfcx(double x) { return __ocml_erfcx_f64(x); }


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

x86 assembly (clang, -O2):
<erfcx>:
jmp    1030 <__ocml_erfcx_f64@plt>

LLVM IR (-O0):
define double @erfcx(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__ocml_erfcx_f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @erfcx(double %0) {
%2 = tail call double @__ocml_erfcx_f64(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int fib(int /*<<< orphan*/);
int /*<<< orphan*/ parseInt(char *);
__attribute__((used)) __attribute__((visibility("default"))) int
main(int args, char *argv[]) {
  uint32_t n = parseInt(argv[1]);
  return fib(n);
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <parseInt@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fib@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <parseInt@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fib@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i8**)* @main to i8*)], section "llvm.metadata"
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 i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @parseInt(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @fib(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i8**)* @main to i8*)], section "llvm.metadata"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @parseInt(i8* %4)
%6 = tail call i32 @fib(i32 %5)
ret i32 %6
}
long long int min(long long int a, long long int b) { return a <= b ? a : b; }


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

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

LLVM IR (-O0):
define i64 @min(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 = load i64, i64* %4
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ __close(int);
int /*<<< orphan*/ __set_errno(int);
int errno;
void do_close(int s) {
  int save;
  save = errno;
  __close(s);
  __set_errno(save);
}


x86 assembly (clang, -O0):
<do_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <__close@plt>
mov    -0x8(%rbp),%edi
call   1030 <__set_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_close>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1040 <__close@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <__set_errno@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @do_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @__close(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @__set_errno(i32 %7)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_close(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @__close(i32 %0)
%4 = tail call i32 @__set_errno(i32 %2)
ret void
}
int __attribute__((no)) loop_next(int *p_table, char *p_table_head) {
  static int loop_next = 0;
  if (loop_next == 1)
    return 1;
  loop_next = 1;
  return 0;
}


x86 assembly (clang, -O0):
<loop_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x1,0x2f11(%rip)
jne    1125 <loop_next+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1136 <loop_next+0x36>
movl   $0x1,0x2ef5(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_next>:
mov    $0x1,%eax
cmpb   $0x0,0x2f18(%rip)
jne    1117 <loop_next+0x17>
movb   $0x1,0x2f0f(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@loop_next.loop_next = internal global i32 0
define i32 @loop_next(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i32, i32* @loop_next.loop_next
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %10
9: ; preds = %2
store i32 1, i32* @loop_next.loop_next
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@loop_next.loop_next = internal unnamed_addr global i1 false
define i32 @loop_next(i32* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i1, i1* @loop_next.loop_next
br i1 %3, label %5, label %4
4: ; preds = %2
store i1 true, i1* @loop_next.loop_next
br label %5
5: ; preds = %2, %4
%6 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %6
}
void fc178(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
  a : {
    typedef int(*g)[n];
    0;
  };
    goto a;
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc178>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc178+0x7>

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

LLVM IR (-O0):
define void @fc178(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
br label %13
13: ; preds = %13, %1
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %13
16: ; No predecessors!
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc178(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
double ceil(double);
double floor(double);
double dround(double x) { return (x < 0) ? ceil(x - 0.5) : floor(x + 0.5); }


x86 assembly (clang, -O0):
<dround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    115b <dround+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1172 <dround+0x52>
movsd  0xe9d(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dround>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1137 <dround+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @dround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fsub double %6, 5.000000e-01
%8 = call double @llvm.ceil.f64(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fadd double %10, 5.000000e-01
%12 = call double @llvm.floor.f64(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi double [ %8, %5 ], [ %12, %9 ]
ret double %14
}

LLVM IR (-O2):
define double @dround(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, -5.000000e-01
%5 = tail call double @llvm.ceil.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, 5.000000e-01
%8 = tail call double @llvm.floor.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
/* Variables and functions */
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int right_rot(void) { return write_block(110, 0, 0, 0); }


x86 assembly (clang, -O0):
<right_rot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6e,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_rot>:
mov    $0x6e,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @right_rot() {
%1 = call i32 @write_block(i32 110, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @right_rot() {
%1 = tail call i32 @write_block(i32 110, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t uint32ToUint16(uint32_t x) {
  uint16_t y = x;
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @uint32ToUint16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void uart_puts(const char *str) { printf("UART: %s", str); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"UART: %s\00"
define void @uart_puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int f479(int *);
int f480(int *p) { return f479(p); }


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

x86 assembly (clang, -O2):
<f480>:
jmp    1030 <f479@plt>

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

LLVM IR (-O2):
define i32 @f480(i32* %0) {
%2 = tail call i32 @f479(i32* %0)
ret i32 %2
}
/* Type definitions */
struct ambapp_apb_info {
  int dummy;
};

/* Variables and functions */
int find_apbslvs_next(int, int, struct ambapp_apb_info *, int /*<<< orphan*/,
                      int);
int find_apbslv(int vendor, int device, struct ambapp_apb_info *dev) {
  return find_apbslvs_next(vendor, device, dev, 0, 1);
}


x86 assembly (clang, -O0):
<find_apbslv>:
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),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <find_apbslvs_next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_apbslv>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <find_apbslvs_next@plt>

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

LLVM IR (-O2):
%struct.ambapp_apb_info = type { i32 }
define i32 @find_apbslv(i32 %0, i32 %1, %struct.ambapp_apb_info* %2) {
%4 = tail call i32 @find_apbslvs_next(i32 %0, i32 %1, %struct.ambapp_apb_info* %2, i32 0, i32 1)
ret i32 %4
}
int aa_tree_data_compare_default(const void *l, const void *r) {
  return (l < r) ? -1 : (r < l);
}


x86 assembly (clang, -O0):
<aa_tree_data_compare_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <aa_tree_data_compare_default+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <aa_tree_data_compare_default+0x3a>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @aa_tree_data_compare_default(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ult i8* %1, %0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
void Interp1(uint32_t *pc, uint32_t c1, uint32_t c2) {
  *pc = Interpolate_2(c1, 3, c2, 1, 2);
}


x86 assembly (clang, -O0):
<Interp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    $0x3,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1030 <Interpolate_2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp1>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    $0x3,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1030 <Interpolate_2@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Interp1(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* %5
%8 = load i32, i32* %6
%9 = call i32 @Interpolate_2(i32 %7, i32 3, i32 %8, i32 1, i32 2)
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @Interp1(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_2(i32 %1, i32 3, i32 %2, i32 1, i32 2)
store i32 %4, i32* %0
ret void
}
void *krealloc(void *addr, int nbytes) {}


x86 assembly (clang, -O0):
<krealloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @krealloc(i8* nocapture readnone %0, i32 %1) {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int closedir(DIR *dirp) {
  (void)dirp;
  puts("closedir: not implemented");
  return -1;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"closedir: not implemented\00"
define i32 @closedir(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [26 x i8] c"closedir: not implemented\00"
define i32 @closedir(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void UART1WriteChar(int ch0) {
  while (!((*((volatile unsigned char *)0xE0010014)) & 0x00000020))
    ;
  (*((volatile unsigned char *)0xE0010000)) = ch0;
}


x86 assembly (clang, -O0):
<UART1WriteChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe0010014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <UART1WriteChar+0x29>
jmp    112e <UART1WriteChar+0x2e>
jmp    1107 <UART1WriteChar+0x7>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0xe0010000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART1WriteChar>:
mov    $0xe0010000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x20,0x14(%rax)
je     1110 <UART1WriteChar+0x10>
mov    %dil,(%rax)
ret

LLVM IR (-O0):
define void @UART1WriteChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 3758161940 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 3758161920 to i8*)
ret void
}

LLVM IR (-O2):
define void @UART1WriteChar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 3758161940 to i8*)
%4 = and i8 %3, 32
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = trunc i32 %0 to i8
store volatile i8 %7, i8* inttoptr (i64 3758161920 to i8*)
ret void
}
void test45_Test10_targetInit__I() {}


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

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

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

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