xunge/DecIR huggingface dataset:
int test_imm_69uint16_reg(unsigned short val) {
  return ((val) & (0x69 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_69uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 105
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int transport_close(int sock) {
  int rc = 1;
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @transport_close(i32 %0) {
ret i32 1
}
void __attribute__((__no_instrument_function__))
__cyg_profile_func_exit(void *this_func, void *call_site) {
  printf("%s: func = %p, called by = %p\n", __FUNCTION__, this_func, call_site);
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s: func = %p, called by = %p\0A\00"
@__FUNCTION__.__cyg_profile_func_exit = [24 x i8] c"__cyg_profile_func_exit\00"
define void @__cyg_profile_func_exit(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 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.__cyg_profile_func_exit, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s: func = %p, called by = %p\0A\00"
@__FUNCTION__.__cyg_profile_func_exit = [24 x i8] c"__cyg_profile_func_exit\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.__cyg_profile_func_exit, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t geteuid(void) { return 6005; }


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

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

LLVM IR (-O0):
define i32 @geteuid() {
ret i32 6005
}

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 6005
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_greater_d(int *, double, double);
int xil_fpo_greater_d(double a, double b) {
  int res_int;
  xip_fpo_greater_d(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_greater_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x14(%rbp),%rdi
call   1030 <xip_fpo_greater_d@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_greater_d>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_greater_d@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xil_fpo_greater_d(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_greater_d(i32* %3, double %0, double %1)
%6 = load i32, i32* %3
ret i32 %6
}
__attribute__((visibility("hidden"))) int is_composite(int symbology) {
  return symbology >= 130 && symbology <= 139;
}


x86 assembly (clang, -O0):
<is_composite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x82,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <is_composite+0x26>
cmpl   $0x8b,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_composite>:
add    $0xffffff7e,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define hidden i32 @is_composite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 130
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 139
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define hidden i32 @is_composite(i32 %0) {
%2 = add i32 %0, -130
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void gdk_screen_make_display_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_make_display_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_set_sleep_radio() {
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (10 << 9) | (10 << 5) | (5)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (10 << 9) | (10 << 5) | (5)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (2 << 5) | (5)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_set_sleep_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd545,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd545,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc445,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_sleep_radio>:
push   %rax
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd545,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd545,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc445,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_set_sleep_radio() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54597)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54597)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50245)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_set_sleep_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54597)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54597)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50245)
%6 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
int main(int argc, char **argv) {
  printf("%d %s %s \n", argc, argv[0], argv[1]);
  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)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    (%rsi),%rdx
mov    0x8(%rsi),%rcx
lea    0xedf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d %s %s \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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %9, i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %s %s \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3, i8* %5)
ret i32 0
}
_Bool Long_mask(long a, long b) { return a & b; }


x86 assembly (clang, -O0):
<Long_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Long_mask>:
test   %rdi,%rsi
setne  %al
ret

LLVM IR (-O0):
define zeroext i1 @Long_mask(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = and i64 %5, %6
%8 = icmp ne i64 %7, 0
ret i1 %8
}

LLVM IR (-O2):
define zeroext i1 @Long_mask(i64 %0, i64 %1) {
%3 = and i64 %1, %0
%4 = icmp ne i64 %3, 0
ret i1 %4
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_varcharcopyfunc(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_varcharcopyfunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_varcharcopyfunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
int raimundo(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<raimundo>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @raimundo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void foo097() {}


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

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

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

LLVM IR (-O2):
define void @foo097() {
ret void
}
/* Variables and functions */
bool utf8_conti(char byte) {
  if ((byte & 0x80) && !(byte & 0x40))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<utf8_conti>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1138 <utf8_conti+0x38>
movsbl -0x5(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    1138 <utf8_conti+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <utf8_conti+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_conti>:
and    $0xc0,%dil
xor    %eax,%eax
cmp    $0x80,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @utf8_conti(i8 signext %0) {
%2 = and i8 %0, -64
%3 = icmp eq i8 %2, -128
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned short GET_UAA16LE(unsigned short *, int /*<<< orphan*/);
unsigned short LE16(unsigned short x) { return GET_UAA16LE(&x, 0); }


x86 assembly (clang, -O0):
<LE16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA16LE@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LE16>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA16LE@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @LE16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call zeroext i16 @GET_UAA16LE(i16* %2, i32 0)
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @LE16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call zeroext i16 @GET_UAA16LE(i16* %2, i32 0)
ret i16 %3
}
void __attribute__((__always___)) kol_paint_end() {
  asm volatile("int $0x40" ::"a"(12), "b"(2));
}


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

x86 assembly (clang, -O2):
<kol_paint_end>:
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_paint_end() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 12, i32 2)
ret void
}
void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info) {
}


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

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

LLVM IR (-O0):
%struct.rk29fb_screen = type opaque
%struct.rk29lcd_info = type opaque
define void @set_lcd_info(%struct.rk29fb_screen* %0, %struct.rk29lcd_info* %1) {
%3 = alloca %struct.rk29fb_screen*
%4 = alloca %struct.rk29lcd_info*
store %struct.rk29fb_screen* %0, %struct.rk29fb_screen** %3
store %struct.rk29lcd_info* %1, %struct.rk29lcd_info** %4
ret void
}

LLVM IR (-O2):
%struct.rk29fb_screen = type opaque
%struct.rk29lcd_info = type opaque
define void @set_lcd_info(%struct.rk29fb_screen* nocapture %0, %struct.rk29lcd_info* nocapture %1) {
ret void
}
/* Variables and functions */
int PerformInternalTest();
int RVS_InternalTest() { return PerformInternalTest(); }


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

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

LLVM IR (-O0):
define i32 @RVS_InternalTest() {
%1 = call i32 (...) @PerformInternalTest()
ret i32 %1
}

LLVM IR (-O2):
define i32 @RVS_InternalTest() {
%1 = tail call i32 (...) @PerformInternalTest()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ endTerm();
void Sys_End() { endTerm(); }


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

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

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

LLVM IR (-O2):
define void @Sys_End() {
%1 = tail call i32 (...) @endTerm()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
void dumpLine(FILE *stream) {
  int c;
  while ((c = getc(stream)) != EOF && c != '\n')
    ;
}


x86 assembly (clang, -O0):
<dumpLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eb5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xd(%rbp)
je     1148 <dumpLine+0x38>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1158 <dumpLine+0x48>
jmp    115d <dumpLine+0x4d>
jmp    111c <dumpLine+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1132 <dumpLine+0x22>
cmp    (%r14),%eax
jne    1120 <dumpLine+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @dumpLine(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %9, %4
%13 = phi i1 [ false, %4 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @dumpLine(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *path_basename(char const *);
char *path_dirname(char const *);
char *xsprintf(char *, char *, char const *);
char *tmp_filename(const char *filename) {
  char *tmp, *dir = path_dirname(filename);
  const char *base = path_basename(filename);
  tmp = xsprintf("%s/.tmp.%s.XXXXXX", dir, base);
  free(dir);
  return tmp;
}


x86 assembly (clang, -O0):
<tmp_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <path_dirname@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <path_basename@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe8b(%rip),%rdi
call   1060 <xsprintf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmp_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <path_dirname@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <path_basename@plt>
lea    0xea2(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1060 <xsprintf@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s/.tmp.%s.XXXXXX\00"
define i8* @tmp_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @path_dirname(i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %2
%9 = call i8* @path_basename(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i8* @xsprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s/.tmp.%s.XXXXXX\00"
define i8* @tmp_filename(i8* %0) {
%2 = tail call i8* @path_dirname(i8* %0)
%3 = tail call i8* @path_basename(i8* %0)
%4 = tail call i8* @xsprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
/* Variables and functions */
int unlink(char *);
int main(void) {
  int status;
  status = unlink("/tmp/foo");
  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 <unlink@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"/tmp/foo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/tmp/foo\00"
define i32 @main() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clean(int);
int target2(int fd) {
  clean(fd);
  return -5;
}


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

x86 assembly (clang, -O2):
<target2>:
push   %rax
call   1030 <clean@plt>
mov    $0xfffffffb,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @target2(i32 %0) {
%2 = tail call i32 @clean(i32 %0)
ret i32 -5
}
/* Variables and functions */
double Sub(double, double);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double result = Sub(3.0, 2.0);
  printf("Result = %f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  0xec2(%rip),%xmm1
call   1040 <Sub@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <Sub@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Result = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call double @Sub(double 3.000000e+00, double 2.000000e+00)
store double %7, double* %6
%8 = load double, double* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Result = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @Sub(double 3.000000e+00, double 2.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void main(int argc, char *argv[]) {
  system("date");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
@EXIT_SUCCESS = global i32 0
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
@EXIT_SUCCESS = global i32 0
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 5, b = 8;
  printf("a: %d, b: %d\n", a, b);
  swap(&a, &b);
  printf("a: %d, b: %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
movl   $0x8,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a: %d, b: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 8, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 8)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
void native_init_IRQ(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @hw_waitforindex() {
ret void
}
/* Variables and functions */
int _random_int_func(int, int);
int AMCRandomInt(int min, int max) { return _random_int_func(min, max); }


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

x86 assembly (clang, -O2):
<AMCRandomInt>:
jmp    1030 <_random_int_func@plt>

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

LLVM IR (-O2):
define i32 @AMCRandomInt(i32 %0, i32 %1) {
%3 = tail call i32 @_random_int_func(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ FlipEndian(void *, int);
float FLIP_FLOAT(float pVar) {
  return *(float *)FlipEndian((void *)&pVar, sizeof(float));
}


x86 assembly (clang, -O0):
<FLIP_FLOAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <FlipEndian@plt>
movss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLIP_FLOAT>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <FlipEndian@plt>
movss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @FLIP_FLOAT(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 4)
%5 = inttoptr i64 %4 to float*
%6 = load float, float* %5
ret float %6
}

LLVM IR (-O2):
define float @FLIP_FLOAT(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 4)
%5 = inttoptr i64 %4 to float*
%6 = load float, float* %5
ret float %6
}
/* Variables and functions */
int __getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar(void) { return __getc(stdin); }


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @__getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @__getc(i32 %1)
ret i32 %2
}
/* Variables and functions */
double fmod(double, int);
double SKNormalizeAngle(double x) {
  x = fmod(x + 3.14159265358979323846, 2 * 3.14159265358979323846);
  if (x < 0) {
    x += 2 * 3.14159265358979323846;
  }
  return x - 3.14159265358979323846;
}


x86 assembly (clang, -O0):
<SKNormalizeAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    $0x6,%edi
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1159 <SKNormalizeAngle+0x49>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SKNormalizeAngle>:
push   %rax
addsd  0xee7(%rip),%xmm0
mov    $0x6,%edi
call   1030 <fmod@plt>
movsd  0xedd(%rip),%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
addsd  0xec0(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SKNormalizeAngle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x400921FB54442D18
%5 = call double @fmod(double %4, i32 6)
store double %5, double* %2
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = fadd double %9, 0x401921FB54442D18
store double %10, double* %2
br label %11
11: ; preds = %8, %1
%12 = load double, double* %2
%13 = fsub double %12, 0x400921FB54442D18
ret double %13
}

LLVM IR (-O2):
define double @SKNormalizeAngle(double %0) {
%2 = fadd double %0, 0x400921FB54442D18
%3 = tail call double @fmod(double %2, i32 6)
%4 = fcmp olt double %3, 0.000000e+00
%5 = fadd double %3, 0x401921FB54442D18
%6 = select i1 %4, double %5, double %3
%7 = fadd double %6, 0xC00921FB54442D18
ret double %7
}
int executeSum(int *a, int b) {
  *a = 10;
  return *a + b;
}


x86 assembly (clang, -O0):
<executeSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeSum>:
movl   $0xa,(%rdi)
lea    0xa(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @executeSum(i32* nocapture writeonly %0, i32 %1) {
store i32 10, i32* %0
%3 = add nsw i32 %1, 10
ret i32 %3
}
void ShowNume(int n, void (*prt)(int)) { (*prt)(n); }


x86 assembly (clang, -O0):
<ShowNume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowNume>:
jmp    *%rsi

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

LLVM IR (-O2):
define void @ShowNume(i32 %0, void (i32)* nocapture %1) {
tail call void %1(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
__attribute__((always_)) void SCB_InvalidateDCache_by_Addr(void *addr,
                                                           int32_t dsize) {}


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

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

LLVM IR (-O0):
define void @SCB_InvalidateDCache_by_Addr(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 @SCB_InvalidateDCache_by_Addr(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help01(void) {
  printf("  +  <num1> <num2>  add and subtract <num1> and <num2>\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c" + <num1> <num2> add and subtract <num1> and <num2>\0A\00"
define void @help01() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c" + <num1> <num2> add and subtract <num1> and <num2>\00"
define void @help01() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closeCameraDevice(void *);
void CloseCamera(void *v4l2ctx) { closeCameraDevice(v4l2ctx); }


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

x86 assembly (clang, -O2):
<CloseCamera>:
jmp    1030 <closeCameraDevice@plt>

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

LLVM IR (-O2):
define void @CloseCamera(i8* %0) {
%2 = tail call i32 @closeCameraDevice(i8* %0)
ret void
}
int hash(int value) {
  if (value < 1000) {
    return value;
  }
  while (value >= 1000) {
    if (value < 10000) {
      value = value - 1000;
    } else {
      if (value < 100000) {
        value = value - 10000;
      } else {
        value = value - 100000;
      }
    }
  }
  return value;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    111f <hash+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hash+0x86>
jmp    1124 <hash+0x24>
cmpl   $0x3e8,-0x8(%rbp)
jl     1180 <hash+0x80>
cmpl   $0x2710,-0x8(%rbp)
jge    114e <hash+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x3e8,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <hash+0x7b>
cmpl   $0x186a0,-0x8(%rbp)
jge    116b <hash+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x2710,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <hash+0x76>
mov    -0x8(%rbp),%eax
sub    $0x186a0,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <hash+0x7b>
jmp    1124 <hash+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
cmp    $0x3e8,%edi
jge    110b <hash+0xb>
ret
mov    $0xfffffc18,%ecx
jmp    1131 <hash+0x31>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2710,%eax
cmovb  %ecx,%edx
add    %edx,%eax
cmp    $0x3e7,%eax
jbe    110a <hash+0xa>
mov    $0xffffd8f0,%edx
cmp    $0x186a0,%eax
jb     1120 <hash+0x20>
mov    $0xfffe7960,%edx
jmp    1120 <hash+0x20>

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %31
8: ; preds = %1
br label %9
9: ; preds = %28, %8
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 1000
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 10000
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1000
store i32 %17, i32* %3
br label %28
18: ; preds = %12
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 100000
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 10000
store i32 %23, i32* %3
br label %27
24: ; preds = %18
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 100000
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %15
br label %9
29: ; preds = %9
%30 = load i32, i32* %3
store i32 %30, i32* %2
br label %31
31: ; preds = %29, %6
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = icmp slt i32 %0, 1000
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = icmp ult i32 %4, 10000
%6 = icmp ult i32 %4, 100000
%7 = select i1 %6, i32 -10000, i32 -100000
%8 = select i1 %5, i32 -1000, i32 %7
%9 = add nsw i32 %4, %8
%10 = icmp ugt i32 %9, 999
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ %0, %1 ], [ %9, %3 ]
ret i32 %12
}
/* Variables and functions */
int memcmp(unsigned char const *, unsigned char const *, int);
int bytecmp(const void *a, int alen, const void *b, int blen) {
  const unsigned char *a_bytes = a;
  const unsigned char *b_bytes = b;
  if (alen != blen)
    return (alen > blen ? 1 : -1);
  return memcmp(a_bytes, b_bytes, alen);
}


x86 assembly (clang, -O0):
<bytecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     115f <bytecmp+0x4f>
mov    -0x14(%rbp),%edx
mov    -0x24(%rbp),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <bytecmp+0x62>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecmp>:
cmp    %ecx,%esi
jne    1120 <bytecmp+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <memcmp@plt>
setg   %al
movzbl %al,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bytecmp(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = icmp sgt i32 %1, %3
%8 = select i1 %7, i32 1, i32 -1
br label %11
9: ; preds = %4
%10 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %1)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int set_continuation_parameters(double *c) {
  int *a, *b, fail;
  fail = _ada_use_c2phc4c(73, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<set_continuation_parameters>:
mov    %rdi,%rcx
mov    $0x49,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @set_continuation_parameters(double* %0) {
%2 = alloca double*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store double* %0, double** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = load double*, double** %2
%9 = call i32 @_ada_use_c2phc4c(i32 73, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_continuation_parameters(double* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 73, i32* undef, i32* undef, double* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
char *chaz_CC_build_lib_filename(char const *, char *, char const *,
                                 char const *, char *);
char *chaz_CC_export_filename(const char *dir, const char *basename,
                              const char *version) {
  return chaz_CC_build_lib_filename(dir, "", basename, version, ".exp");
}


x86 assembly (clang, -O0):
<chaz_CC_export_filename>:
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
lea    0xecd(%rip),%rsi
lea    0xec2(%rip),%r8
call   1030 <chaz_CC_build_lib_filename@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_CC_export_filename>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee7(%rip),%rsi
lea    0xedc(%rip),%r8
jmp    1030 <chaz_CC_build_lib_filename@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c".exp\00"
define i8* @chaz_CC_export_filename(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @chaz_CC_build_lib_filename(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c".exp\00"
define i8* @chaz_CC_export_filename(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @chaz_CC_build_lib_filename(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}
/* Type definitions */
struct cgts_ts_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cgts_ts_packet *);
void cgts_ts_packet_free(struct cgts_ts_packet *tsp) { free(tsp); }


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

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

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

LLVM IR (-O2):
%struct.cgts_ts_packet = type { i32 }
define void @cgts_ts_packet_free(%struct.cgts_ts_packet* nocapture %0) {
%2 = tail call i32 @free(%struct.cgts_ts_packet* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buffer_test();
int /*<<< orphan*/ klunk_context_test();
int /*<<< orphan*/ klunk_param_llist_test();
int /*<<< orphan*/ klunk_param_test();
int /*<<< orphan*/ klunk_request_test();
int /*<<< orphan*/ llist_test();
int main(void) {
  llist_test();
  buffer_test();
  klunk_param_test();
  klunk_param_llist_test();
  klunk_request_test();
  klunk_context_test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <llist_test@plt>
mov    $0x0,%al
call   1080 <buffer_test@plt>
mov    $0x0,%al
call   1070 <klunk_param_test@plt>
mov    $0x0,%al
call   1060 <klunk_param_llist_test@plt>
mov    $0x0,%al
call   1040 <klunk_request_test@plt>
mov    $0x0,%al
call   1030 <klunk_context_test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <llist_test@plt>
xor    %eax,%eax
call   1080 <buffer_test@plt>
xor    %eax,%eax
call   1070 <klunk_param_test@plt>
xor    %eax,%eax
call   1060 <klunk_param_llist_test@plt>
xor    %eax,%eax
call   1040 <klunk_request_test@plt>
xor    %eax,%eax
call   1030 <klunk_context_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @llist_test()
%2 = call i32 (...) @buffer_test()
%3 = call i32 (...) @klunk_param_test()
%4 = call i32 (...) @klunk_param_llist_test()
%5 = call i32 (...) @klunk_request_test()
%6 = call i32 (...) @klunk_context_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @llist_test()
%2 = tail call i32 (...) @buffer_test()
%3 = tail call i32 (...) @klunk_param_test()
%4 = tail call i32 (...) @klunk_param_llist_test()
%5 = tail call i32 (...) @klunk_request_test()
%6 = tail call i32 (...) @klunk_context_test()
ret i32 0
}