xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
uint8_t capture_read_sscape(uint16_t port, void *p) {
  capture_event(p, (0 << 8), 0, port);
  return 0xff;
}


x86 assembly (clang, -O0):
<capture_read_sscape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1030 <capture_event@plt>
mov    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_read_sscape>:
push   %rax
mov    %edi,%ecx
mov    %rsi,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @capture_read_sscape(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 = load i32, i32* %3
%7 = call i32 @capture_event(i8* %5, i32 0, i32 0, i32 %6)
ret i32 255
}

LLVM IR (-O2):
define i32 @capture_read_sscape(i32 %0, i8* %1) {
%3 = tail call i32 @capture_event(i8* %1, i32 0, i32 0, i32 %0)
ret i32 255
}
int test_imm_08int64_lowword_reg(long long val) {
  return ((val) & (0x08 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_08int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 8
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_string(int);
int /*<<< orphan*/ lua_pushobject(int /*<<< orphan*/);
int /*<<< orphan*/ lua_rawgetglobal(int /*<<< orphan*/);
void luaI_rawgetglobal(void) {
  lua_pushobject(lua_rawgetglobal(luaL_check_string(1)));
}


x86 assembly (clang, -O0):
<luaI_rawgetglobal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_string@plt>
mov    %eax,%edi
call   1040 <lua_rawgetglobal@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_rawgetglobal>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_string@plt>
mov    %eax,%edi
call   1040 <lua_rawgetglobal@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushobject@plt>

LLVM IR (-O0):
define void @luaI_rawgetglobal() {
%1 = call i32 @luaL_check_string(i32 1)
%2 = call i32 @lua_rawgetglobal(i32 %1)
%3 = call i32 @lua_pushobject(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaI_rawgetglobal() {
%1 = tail call i32 @luaL_check_string(i32 1)
%2 = tail call i32 @lua_rawgetglobal(i32 %1)
%3 = tail call i32 @lua_pushobject(i32 %2)
ret void
}
/* Variables and functions */
int get_exp(float);
int is_normalized(float f) {
  if (get_exp(f) != 0x00000000 && get_exp(f) != 0x7F800000) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_normalized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <get_exp@plt>
cmp    $0x0,%eax
je     1151 <is_normalized+0x41>
movss  -0x8(%rbp),%xmm0
call   1030 <get_exp@plt>
cmp    $0x7f800000,%eax
je     1151 <is_normalized+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <is_normalized+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_normalized>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <get_exp@plt>
test   %eax,%eax
je     113a <is_normalized+0x2a>
movss  0x4(%rsp),%xmm0
call   1030 <get_exp@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x7f800000,%ecx
jne    113c <is_normalized+0x2c>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_normalized(float %0) {
%2 = tail call i32 @get_exp(float %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @get_exp(float %0)
%6 = icmp eq i32 %5, 2139095040
br i1 %6, label %7, label %8
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ build_max_heap(int *, int);
int /*<<< orphan*/ max_heapify(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ swap(int *, int, int /*<<< orphan*/);
void heap_sort(int *arr, int len) {
  int i;
  build_max_heap(arr, len);
  for (i = len - 1; i >= 1; i--) {
    swap(arr, i, 0);
    max_heapify(arr, i, 0);
  }
}


x86 assembly (clang, -O0):
<heap_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <build_max_heap@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1188 <heap_sort+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1050 <swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <heap_sort+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_sort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <build_max_heap@plt>
cmp    $0x2,%ebx
jl     1173 <heap_sort+0x43>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1050 <swap@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1150 <heap_sort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heap_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @build_max_heap(i32* %6, i32 %7)
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load i32, i32* %5
%13 = icmp sge i32 %12, 1
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = call i32 @swap(i32* %15, i32 %16, i32 0)
%18 = load i32*, i32** %3
%19 = load i32, i32* %5
%20 = call i32 @max_heapify(i32* %18, i32 %19, i32 0)
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @heap_sort(i32* %0, i32 %1) {
%3 = tail call i32 @build_max_heap(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @swap(i32* %0, i32 %7, i32 0)
%9 = tail call i32 @max_heapify(i32* %0, i32 %7, i32 0)
%10 = icmp ugt i32 %6, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string(char *);
void oid_1067(void) { string("IMEI"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"IMEI\00"
define void @oid_1067() {
%1 = tail call i32 @string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_add_new_buffer(struct Screen *);
void cb_new(struct Screen *scrn) { screen_add_new_buffer(scrn); }


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

x86 assembly (clang, -O2):
<cb_new>:
jmp    1030 <screen_add_new_buffer@plt>

LLVM IR (-O0):
%struct.Screen = type { i32 }
define void @cb_new(%struct.Screen* %0) {
%2 = alloca %struct.Screen*
store %struct.Screen* %0, %struct.Screen** %2
%3 = load %struct.Screen*, %struct.Screen** %2
%4 = call i32 @screen_add_new_buffer(%struct.Screen* %3)
ret void
}

LLVM IR (-O2):
%struct.Screen = type { i32 }
define void @cb_new(%struct.Screen* %0) {
%2 = tail call i32 @screen_add_new_buffer(%struct.Screen* %0)
ret void
}
int ft_sqrt(int nb) {
  int i;
  int j;
  int sum;
  i = 1;
  j = 0;
  sum = 0;
  while (sum <= nb) {
    if (sum == nb)
      return (j);
    sum += i;
    i += 2;
    j++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115f <ft_sqrt+0x5f>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113f <ft_sqrt+0x3f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <ft_sqrt+0x66>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <ft_sqrt+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
test   %edi,%edi
js     1120 <ft_sqrt+0x20>
mov    $0x1,%ecx
xor    %edx,%edx
xor    %eax,%eax
nopl   (%rax)
cmp    %edi,%edx
je     1122 <ft_sqrt+0x22>
add    %ecx,%edx
add    $0x2,%ecx
add    $0x1,%eax
cmp    %edi,%edx
jle    1110 <ft_sqrt+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %8
%4 = phi i32 [ %9, %8 ], [ 0, %1 ]
%5 = phi i32 [ %11, %8 ], [ 0, %1 ]
%6 = phi i32 [ %10, %8 ], [ 1, %1 ]
%7 = icmp eq i32 %4, %0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = add nuw nsw i32 %4, %6
%10 = add nuw nsw i32 %6, 2
%11 = add nuw nsw i32 %5, 1
%12 = icmp sgt i32 %9, %0
br i1 %12, label %13, label %3
13: ; preds = %3, %8, %1
%14 = phi i32 [ 0, %1 ], [ 0, %8 ], [ %5, %3 ]
ret i32 %14
}
void k_sti() { asm("sti"); }


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

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

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

LLVM IR (-O2):
define void @k_sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
double P1y_z(double, double, double, double);
double P3y_x(double sign, double xi, double et, double qq) {
  return P1y_z(sign, xi, et, qq);
}


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

x86 assembly (clang, -O2):
<P3y_x>:
jmp    1030 <P1y_z@plt>

LLVM IR (-O0):
define double @P3y_x(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @P1y_z(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @P3y_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @P1y_z(double %0, double %1, double %2, double %3)
ret double %5
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long unixtime() {
  struct timeval tp;
  if (gettimeofday((struct timeval *)&tp, NULL) == 0) {
    return tp.tv_sec;
  }
  return 0;
}


x86 assembly (clang, -O0):
<unixtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jne    113c <unixtime+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <unixtime+0x34>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unixtime>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
jne    112d <unixtime+0x1d>
mov    0x8(%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @unixtime() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %1
br label %9
8: ; preds = %0
store i64 0, i64* %1
br label %9
9: ; preds = %8, %5
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @unixtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = select i1 %4, i64 %6, i64 0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello world!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setMain();
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  setMain();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <setMain@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @setMain()
ret i32 0
}
/* Type definitions */
struct All_variables {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ regional_solver_init(struct All_variables *);
void solver_init(struct All_variables *E) { regional_solver_init(E); }


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

x86 assembly (clang, -O2):
<solver_init>:
jmp    1030 <regional_solver_init@plt>

LLVM IR (-O0):
%struct.All_variables = type { i32 }
define void @solver_init(%struct.All_variables* %0) {
%2 = alloca %struct.All_variables*
store %struct.All_variables* %0, %struct.All_variables** %2
%3 = load %struct.All_variables*, %struct.All_variables** %2
%4 = call i32 @regional_solver_init(%struct.All_variables* %3)
ret void
}

LLVM IR (-O2):
%struct.All_variables = type { i32 }
define void @solver_init(%struct.All_variables* %0) {
%2 = tail call i32 @regional_solver_init(%struct.All_variables* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core7_swap(char *, int);
void U_EMROFFSETCLIPRGN_swap(char *record, int torev) {
  core7_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMROFFSETCLIPRGN_swap>:
jmp    1030 <core7_swap@plt>

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

LLVM IR (-O2):
define void @U_EMROFFSETCLIPRGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret void
}
int addTwo(int bar, int baz) { return bar + baz; }


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

x86 assembly (clang, -O2):
<addTwo>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addTwo(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addTwo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double RAND_MAX;
double rand();
double drand(void) { return rand() / (RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xedd(%rip),%xmm1
mov    0x2ebe(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @drand() {
%1 = call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @drand() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}
int is_am(int idVendor, int idProduct) {
  if (idVendor == 0xfffe)
    return 1;
  if (idVendor == 0x0403 && idProduct == 0x6015)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_am>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffe,-0x8(%rbp)
jne    1123 <is_am+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1150 <is_am+0x50>
cmpl   $0x403,-0x8(%rbp)
jne    1149 <is_am+0x49>
cmpl   $0x6015,-0xc(%rbp)
jne    1149 <is_am+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <is_am+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_am>:
cmp    $0xfffe,%edi
sete   %al
xor    $0x403,%edi
xor    $0x6015,%esi
or     %edi,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_am(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* %4
%7 = icmp eq i32 %6, 65534
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1027
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 24597
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %17
16: ; preds = %12, %9
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_am(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 65534
%4 = icmp eq i32 %0, 1027
%5 = icmp eq i32 %1, 24597
%6 = and i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ LOG_CRIT;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
void __stack_chk_fail() {
  const char message[] = "[%d] stack overflow";
  syslog(LOG_CRIT, message, getpid());
  abort();
}


x86 assembly (clang, -O0):
<__stack_chk_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__stack_chk_fail>:
push   %rbx
sub    $0x20,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x776f6c,0x10(%rsp)
mov    0x2e99(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.__stack_chk_fail.message = [20 x i8] c"[%d] stack overflow\00"
@LOG_CRIT = global i32 0
define void @__stack_chk_fail() {
%1 = alloca [20 x i8]
%2 = bitcast [20 x i8]* %1 to i8*
%3 = load i32, i32* @LOG_CRIT
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 (...) @getpid()
%6 = call i32 @syslog(i32 %3, i8* %4, i32 %5)
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const.__stack_chk_fail.message = [20 x i8] c"[%d] stack overflow\00"
@LOG_CRIT = global i32 0
define void @__stack_chk_fail() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @LOG_CRIT
%4 = tail call i32 (...) @getpid()
%5 = call i32 @syslog(i32 %3, i8* %2, i32 %4)
%6 = call i32 (...) @abort()
unreachable
}
int get_robot_conf(long *conf) {
  conf[0] = conf[0];
  return (1);
}


x86 assembly (clang, -O0):
<get_robot_conf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_robot_conf(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 0
store i64 %5, i64* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @get_robot_conf(i64* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int n) {
  int i;
  for (i = 0; i <= n; i++)
    printf("%d\n", i);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114b <print+0x3b>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
js     1141 <print+0x31>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <print+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void pf_pqos_record(struct _perf_pqos *pqos __attribute__((unused))) {}


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

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

LLVM IR (-O0):
%struct._perf_pqos = type opaque
define void @pf_pqos_record(%struct._perf_pqos* %0) {
%2 = alloca %struct._perf_pqos*
store %struct._perf_pqos* %0, %struct._perf_pqos** %2
ret void
}

LLVM IR (-O2):
%struct._perf_pqos = type opaque
define void @pf_pqos_record(%struct._perf_pqos* nocapture %0) {
ret void
}
void enable_interrupts(void) { __asm__ __volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int __bswap_64(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void int2bin(uint8_t *d, uint64_t a, size_t len, int revert) {
  if (revert == 1)
    a = __bswap_64(a) >> 8 * (8 - len);
  memcpy(d, (uint8_t *)&a, len);
}


x86 assembly (clang, -O0):
<int2bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    115a <int2bin+0x3a>
mov    -0xc(%rbp),%edi
call   1030 <__bswap_64@plt>
mov    $0x8,%ecx
sub    -0x18(%rbp),%rcx
shl    $0x3,%rcx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0xc(%rbp),%rsi
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2bin>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %esi,0x4(%rsp)
cmp    $0x1,%ecx
jne    1149 <int2bin+0x29>
mov    %esi,%edi
call   1030 <__bswap_64@plt>
lea    0x0(,%rbx,8),%ecx
neg    %cl
sar    %cl,%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @int2bin(i32* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %4
%12 = load i32, i32* %6
%13 = call i32 @__bswap_64(i32 %12)
%14 = load i64, i64* %7
%15 = sub i64 8, %14
%16 = mul i64 8, %15
%17 = trunc i64 %16 to i32
%18 = ashr i32 %13, %17
store i32 %18, i32* %6
br label %19
19: ; preds = %11, %4
%20 = load i32*, i32** %5
%21 = load i64, i64* %7
%22 = call i32 @memcpy(i32* %20, i32* %6, i64 %21)
ret void
}

LLVM IR (-O2):
define void @int2bin(i32* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = icmp eq i32 %3, 1
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = tail call i32 @__bswap_64(i32 %1)
%9 = trunc i64 %2 to i32
%10 = mul i32 %9, -8
%11 = add i32 %10, 64
%12 = ashr i32 %8, %11
store i32 %12, i32* %5
br label %13
13: ; preds = %7, %4
%14 = call i32 @memcpy(i32* %0, i32* %5, i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ read(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int is_open(int fd) { return (read(fd, NULL, 0)) ? 0 : -1; }


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

x86 assembly (clang, -O2):
<is_open>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1030 <read@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_open(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @read(i32 %3, i32* null, i32 0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 -1
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_open(i32 %0) {
%2 = tail call i64 @read(i32 %0, i32* null, i32 0)
%3 = icmp eq i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int x = 100;
  printf("dec = %d; octal = %o; hex = %x\n", x, x, x);
  printf("dec = %d; octal = %#o; hex = %#x\n", x, x, x);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [34 x i8] c"dec = %d; octal = %#o; hex = %#x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [34 x i8] c"dec = %d; octal = %#o; hex = %#x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 100, i32 100, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 100, i32 100)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
int uffs_GetTrivialVersion(int ver) { return (ver & 0xff00) >> 8; }


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

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

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

LLVM IR (-O2):
define i32 @uffs_GetTrivialVersion(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void RCC_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @RCC_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @RCC_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ milliSleep(int);
void iDelay(int ms) { milliSleep(ms); }


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

x86 assembly (clang, -O2):
<iDelay>:
jmp    1030 <milliSleep@plt>

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

LLVM IR (-O2):
define void @iDelay(i32 %0) {
%2 = tail call i32 @milliSleep(i32 %0)
ret void
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
int stat(char const *const, struct stat *);
long fsize(const char *const name) {
  struct stat stbuf;
  return (stat(name, &stbuf) == -1) ? -1 : stbuf.st_size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1142 <fsize+0x32>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <fsize+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
cmp    $0xffffffff,%ecx
je     112b <fsize+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @fsize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%10 = load i64, i64* %9
br label %11
11: ; preds = %8, %7
%12 = phi i64 [ -1, %7 ], [ %10, %8 ]
ret i64 %12
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @fsize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 -1, i64 %7
ret i64 %8
}
void troca(int *valor1, int *valor2) {
  int tmp = *valor1;
  *valor1 = *valor2;
  *valor2 = tmp;
}


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

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

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

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void SetZeroMsTime(struct MillisecTime *makeZero) {}


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

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

LLVM IR (-O0):
%struct.MillisecTime = type opaque
define void @SetZeroMsTime(%struct.MillisecTime* %0) {
%2 = alloca %struct.MillisecTime*
store %struct.MillisecTime* %0, %struct.MillisecTime** %2
ret void
}

LLVM IR (-O2):
%struct.MillisecTime = type opaque
define void @SetZeroMsTime(%struct.MillisecTime* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ microseconds();
double seconds(void) { return (double)microseconds() / 1.0e6; }


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <microseconds@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
push   %rax
xor    %eax,%eax
call   1030 <microseconds@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @seconds() {
%1 = call i64 (...) @microseconds()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+06
ret double %3
}

LLVM IR (-O2):
define double @seconds() {
%1 = tail call i64 (...) @microseconds()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+06
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct qcow_state {
  int dummy;
};

/* Variables and functions */
int qcow_no_refcount(struct qcow_state *s, uint64_t cluster_offset,
                     uint64_t value) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.qcow_state = type { i32 }
define i32 @qcow_no_refcount(%struct.qcow_state* %0, i32 %1, i32 %2) {
%4 = alloca %struct.qcow_state*
%5 = alloca i32
%6 = alloca i32
store %struct.qcow_state* %0, %struct.qcow_state** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.qcow_state = type { i32 }
define i32 @qcow_no_refcount(%struct.qcow_state* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
fle(x) long long int x;
{
  if (x <= 0)
    return 13;
  else
    return 140;
}


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

x86 assembly (clang, -O2):
<fle>:
test   %rdi,%rdi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fle(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sle i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 13, i32* %2
br label %8
7: ; preds = %1
store i32 140, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fle(i64 %0) {
%2 = icmp slt i64 %0, 1
%3 = select i1 %2, i32 13, i32 140
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: number [# ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: number [# ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: number [# ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ wfunc();
void f2() { wfunc(); }


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

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

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

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 (...) @wfunc()
ret void
}
int isIdeographicCharacter(unsigned char character) { return 0; }


x86 assembly (clang, -O0):
<isIdeographicCharacter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isIdeographicCharacter(i8 zeroext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outport(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/, int);
pacing(int fdSer) {
  int opcode;
  opcode = 14;
  outport(fdSer, 0, 0, 0, 0, opcode);
}


x86 assembly (clang, -O0):
<pacing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0xe,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%r9d
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <outport@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pacing>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0xe,%r9d
jmp    1030 <outport@plt>

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

LLVM IR (-O2):
define i32 @pacing(i32 %0) {
%2 = tail call i32 @outport(i32 %0, i32 0, i32 0, i32 0, i32 0, i32 14)
ret i32 undef
}
void XtCvtStringToCursor() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @Counter_3_RestoreConfig() {
ret void
}
/* Variables and functions */
int scmp(char *, char *);
int CompareVocabTie(long long count1, long long count2, char *word1,
                    char *word2) {
  long long c;
  if ((c = count2 - count1) != 0)
    return (c > 0 ? 1 : -1);
  else
    return (scmp(word1, word2));
}


x86 assembly (clang, -O0):
<CompareVocabTie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     115b <CompareVocabTie+0x4b>
mov    -0x30(%rbp),%rdx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <CompareVocabTie+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <scmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareVocabTie>:
sub    %rdi,%rsi
je     1123 <CompareVocabTie+0x13>
xor    %eax,%eax
test   %rsi,%rsi
setg   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret
mov    %rdx,%rdi
mov    %rcx,%rsi
jmp    1030 <scmp@plt>

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

LLVM IR (-O2):
define i32 @CompareVocabTie(i64 %0, i64 %1, i8* %2, i8* %3) {
%5 = sub nsw i64 %1, %0
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = icmp sgt i64 %5, 0
%9 = select i1 %8, i32 1, i32 -1
br label %12
10: ; preds = %4
%11 = tail call i32 @scmp(i8* %2, i8* %3)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}