xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_reply_method_errno(void *call, int error, const void *e) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_reply_method_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_reply_method_errno>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_reply_method_errno(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_reply_method_errno(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
void store_barrier() { asm volatile("sfence\n\t"); }


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

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

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

LLVM IR (-O2):
define void @store_barrier() {
tail call void asm sideeffect "sfence\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int do_592() { return 592; }


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

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

LLVM IR (-O0):
define i32 @do_592() {
ret i32 592
}

LLVM IR (-O2):
define i32 @do_592() {
ret i32 592
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int yylex();
int yylexcustom() {
  int token = yylex();
  printf("token %d \n", token);
  return token;
}


x86 assembly (clang, -O0):
<yylexcustom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <yylex@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yylexcustom>:
push   %rbx
xor    %eax,%eax
call   1040 <yylex@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"token %d \0A\00"
define i32 @yylexcustom() {
%1 = alloca i32
%2 = call i32 (...) @yylex()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [11 x i8] c"token %d \0A\00"
define i32 @yylexcustom() {
%1 = tail call i32 (...) @yylex()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_compression_mode_pg(struct list_head *);
uint8_t clear_default_comp(struct list_head *l) {
  ;
  return clear_compression_mode_pg(l);
}


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

x86 assembly (clang, -O2):
<clear_default_comp>:
jmp    1030 <clear_compression_mode_pg@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @clear_default_comp(%struct.list_head* %0) {
%2 = tail call i32 @clear_compression_mode_pg(%struct.list_head* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ clearok(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ touchwin(int /*<<< orphan*/);
void redraw_screen(void) {
  clearok(stdscr, TRUE);
  touchwin(stdscr);
}


x86 assembly (clang, -O0):
<redraw_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <clearok@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <touchwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw_screen>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1030 <clearok@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <touchwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @redraw_screen() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = call i32 @clearok(i32 %1, i32 %2)
%4 = load i32, i32* @stdscr
%5 = call i32 @touchwin(i32 %4)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @redraw_screen() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = tail call i32 @clearok(i32 %1, i32 %2)
%4 = load i32, i32* @stdscr
%5 = tail call i32 @touchwin(i32 %4)
ret void
}
int bitOr(int a, int b) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ uwsgi_lock_ipcsem(struct uwsgi_lock_item *);
void uwsgi_wlock_ipcsem(struct uwsgi_lock_item *uli) { uwsgi_lock_ipcsem(uli); }


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

x86 assembly (clang, -O2):
<uwsgi_wlock_ipcsem>:
jmp    1030 <uwsgi_lock_ipcsem@plt>

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

LLVM IR (-O2):
%struct.uwsgi_lock_item = type { i32 }
define void @uwsgi_wlock_ipcsem(%struct.uwsgi_lock_item* %0) {
%2 = tail call i32 @uwsgi_lock_ipcsem(%struct.uwsgi_lock_item* %0)
ret void
}
float validation(char *val) {}


x86 assembly (clang, -O0):
<validation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @validation(i8* %0) {
%2 = alloca float
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load float, float* %2
ret float %4
}

LLVM IR (-O2):
define float @validation(i8* nocapture readnone %0) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setupterm(char *, int /*<<< orphan*/, int *);
int /*<<< orphan*/ stdout;
int main() {
  setupterm("unlisted", fileno(stdout), (int *)0);
  printf("Done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setupterm@plt>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <setupterm@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"unlisted\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fileno(i32 %2)
%4 = call i32 @setupterm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"unlisted\00"
@stdout = global i32 0
@str = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fileno(i32 %1)
%3 = tail call i32 @setupterm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32* null)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void cmp_reg32_reg32(int reg1, int reg2) {
  put8(0x39);
  put8((reg2 << 3) | reg1 | 0xC0);
}


x86 assembly (clang, -O0):
<cmp_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x39,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     -0x4(%rbp),%edi
or     $0xc0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_reg32_reg32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x39,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_reg32_reg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 57)
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = load i32, i32* %3
%9 = or i32 %7, %8
%10 = or i32 %9, 192
%11 = call i32 @put8(i32 %10)
ret void
}

LLVM IR (-O2):
define void @cmp_reg32_reg32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 57)
%4 = shl i32 %1, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @put8(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _free_stack();
void css_eval_stop() { _free_stack(); }


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

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

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

LLVM IR (-O2):
define void @css_eval_stop() {
%1 = tail call i32 (...) @_free_stack()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, ...);
void Move_Ret_To_Foreign_L(int index) {
  Inst_Printf("la", "$13,pl_foreign_long");
  Inst_Printf("sw", "$2,%d($13)", index * 4);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Foreign_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
mov    -0x4(%rbp),%edx
shl    $0x2,%edx
lea    0xeda(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Foreign_L>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
shl    $0x2,%ebx
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"la\00"
@.str.1 = [20 x i8] c"$13,pl_foreign_long\00"
@.str.2 = [3 x i8] c"sw\00"
@.str.3 = [11 x i8] c"$2,%d($13)\00"
define void @Move_Ret_To_Foreign_L(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
%6 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"la\00"
@.str.1 = [20 x i8] c"$13,pl_foreign_long\00"
@.str.2 = [3 x i8] c"sw\00"
@.str.3 = [11 x i8] c"$2,%d($13)\00"
define void @Move_Ret_To_Foreign_L(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = shl nsw i32 %0, 2
%4 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
float test_nexttowardf(float x, float y) { return __builtin_nexttowardf(x, y); }


x86 assembly (clang, -O0):
<test_nexttowardf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
flds   -0x8(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nexttowardf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nexttowardf>:
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
flds   0x14(%rsp)
fstpt  (%rsp)
call   1030 <nexttowardf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @test_nexttowardf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fpext float %6 to x86_fp80
%8 = call float @nexttowardf(float %5, x86_fp80 %7)
ret float %8
}

LLVM IR (-O2):
define float @test_nexttowardf(float %0, float %1) {
%3 = fpext float %1 to x86_fp80
%4 = tail call float @nexttowardf(float %0, x86_fp80 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ bubble(int *, int);
void bubbleSort(int arr[], int n) {
  int i = 0;
  for (i = n; i >= 1; i--) {
    bubble(arr, i);
  }
}


x86 assembly (clang, -O0):
<bubbleSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1150 <bubbleSort+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <bubble@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <bubbleSort+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bubbleSort>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <bubbleSort+0x24>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <bubble@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1120 <bubbleSort+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @bubbleSort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @bubble(i32* %0, i32 %5)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
short Synthese_Checksum(short *Statu_checksum) {
  short synthese = 0;
  short i = 0;
  for (i = 0; i < 12 - 1; i++) {
    synthese = synthese + Statu_checksum[i];
  }
  return synthese;
}


x86 assembly (clang, -O0):
<Synthese_Checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
movw   $0x0,-0xc(%rbp)
movswl -0xc(%rbp),%eax
cmp    $0xb,%eax
jge    114f <Synthese_Checksum+0x4f>
movswl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movswq -0xc(%rbp),%rdx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    111a <Synthese_Checksum+0x1a>
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Synthese_Checksum>:
movdqu 0x6(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddw  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddw  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
paddw  %xmm0,%xmm1
movd   %xmm1,%eax
add    0x4(%rdi),%ax
add    0x2(%rdi),%ax
add    (%rdi),%ax
ret

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

LLVM IR (-O2):
define signext i16 @Synthese_Checksum(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = getelementptr inbounds i16, i16* %0, i64 2
%6 = load i16, i16* %5
%7 = getelementptr inbounds i16, i16* %0, i64 3
%8 = bitcast i16* %7 to <8 x i16>*
%9 = load <8 x i16>, <8 x i16>* %8
%10 = call i16 @llvm.vector.reduce.add.v8i16(<8 x i16> %9)
%11 = add i16 %10, %6
%12 = add i16 %11, %4
%13 = add i16 %12, %2
ret i16 %13
}
int wpa_debug_open_linux_tracing(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @wpa_debug_open_linux_tracing() {
ret i32 0
}

LLVM IR (-O2):
define i32 @wpa_debug_open_linux_tracing() {
ret i32 0
}
int main(int argc, const char *argv[]) {
  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  double b[10] = {0, 0.1, 0.2, 0.3, 0.4, 5.0, 5.1, 5.2, 8, 9};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xecc(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xee4(%rip),%rsi
mov    $0x50,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.main.b = [10 x double] [double 0.000000e+00, double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e+00, double 5.100000e+00, double 5.200000e+00, double 8.000000e+00, double 9.000000e+00]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
%7 = alloca [10 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i32]* %6 to i8*
%9 = bitcast [10 x double]* %7 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bind_reset();
int /*<<< orphan*/ close_reset();
int /*<<< orphan*/ listen_reset();
int /*<<< orphan*/ net_dont_block_reset();
int /*<<< orphan*/ net_reuse_addr_reset();
int /*<<< orphan*/ read_reset();
int /*<<< orphan*/ socket_reset();
void reset_fakes(void) {
  { socket_reset(); };
  { bind_reset(); };
  { listen_reset(); };
  { close_reset(); };
  { net_dont_block_reset(); };
  { net_reuse_addr_reset(); };
  { read_reset(); };
}


x86 assembly (clang, -O0):
<reset_fakes>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <socket_reset@plt>
mov    $0x0,%al
call   1080 <bind_reset@plt>
mov    $0x0,%al
call   1090 <listen_reset@plt>
mov    $0x0,%al
call   1030 <close_reset@plt>
mov    $0x0,%al
call   1040 <net_dont_block_reset@plt>
mov    $0x0,%al
call   1060 <net_reuse_addr_reset@plt>
mov    $0x0,%al
call   1050 <read_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_fakes>:
push   %rax
xor    %eax,%eax
call   1070 <socket_reset@plt>
xor    %eax,%eax
call   1080 <bind_reset@plt>
xor    %eax,%eax
call   1090 <listen_reset@plt>
xor    %eax,%eax
call   1030 <close_reset@plt>
xor    %eax,%eax
call   1040 <net_dont_block_reset@plt>
xor    %eax,%eax
call   1060 <net_reuse_addr_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <read_reset@plt>

LLVM IR (-O0):
define void @reset_fakes() {
%1 = call i32 (...) @socket_reset()
%2 = call i32 (...) @bind_reset()
%3 = call i32 (...) @listen_reset()
%4 = call i32 (...) @close_reset()
%5 = call i32 (...) @net_dont_block_reset()
%6 = call i32 (...) @net_reuse_addr_reset()
%7 = call i32 (...) @read_reset()
ret void
}

LLVM IR (-O2):
define void @reset_fakes() {
%1 = tail call i32 (...) @socket_reset()
%2 = tail call i32 (...) @bind_reset()
%3 = tail call i32 (...) @listen_reset()
%4 = tail call i32 (...) @close_reset()
%5 = tail call i32 (...) @net_dont_block_reset()
%6 = tail call i32 (...) @net_reuse_addr_reset()
%7 = tail call i32 (...) @read_reset()
ret void
}
/* Variables and functions */
int strlen(char *);
void removeCarriageReturn(char *buffer) {
  if (buffer[strlen(buffer) - 1] == '\n') {
    buffer[strlen(buffer) - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<removeCarriageReturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1167 <removeCarriageReturn+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeCarriageReturn>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1131 <removeCarriageReturn+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @removeCarriageReturn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8*, i8** %2
%15 = call i32 @strlen(i8* %14)
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @removeCarriageReturn(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret void
}
/* Variables and functions */
int fdatasync(int);
int test(void) {
  int fd;
  int result;
  fd = 4;
  result = fdatasync(fd);
  return result;
}


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

x86 assembly (clang, -O2):
<test>:
mov    $0x4,%edi
jmp    1030 <fdatasync@plt>

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @fdatasync(i32 4)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ integer(int);
int /*<<< orphan*/ pass_str(char *);
int main() {
  integer(25);
  pass_str("hi there dude!");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x19,%edi
call   1030 <integer@plt>
lea    0xece(%rip),%rdi
call   1040 <pass_str@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hi there dude!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @integer(i32 25)
%3 = call i32 @pass_str(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"hi there dude!\00"
define i32 @main() {
%1 = tail call i32 @integer(i32 25)
%2 = tail call i32 @pass_str(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
uint8_t direct_check8(volatile uint8_t *addr, uint8_t dat) {
  return ((*addr & dat) ? 1 : 0);
}


x86 assembly (clang, -O0):
<direct_check8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_check8>:
mov    %esi,-0x4(%rsp)
mov    (%rdi),%ecx
xor    %eax,%eax
and    -0x4(%rsp),%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @direct_check8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load volatile i32, i32* %5
%7 = load volatile i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @direct_check8(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %0
%5 = load volatile i32, i32* %3
%6 = and i32 %5, %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch;
  scanf("%c", &ch);
  printf("%c %d\n", ch, ch);
  printf("%c %d\n", ch - 32, ch - 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x5(%rbp),%al
lea    0xeba(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
sub    $0x20,%eax
mov    %al,%cl
movsbl -0x5(%rbp),%eax
sub    $0x20,%eax
lea    0xe97(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%edx
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
mov    %edx,%esi
call   1030 <printf@plt>
mov    0xf(%rsp),%al
add    $0xe0,%al
movsbl %al,%edx
mov    %rbx,%rdi
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %4, i8 signext %5)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 32
%10 = trunc i32 %9 to i8
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 32
%14 = trunc i32 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %3, i8 signext %3)
%5 = load i8, i8* %1
%6 = add i8 %5, -32
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %6, i8 signext %6)
ret i32 0
}
void *test_anti_range_55(unsigned n) {
  extern void *alloc_anti_range_55(unsigned) __attribute__((alloc_size(1)));
  if ((0x7fffffff * 2U + 1) - 1 <= n && n <= (0x7fffffff * 2U + 1) - 1)
    n = (0x7fffffff * 2U + 1) - 1 - 1;
  return alloc_anti_range_55(n);
}


x86 assembly (clang, -O0):
<test_anti_range_55>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xfffffffe,%eax
cmp    -0x4(%rbp),%eax
ja     113a <test_anti_range_55+0x2a>
cmpl   $0xfffffffe,-0x4(%rbp)
ja     113a <test_anti_range_55+0x2a>
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_55@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_55>:
cmp    $0xfffffffe,%edi
mov    $0xfffffffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_55@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_55(i32 %0) {
%2 = icmp eq i32 %0, -2
%3 = select i1 %2, i32 -3, i32 %0
%4 = tail call i8* @alloc_anti_range_55(i32 %3)
ret i8* %4
}
int testfunc_03(int a, int b, int c, int d) {
  return (a != b && a != d) ? b : c;
}


x86 assembly (clang, -O0):
<testfunc_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1133 <testfunc_03+0x33>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1133 <testfunc_03+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <testfunc_03+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_03>:
cmp    %ecx,%edi
mov    %esi,%eax
cmove  %edx,%eax
cmp    %esi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @testfunc_03(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* %5
%10 = load i32, i32* %6
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %8
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12, %4
%19 = load i32, i32* %7
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @testfunc_03(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = icmp eq i32 %0, %3
%7 = or i1 %5, %6
%8 = select i1 %7, i32 %2, i32 %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ AltitudeHoldStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AltitudeHoldStatusRequestUpdate() {
  UAVObjRequestUpdate(AltitudeHoldStatusHandle());
}


x86 assembly (clang, -O0):
<AltitudeHoldStatusRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AltitudeHoldStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AltitudeHoldStatusRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AltitudeHoldStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AltitudeHoldStatusRequestUpdate() {
%1 = call i32 (...) @AltitudeHoldStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AltitudeHoldStatusRequestUpdate() {
%1 = tail call i32 (...) @AltitudeHoldStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int select_col0_by_row(int row) { return row / 9; }


x86 assembly (clang, -O0):
<select_col0_by_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_col0_by_row>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @select_col0_by_row(i32 %0) {
%2 = sdiv i32 %0, 9
ret i32 %2
}
int test_imm_3Fuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x3F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Fuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 63
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void opendcp_log_print_message(void *arg, const char *msg) {
  ((void)(arg));
  fprintf(stdout, "%s\n", msg);
}


x86 assembly (clang, -O0):
<opendcp_log_print_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendcp_log_print_message>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @opendcp_log_print_message(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 i32, i32* @stdout
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @opendcp_log_print_message(i8* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(char const *, int, int);
void check_misc(const char *str) { check(str, false, false); }


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

x86 assembly (clang, -O2):
<check_misc>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <check@plt>

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

LLVM IR (-O2):
define void @check_misc(i8* %0) {
%2 = tail call i32 @check(i8* %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_objects(int /*<<< orphan*/);
int main(int argc, char **argv) {
  for (size_t i = 0; i < 100; i++) {
    create_objects(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)
movq   $0x0,-0x18(%rbp)
cmpq   $0x64,-0x18(%rbp)
jae    1151 <main+0x41>
xor    %edi,%edi
call   1030 <create_objects@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112e <main+0x1e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <create_objects@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %7, %4 ]
%6 = tail call i32 @create_objects(i32 0)
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, 100
br i1 %8, label %3, label %4
}
/* Variables and functions */
int random();
int alea(int count) { return random() % count; }


x86 assembly (clang, -O0):
<alea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alea>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @alea(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, %0
ret i32 %3
}
void __wrap_free(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @__wrap_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_string(char *);
int main() { print_string("hello, world"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add();
int /*<<< orphan*/ compute_rhs();
int /*<<< orphan*/ x_solve();
int /*<<< orphan*/ y_solve();
int /*<<< orphan*/ z_solve();
void adi(void) {
  compute_rhs();
  x_solve();
  y_solve();
  z_solve();
  add();
}


x86 assembly (clang, -O0):
<adi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <compute_rhs@plt>
mov    $0x0,%al
call   1060 <x_solve@plt>
mov    $0x0,%al
call   1050 <y_solve@plt>
mov    $0x0,%al
call   1070 <z_solve@plt>
mov    $0x0,%al
call   1030 <add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adi>:
push   %rax
xor    %eax,%eax
call   1040 <compute_rhs@plt>
xor    %eax,%eax
call   1060 <x_solve@plt>
xor    %eax,%eax
call   1050 <y_solve@plt>
xor    %eax,%eax
call   1070 <z_solve@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <add@plt>

LLVM IR (-O0):
define void @adi() {
%1 = call i32 (...) @compute_rhs()
%2 = call i32 (...) @x_solve()
%3 = call i32 (...) @y_solve()
%4 = call i32 (...) @z_solve()
%5 = call i32 (...) @add()
ret void
}

LLVM IR (-O2):
define void @adi() {
%1 = tail call i32 (...) @compute_rhs()
%2 = tail call i32 (...) @x_solve()
%3 = tail call i32 (...) @y_solve()
%4 = tail call i32 (...) @z_solve()
%5 = tail call i32 (...) @add()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yldisp_hide_all();
int /*<<< orphan*/ yp_ml_remove_event(int, int);
void yldisp_clear() {
  yp_ml_remove_event(-1, 20);
  yp_ml_remove_event(-1, 21);
  yldisp_hide_all();
}


x86 assembly (clang, -O0):
<yldisp_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x14,%esi
call   1040 <yp_ml_remove_event@plt>
mov    $0xffffffff,%edi
mov    $0x15,%esi
call   1040 <yp_ml_remove_event@plt>
mov    $0x0,%al
call   1030 <yldisp_hide_all@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yldisp_clear>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x14,%esi
call   1040 <yp_ml_remove_event@plt>
mov    $0xffffffff,%edi
mov    $0x15,%esi
call   1040 <yp_ml_remove_event@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <yldisp_hide_all@plt>

LLVM IR (-O0):
define void @yldisp_clear() {
%1 = call i32 @yp_ml_remove_event(i32 -1, i32 20)
%2 = call i32 @yp_ml_remove_event(i32 -1, i32 21)
%3 = call i32 (...) @yldisp_hide_all()
ret void
}

LLVM IR (-O2):
define void @yldisp_clear() {
%1 = tail call i32 @yp_ml_remove_event(i32 -1, i32 20)
%2 = tail call i32 @yp_ml_remove_event(i32 -1, i32 21)
%3 = tail call i32 (...) @yldisp_hide_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writememw65816(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ zeropagex();
void stzZpx16(void) { writememw65816(zeropagex(), 0); }


x86 assembly (clang, -O0):
<stzZpx16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <zeropagex@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <writememw65816@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stzZpx16>:
push   %rax
xor    %eax,%eax
call   1040 <zeropagex@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <writememw65816@plt>

LLVM IR (-O0):
define void @stzZpx16() {
%1 = call i32 (...) @zeropagex()
%2 = call i32 @writememw65816(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stzZpx16() {
%1 = tail call i32 (...) @zeropagex()
%2 = tail call i32 @writememw65816(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int /*<<< orphan*/, int *, int *, int *, int *);
char *cpuidVendorName(char *name) {
  int a, b, c, d;
  cpuid(0, &a, &b, &c, &d);
  *((int *)&name[0]) = b;
  *((int *)&name[4]) = d;
  *((int *)&name[8]) = c;
  name[12] = '\0';
  return name;
}


x86 assembly (clang, -O0):
<cpuidVendorName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0xc(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuidVendorName>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
xor    %edi,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
mov    (%rsp),%eax
mov    %eax,0x4(%rbx)
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rbx)
movb   $0x0,0xc(%rbx)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @cpuidVendorName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = call i32 @cpuid(i32 0, i32* %3, i32* %4, i32* %5, i32* %6)
%8 = load i32, i32* %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = bitcast i8* %10 to i32*
store i32 %8, i32* %11
%12 = load i32, i32* %6
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 4
%15 = bitcast i8* %14 to i32*
store i32 %12, i32* %15
%16 = load i32, i32* %5
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 8
%19 = bitcast i8* %18 to i32*
store i32 %16, i32* %19
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 12
store i8 0, i8* %21
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @cpuidVendorName(i8* returned writeonly %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @cpuid(i32 0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %3
%12 = bitcast i8* %0 to i32*
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds i8, i8* %0, i64 4
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
%16 = load i32, i32* %4
%17 = getelementptr inbounds i8, i8* %0, i64 8
%18 = bitcast i8* %17 to i32*
store i32 %16, i32* %18
%19 = getelementptr inbounds i8, i8* %0, i64 12
store i8 0, i8* %19
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtp2435q_set_mbz(uint8_t *header, uint8_t mbz) { header[0] = mbz; }


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

x86 assembly (clang, -O2):
<rtp2435q_set_mbz>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @rtp2435q_set_mbz(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}