xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ KDSETLED;
long get_leds(int);
int ioctl(int, int /*<<< orphan*/, long);
int xor_leds(int console, long int state) {
  return ioctl(console, KDSETLED, (state ^ get_leds(console)) & 7);
}


x86 assembly (clang, -O0):
<xor_leds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_leds@plt>
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
xor    %rax,%rdx
and    $0x7,%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_leds>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb0(%rip),%rax
mov    (%rax),%r14d
call   1030 <get_leds@plt>
xor    %eax,%ebx
and    $0x7,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
@KDSETLED = global i32 0
define i32 @xor_leds(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KDSETLED
%7 = load i64, i64* %4
%8 = load i32, i32* %3
%9 = call i64 @get_leds(i32 %8)
%10 = xor i64 %7, %9
%11 = and i64 %10, 7
%12 = call i32 @ioctl(i32 %5, i32 %6, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
@KDSETLED = global i32 0
define i32 @xor_leds(i32 %0, i64 %1) {
%3 = load i32, i32* @KDSETLED
%4 = tail call i64 @get_leds(i32 %0)
%5 = xor i64 %4, %1
%6 = and i64 %5, 7
%7 = tail call i32 @ioctl(i32 %0, i32 %3, i64 %6)
ret i32 %7
}
int PR10013(void) {
  int *PR10013_x = 0;
  {
    extern int PR10013_x;
    extern int PR10013_x;
  }
  return PR10013_x;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PR10013() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = ptrtoint i32* %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @PR10013() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wg_mpool_print_aux(void *, void *, int /*<<< orphan*/, int);
void wg_mpool_print(void *db, void *ptr) { wg_mpool_print_aux(db, ptr, 0, 1); }


x86 assembly (clang, -O0):
<wg_mpool_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <wg_mpool_print_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wg_mpool_print>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <wg_mpool_print_aux@plt>

LLVM IR (-O0):
define void @wg_mpool_print(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 = call i32 @wg_mpool_print_aux(i8* %5, i8* %6, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @wg_mpool_print(i8* %0, i8* %1) {
%3 = tail call i32 @wg_mpool_print_aux(i8* %0, i8* %1, i32 0, i32 1)
ret void
}
void list() {}


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

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

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

LLVM IR (-O2):
define void @list() {
ret void
}
void rop3_244_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_244_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_244_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
not    %cl
and    %sil,%cl
mov    %edx,%eax
not    %al
and    %cl,%al
or     %dl,%cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_244_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_244_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %1
%7 = or i8 %6, %2
%8 = and i8 %7, %1
%9 = xor i8 %2, -1
%10 = and i8 %6, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
%15 = or i8 %14, %8
store i8 %15, i8* %0
ret void
}
/* Variables and functions */
char *dou2pre(double);
scalar_t__ malloc(int);
double pre2dou(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char in[17] = "0000011100010000";
  double result;
  result = pre2dou(in);
  char *out;
  out = (char *)malloc(sizeof(char) * 33);
  out = dou2pre(result);
  printf("%s\n", out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea5(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <pre2dou@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x21,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <dou2pre@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <pre2dou@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x21,%edi
call   1050 <malloc@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <dou2pre@plt>
lea    0xe90(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.in = [17 x i8] c"0000011100010000\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
%3 = alloca double
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [17 x i8]* %2 to i8*
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%7 = call double @pre2dou(i8* %6)
store double %7, double* %3
%8 = call i64 @malloc(i32 33)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load double, double* %3
%11 = call i8* @dou2pre(double %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.in = [17 x i8] c"0000011100010000\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call double @pre2dou(i8* %2)
%4 = call i64 @malloc(i32 33)
%5 = call i8* @dou2pre(double %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
void posix_class2P_PUNCT() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2P_PUNCT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_ref() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_ref"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_socket_server_ref\0A\00"
define i32 @pa_socket_server_ref() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_socket_server_ref\00"
define i32 @pa_socket_server_ref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, unsigned char);
void unsupported_mode(unsigned char mode) {
  printf("ERROR: Unuspported mode '0x%X'.\n", mode);
  exit(1);
}


x86 assembly (clang, -O0):
<unsupported_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unsupported_mode>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"ERROR: Unuspported mode '0x%X'.\0A\00"
define void @unsupported_mode(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"ERROR: Unuspported mode '0x%X'.\0A\00"
define void @unsupported_mode(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double julian_yyyy_mm_dd_time_hhmm_to_julian(char *, char *);
double date_yyyy_mm_dd_to_julian(char *yyyy_mm_dd) {
  return julian_yyyy_mm_dd_time_hhmm_to_julian(yyyy_mm_dd, "0000");
}


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

x86 assembly (clang, -O2):
<date_yyyy_mm_dd_to_julian>:
lea    0xee9(%rip),%rsi
jmp    1030 <julian_yyyy_mm_dd_time_hhmm_to_julian@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"0000\00"
define double @date_yyyy_mm_dd_to_julian(i8* %0) {
%2 = tail call double @julian_yyyy_mm_dd_time_hhmm_to_julian(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret double %2
}
/* Variables and functions */
int cfg_processor_get_hex_int_attr(void *, char *);
int cfg_flash_get_area_size(void *area) {
  return cfg_processor_get_hex_int_attr(area, "size");
}


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

x86 assembly (clang, -O2):
<cfg_flash_get_area_size>:
lea    0xee9(%rip),%rsi
jmp    1030 <cfg_processor_get_hex_int_attr@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"size\00"
define i32 @cfg_flash_get_area_size(i8* %0) {
%2 = tail call i32 @cfg_processor_get_hex_int_attr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int test_imm_DBint16_mem(short *val) {
  return ((*val) & (0xDB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DBint16_mem>:
testb  $0xdb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 219
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ obj_inspect(void *);
void *obj_new(int);
void *obj_ref(void *);
void *obj_unref(void *);
void _obj_test() {
  void *a = obj_new(sizeof(int));
  void *b = obj_ref(a);
  obj_inspect(a);
  a = obj_unref(a);
  obj_inspect(b);
  a = obj_unref(a);
  obj_inspect(a);
  a = obj_unref(b);
}


x86 assembly (clang, -O0):
<_obj_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <obj_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <obj_ref@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <obj_inspect@plt>
mov    -0x8(%rbp),%rdi
call   1060 <obj_unref@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <obj_inspect@plt>
mov    -0x8(%rbp),%rdi
call   1060 <obj_unref@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <obj_inspect@plt>
mov    -0x10(%rbp),%rdi
call   1060 <obj_unref@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_obj_test>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1040 <obj_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <obj_ref@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <obj_inspect@plt>
mov    %rbx,%rdi
call   1060 <obj_unref@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <obj_inspect@plt>
mov    %rbx,%rdi
call   1060 <obj_unref@plt>
mov    %rax,%rdi
call   1050 <obj_inspect@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <obj_unref@plt>

LLVM IR (-O0):
define void @_obj_test() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @obj_new(i32 4)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @obj_ref(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %1
%7 = call i32 @obj_inspect(i8* %6)
%8 = load i8*, i8** %1
%9 = call i8* @obj_unref(i8* %8)
store i8* %9, i8** %1
%10 = load i8*, i8** %2
%11 = call i32 @obj_inspect(i8* %10)
%12 = load i8*, i8** %1
%13 = call i8* @obj_unref(i8* %12)
store i8* %13, i8** %1
%14 = load i8*, i8** %1
%15 = call i32 @obj_inspect(i8* %14)
%16 = load i8*, i8** %2
%17 = call i8* @obj_unref(i8* %16)
store i8* %17, i8** %1
ret void
}

LLVM IR (-O2):
define void @_obj_test() {
%1 = tail call i8* @obj_new(i32 4)
%2 = tail call i8* @obj_ref(i8* %1)
%3 = tail call i32 @obj_inspect(i8* %1)
%4 = tail call i8* @obj_unref(i8* %1)
%5 = tail call i32 @obj_inspect(i8* %2)
%6 = tail call i8* @obj_unref(i8* %4)
%7 = tail call i32 @obj_inspect(i8* %6)
%8 = tail call i8* @obj_unref(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main1();
int main() {
  main1();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <main1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main1()
ret i32 0
}
void ___dummy___() {}


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

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

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

LLVM IR (-O2):
define void @___dummy___() {
ret void
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
int buf_put(struct buf *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int buf_puts(struct buf *buf, const char *s) {
  return buf_put(buf, (char *)s, strlen(s));
}


x86 assembly (clang, -O0):
<buf_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <buf_put@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <buf_put@plt>

LLVM IR (-O0):
%struct.buf = type { i32 }
define i32 @buf_puts(%struct.buf* %0, i8* %1) {
%3 = alloca %struct.buf*
%4 = alloca i8*
store %struct.buf* %0, %struct.buf** %3
store i8* %1, i8** %4
%5 = load %struct.buf*, %struct.buf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @buf_put(%struct.buf* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define i32 @buf_puts(%struct.buf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buf_put(%struct.buf* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
extern void __error__(char *pcFilename, uint32_t ulLine) { return; }


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

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

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

LLVM IR (-O2):
define void @__error__(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_data_index();
int /*<<< orphan*/ get_mem_name();
char *get_prefix();
int /*<<< orphan*/ sprintf(int /*<<< orphan*/, char *, char *,
                           int /*<<< orphan*/);
void set_item_name() {
  sprintf(get_mem_name(), "%s%d", get_prefix(), get_data_index());
}


x86 assembly (clang, -O0):
<set_item_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <get_mem_name@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <get_prefix@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_data_index@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %eax,%ecx
lea    0xe8c(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_item_name>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <get_mem_name@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <get_prefix@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <get_data_index@plt>
lea    0xe9c(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%d\00"
define void @set_item_name() {
%1 = call i32 (...) @get_mem_name()
%2 = call i8* (...) @get_prefix()
%3 = call i32 (...) @get_data_index()
%4 = call i32 @sprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%d\00"
define void @set_item_name() {
%1 = tail call i32 (...) @get_mem_name()
%2 = tail call i8* (...) @get_prefix()
%3 = tail call i32 (...) @get_data_index()
%4 = tail call i32 @sprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PF_LOCAL;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int bridge_createSocket() {
  int sd = -1;
  if ((sd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) {
    printf("SocketBridge Local Socket Creation Error\n");
  }
  return sd;
}


x86 assembly (clang, -O0):
<bridge_createSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1160 <bridge_createSocket+0x40>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bridge_createSocket>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    114c <bridge_createSocket+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PF_LOCAL = global i32 0
@SOCK_STREAM = global i32 0
@.str = [42 x i8] c"SocketBridge Local Socket Creation Error\0A\00"
define i32 @bridge_createSocket() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* @PF_LOCAL
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@PF_LOCAL = global i32 0
@SOCK_STREAM = global i32 0
@str = [41 x i8] c"SocketBridge Local Socket Creation Error\00"
define i32 @bridge_createSocket() {
%1 = load i32, i32* @PF_LOCAL
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 %3
}
int UI_OwnerDraw_Width(int ownerDraw) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @UI_OwnerDraw_Width(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *concat_string(char const *, char *, char const *, int /*<<< orphan*/ *);
char *dupe_string(char const *);
char *path_join(const char *head, const char *tail) {
  return *head ? concat_string(head, "/", tail, NULL) : dupe_string(tail);
}


x86 assembly (clang, -O0):
<path_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <path_join+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <concat_string@plt>
mov    %rax,-0x18(%rbp)
jmp    116e <path_join+0x4e>
mov    -0x10(%rbp),%rdi
call   1040 <dupe_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_join>:
mov    %rsi,%rdx
cmpb   $0x0,(%rdi)
je     1136 <path_join+0x16>
lea    0xed1(%rip),%rsi
xor    %ecx,%ecx
jmp    1030 <concat_string@plt>
mov    %rdx,%rdi
jmp    1040 <dupe_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @path_join(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* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @concat_string(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %11, i32* null)
br label %16
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i8* @dupe_string(i8* %14)
br label %16
16: ; preds = %13, %9
%17 = phi i8* [ %12, %9 ], [ %15, %13 ]
ret i8* %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @path_join(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @concat_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %1, i32* null)
br label %9
7: ; preds = %2
%8 = tail call i8* @dupe_string(i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ bot_timestamp_seconds(int /*<<< orphan*/);
int /*<<< orphan*/ bot_timestamp_useconds(int /*<<< orphan*/);
void bot_timestamp_to_timeval(int64_t v, struct timeval *tv) {
  tv->tv_sec = bot_timestamp_seconds(v);
  tv->tv_usec = bot_timestamp_useconds(v);
}


x86 assembly (clang, -O0):
<bot_timestamp_to_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bot_timestamp_seconds@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%edi
call   1030 <bot_timestamp_useconds@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_timestamp_to_timeval>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <bot_timestamp_seconds@plt>
mov    %eax,0x4(%rbx)
mov    %ebp,%edi
call   1030 <bot_timestamp_useconds@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @bot_timestamp_to_timeval(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* %3
%6 = call i32 @bot_timestamp_seconds(i32 %5)
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = call i32 @bot_timestamp_useconds(i32 %9)
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @bot_timestamp_to_timeval(i32 %0, %struct.timeval* nocapture writeonly %1) {
%3 = tail call i32 @bot_timestamp_seconds(i32 %0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i32 %3, i32* %4
%5 = tail call i32 @bot_timestamp_useconds(i32 %0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 %5, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
int sys_create_thread(pthread_t *id, void *(*func)(void *), void *args) {
  return pthread_create(id, NULL, func, args);
}


x86 assembly (clang, -O0):
<sys_create_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_create_thread>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <pthread_create@plt>

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

LLVM IR (-O2):
define i32 @sys_create_thread(i32* %0, i8* (i8*)* %1, i8* %2) {
%4 = tail call i32 @pthread_create(i32* %0, i32* null, i8* (i8*)* %1, i8* %2)
ret i32 %4
}
int int_callback() { return 42; }


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

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

LLVM IR (-O0):
define i32 @int_callback() {
ret i32 42
}

LLVM IR (-O2):
define i32 @int_callback() {
ret i32 42
}
/* Type definitions */
struct dm_ioctl {
  int dummy;
};
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int main(void) {
  struct dm_ioctl d;
  (void)d;
  return sizeof(d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int inb(scalar_t__);
void smbus_wait_until_ready(void) {
  while ((inb(0x1000 + 0) & 1) == 1) {
  }
}


x86 assembly (clang, -O0):
<smbus_wait_until_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <smbus_wait_until_ready+0x9>
mov    $0x1000,%edi
call   1030 <inb@plt>
and    $0x1,%eax
cmp    $0x1,%eax
jne    1134 <smbus_wait_until_ready+0x24>
jmp    1119 <smbus_wait_until_ready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_wait_until_ready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1000,%edi
call   1030 <inb@plt>
test   $0x1,%al
jne    1120 <smbus_wait_until_ready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @smbus_wait_until_ready() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @inb(i64 4096)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @smbus_wait_until_ready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @inb(i64 4096)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
int _isdigit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @_isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_udiv() {
  gen_pop();
  gen_call("ccudiv");
}


x86 assembly (clang, -O0):
<gen_udiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_udiv>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ccudiv\00"
define i32 @gen_udiv() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"ccudiv\00"
define i32 @gen_udiv() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init_port();
int /*<<< orphan*/ gpio_setscl_dir(int);
int /*<<< orphan*/ gpio_setsda_dir(int);
void iic_init(void) {
  gpio_init_port();
  gpio_setsda_dir(1);
  gpio_setscl_dir(1);
}


x86 assembly (clang, -O0):
<iic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gpio_init_port@plt>
mov    $0x1,%edi
call   1050 <gpio_setsda_dir@plt>
mov    $0x1,%edi
call   1030 <gpio_setscl_dir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iic_init>:
push   %rax
xor    %eax,%eax
call   1040 <gpio_init_port@plt>
mov    $0x1,%edi
call   1050 <gpio_setsda_dir@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <gpio_setscl_dir@plt>

LLVM IR (-O0):
define void @iic_init() {
%1 = call i32 (...) @gpio_init_port()
%2 = call i32 @gpio_setsda_dir(i32 1)
%3 = call i32 @gpio_setscl_dir(i32 1)
ret void
}

LLVM IR (-O2):
define void @iic_init() {
%1 = tail call i32 (...) @gpio_init_port()
%2 = tail call i32 @gpio_setsda_dir(i32 1)
%3 = tail call i32 @gpio_setscl_dir(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error() {
  fprintf(stderr, "Usage: sampack [-d] [infile] >outfile\n");
  fprintf(stderr, "Sample packer by Georges.Kesseler@restena.lu\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: sampack [-d] [infile] >outfile\0A\00"
@.str.1 = [46 x i8] c"Sample packer by Georges.Kesseler@restena.lu\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: sampack [-d] [infile] >outfile\0A\00"
@.str.1 = [46 x i8] c"Sample packer by Georges.Kesseler@restena.lu\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
void g_queue_push_nth_link() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_push_nth_link() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *stack_pop();
void stack_dot() {
  char *printval = stack_pop();
  if (printval == NULL)
    return;
  printf("%s\n", printval);
}


x86 assembly (clang, -O0):
<stack_dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <stack_pop@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <stack_dot+0x23>
jmp    1153 <stack_dot+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_dot>:
push   %rax
xor    %eax,%eax
call   1040 <stack_pop@plt>
test   %rax,%rax
je     113d <stack_dot+0x1d>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @stack_dot() {
%1 = tail call i8* (...) @stack_pop()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %0, %3
ret void
}
void gtk_clipboard_wait_is_target_available() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_wait_is_target_available() {
ret void
}
void foo_TestFoo2(void *t) {
  int bar = 2;
  int foo = foo_Foo(bar);
  printf("%s: foo=%d t=%p\n", __func__, foo, t);
}


x86 assembly (clang, -O0):
<foo_TestFoo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <foo_Foo@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeb2(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_TestFoo2>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
xor    %eax,%eax
call   1040 <foo_Foo@plt>
lea    0xec9(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    %eax,%edx
mov    %rbx,%rcx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s: foo=%d t=%p\0A\00"
@__func__.foo_TestFoo2 = [13 x i8] c"foo_TestFoo2\00"
define void @foo_TestFoo2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 2, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @foo_Foo to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.foo_TestFoo2, i64 0, i64 0), i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s: foo=%d t=%p\0A\00"
@__func__.foo_TestFoo2 = [13 x i8] c"foo_TestFoo2\00"
define void @foo_TestFoo2(i8* %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_Foo to i32 (i32, ...)*)(i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.foo_TestFoo2, i64 0, i64 0), i32 %2, i8* %0)
ret void
}
void ab8500_regulator_debug_force(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ab8500_regulator_debug_force() {
ret void
}
void sr_location_add_ext(int *line, int *column, int add_line, int add_column) {
  if (add_line > 1) {
    *line += add_line - 1;
    *column = add_column;
  } else
    *column += add_column;
}


x86 assembly (clang, -O0):
<sr_location_add_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1138 <sr_location_add_ext+0x38>
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1143 <sr_location_add_ext+0x43>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_location_add_ext>:
cmp    $0x2,%edx
jl     1111 <sr_location_add_ext+0x11>
mov    (%rdi),%eax
add    %edx,%eax
add    $0xffffffff,%eax
mov    %eax,(%rdi)
mov    %ecx,(%rsi)
ret
add    (%rsi),%ecx
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define void @sr_location_add_ext(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, 1
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = add nsw i32 %2, -1
%8 = load i32, i32* %0
%9 = add nsw i32 %7, %8
store i32 %9, i32* %0
br label %13
10: ; preds = %4
%11 = load i32, i32* %1
%12 = add nsw i32 %11, %3
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %12, %10 ], [ %3, %6 ]
store i32 %14, i32* %1
ret void
}
/* Variables and functions */
long htonl(long);
int /*<<< orphan*/ memcpy(char *, long *, int);
int encode_contentlength(char *hdr, int hdrlen, long int len, char *where) {
  long int longint;
  longint = htonl(len);
  where[0] = sizeof(long int);
  memcpy(&where[1], &longint, sizeof(long int));
  return 1 + sizeof(long int);
}


x86 assembly (clang, -O0):
<encode_contentlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x8,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
lea    -0x28(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    $0x9,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_contentlength>:
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
mov    %rdx,%rdi
call   1030 <htonl@plt>
mov    %rax,0x8(%rsp)
movb   $0x8,(%rbx)
add    $0x1,%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    $0x9,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @encode_contentlength(i8* nocapture readnone %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = tail call i64 @htonl(i64 %2)
store i64 %7, i64* %5
store i8 8, i8* %3
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = call i32 @memcpy(i8* %8, i64* %5, i32 8)
ret i32 9
}
int cmpChar(void *a, void *b) {
  char x = *(char *)a;
  char y = *(char *)b;
  if (x < y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmpChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    113a <cmpChar+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <cmpChar+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpChar>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
setl   %al
ret

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

LLVM IR (-O2):
define i32 @cmpChar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}