xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv, char **envp) {
  while (*envp != NULL)
    printf("%s\n", *envp++);
  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)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     115d <main+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <main+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%rsi
test   %rsi,%rsi
je     1144 <main+0x34>
mov    %rdx,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
br label %8
8: ; preds = %12, %3
%9 = load i8**, i8*** %7
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8**, i8*** %7
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %7
%15 = load i8*, i8** %13
%16 = ptrtoint i8* %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %8
18: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %13, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %2, %3 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = ptrtoint i8* %7 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %9
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %3
ret i32 0
}
void populateAliens(void) {}


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

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

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

LLVM IR (-O2):
define void @populateAliens() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PeryanMain();
int main(int argc, char *argv[]) {
  ;
  PeryanMain();
  ;
  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    $0x0,%al
call   1030 <PeryanMain@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @PeryanMain()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
char *strerror(int /*<<< orphan*/);
void syserror(const char *blah, char *error_text, int text_len) {
  const char *err_msg = strerror(errno);
  snprintf(error_text, text_len, "%s\n%s", blah, err_msg);
}


x86 assembly (clang, -O0):
<syserror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xea5(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syserror>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rcx
mov    %rax,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [6 x i8] c"%s\0A%s\00"
define void @syserror(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %4
%13 = load i8*, i8** %7
%14 = call i32 @snprintf(i8* %10, i32 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [6 x i8] c"%s\0A%s\00"
define void @syserror(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chmode();
int /*<<< orphan*/ chtset();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void chset() {
  int ch;
  printf("\n\t\t\t\tCHANGE SETTINGS\n\t\t\t1)Change mode\n\t\t\t2)Change "
         "Temperature Settings\n\t\t\t3)Exit\n\n\t\tEnter Choice :");
  scanf("%d", &ch);
  switch (ch) {
  case 1:
    chmode();
    break;
  case 2:
    chtset();
    break;
  }
}


x86 assembly (clang, -O0):
<chset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1189 <chset+0x49>
jmp    1178 <chset+0x38>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1195 <chset+0x55>
jmp    119c <chset+0x5c>
mov    $0x0,%al
call   1060 <chmode@plt>
jmp    119c <chset+0x5c>
mov    $0x0,%al
call   1040 <chtset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chset>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1175 <chset+0x35>
cmp    $0x1,%eax
jne    117c <chset+0x3c>
xor    %eax,%eax
call   1060 <chmode@plt>
pop    %rax
ret
xor    %eax,%eax
call   1040 <chtset@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [99 x i8] c"\0A\09\09\09\09CHANGE SETTINGS\0A\09\09\091)Change mode\0A\09\09\092)Change Temperature Settings\0A\09\09\093)Exit\0A\0A\09\09Enter Choice :\00"
@.str.1 = [3 x i8] c"%d\00"
define void @chset() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %7
]
5: ; preds = %0
%6 = call i32 (...) @chmode()
br label %9
7: ; preds = %0
%8 = call i32 (...) @chtset()
br label %9
9: ; preds = %0, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [99 x i8] c"\0A\09\09\09\09CHANGE SETTINGS\0A\09\09\091)Change mode\0A\09\09\092)Change Temperature Settings\0A\09\09\093)Exit\0A\0A\09\09Enter Choice :\00"
@.str.1 = [3 x i8] c"%d\00"
define void @chset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 (...) @chmode()
br label %10
8: ; preds = %0
%9 = call i32 (...) @chtset()
br label %10
10: ; preds = %0, %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_thread2_work();
void *thread2_func(void *unused) { do_thread2_work(); }


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

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

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

LLVM IR (-O2):
define noalias i8* @thread2_func(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @do_thread2_work()
ret i8* undef
}
void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info) {}


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

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

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

LLVM IR (-O2):
%struct.btrfs_fs_info = type opaque
define void @btrfs_free_ref_cache(%struct.btrfs_fs_info* nocapture %0) {
ret void
}
/* Variables and functions */
float cbrtf(float);
float ncbrtf(float x) {
  if (x >= 0)
    return cbrtf(x);
  return -cbrtf(-x);
}


x86 assembly (clang, -O0):
<ncbrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1142 <ncbrtf+0x32>
movss  -0x8(%rbp),%xmm0
call   1030 <cbrtf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    116b <ncbrtf+0x5b>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <cbrtf@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncbrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    112e <ncbrtf+0x1e>
push   %rax
xorps  0xee0(%rip),%xmm0
call   1030 <cbrtf@plt>
xorps  0xed4(%rip),%xmm0
pop    %rax
ret
jmp    1030 <cbrtf@plt>

LLVM IR (-O0):
define float @ncbrtf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = call float @cbrtf(float %7)
store float %8, float* %2
br label %14
9: ; preds = %1
%10 = load float, float* %3
%11 = fneg float %10
%12 = call float @cbrtf(float %11)
%13 = fneg float %12
store float %13, float* %2
br label %14
14: ; preds = %9, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @ncbrtf(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call float @cbrtf(float %0)
br label %9
5: ; preds = %1
%6 = fneg float %0
%7 = tail call float @cbrtf(float %6)
%8 = fneg float %7
br label %9
9: ; preds = %5, %3
%10 = phi float [ %4, %3 ], [ %8, %5 ]
ret float %10
}
toobig_1(int amt) { return (1 << amt); }


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

x86 assembly (clang, -O2):
<toobig_1>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @toobig_1(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
void gtk_file_chooser_button_get_width_chars() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_button_get_width_chars() {
ret void
}
/* Variables and functions */
char const *strerror(int);
const char *gai_strerror(int errcode) { return strerror(errcode); }


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

x86 assembly (clang, -O2):
<gai_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @gai_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void async_sched_yield(void) { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @async_sched_yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
void free_int(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @free_int(i8* nocapture %0) {
ret void
}
int test_imm_9Auint16_mem(unsigned short *val) {
  return ((*val) & (0x9A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 154
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(251, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xfb,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_target_system_to_container>:
mov    $0xfb,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 251, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int compare_double(const void *a, const void *b) {
  return *((double *)a) > *((double *)b) ? 1 : 0;
}


x86 assembly (clang, -O0):
<compare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @compare_double(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @compare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int sys$parse(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(17), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$parse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x11,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$parse>:
mov    $0x11,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$parse"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 17, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$parse"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 17, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ build_char_table();
int /*<<< orphan*/ build_parity_table();
void cc_decoder_init(void) {
  build_parity_table();
  build_char_table();
}


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

x86 assembly (clang, -O2):
<cc_decoder_init>:
push   %rax
xor    %eax,%eax
call   1030 <build_parity_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <build_char_table@plt>

LLVM IR (-O0):
define void @cc_decoder_init() {
%1 = call i32 (...) @build_parity_table()
%2 = call i32 (...) @build_char_table()
ret void
}

LLVM IR (-O2):
define void @cc_decoder_init() {
%1 = tail call i32 (...) @build_parity_table()
%2 = tail call i32 (...) @build_char_table()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tk_getch();
void tk_gets_n(char *msg, int n) {
  char *s;
  s = msg;
  while (n--) {
    *s++ = tk_getch();
  }
}


x86 assembly (clang, -O0):
<tk_gets_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115a <tk_gets_n+0x4a>
mov    $0x0,%al
call   1030 <tk_getch@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1127 <tk_gets_n+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk_gets_n>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <tk_gets_n+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <tk_getch@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <tk_gets_n+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @tk_gets_n(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 (...) @tk_getch()
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
store i8 %13, i8* %14
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @tk_gets_n(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 (...) @tk_getch()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %9, i8* %5
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
struct gpio_bank {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _set_gpio_dataout(struct gpio_bank *, int /*<<< orphan*/,
                                     int);
scalar_t__ check_gpio(int);
struct gpio_bank *get_gpio_bank(int);
int /*<<< orphan*/ get_gpio_index(int);
void omap_set_gpio_dataout(int gpio, int enable) {
  struct gpio_bank *bank;
  if (check_gpio(gpio) < 0)
    return;
  bank = get_gpio_bank(gpio);
  _set_gpio_dataout(bank, get_gpio_index(gpio), enable);
}


x86 assembly (clang, -O0):
<omap_set_gpio_dataout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <check_gpio@plt>
cmp    $0x0,%rax
jge    1165 <omap_set_gpio_dataout+0x25>
jmp    118f <omap_set_gpio_dataout+0x4f>
mov    -0x4(%rbp),%edi
call   1050 <get_gpio_bank@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <get_gpio_index@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <_set_gpio_dataout@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap_set_gpio_dataout>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <check_gpio@plt>
test   %rax,%rax
js     1175 <omap_set_gpio_dataout+0x35>
mov    %ebp,%edi
call   1050 <get_gpio_bank@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1060 <get_gpio_index@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_set_gpio_dataout@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.gpio_bank = type { i32 }
define void @omap_set_gpio_dataout(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.gpio_bank*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i64 @check_gpio(i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %18
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call %struct.gpio_bank* @get_gpio_bank(i32 %11)
store %struct.gpio_bank* %12, %struct.gpio_bank** %5
%13 = load %struct.gpio_bank*, %struct.gpio_bank** %5
%14 = load i32, i32* %3
%15 = call i32 @get_gpio_index(i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @_set_gpio_dataout(%struct.gpio_bank* %13, i32 %15, i32 %16)
br label %18
18: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
%struct.gpio_bank = type { i32 }
define void @omap_set_gpio_dataout(i32 %0, i32 %1) {
%3 = tail call i64 @check_gpio(i32 %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call %struct.gpio_bank* @get_gpio_bank(i32 %0)
%7 = tail call i32 @get_gpio_index(i32 %0)
%8 = tail call i32 @_set_gpio_dataout(%struct.gpio_bank* %6, i32 %7, i32 %1)
br label %9
9: ; preds = %2, %5
ret void
}
int row_byte_johab_hangul(int row) { return 0x84 + row; }


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

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

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

LLVM IR (-O2):
define i32 @row_byte_johab_hangul(i32 %0) {
%2 = add nsw i32 %0, 132
ret i32 %2
}
struct bwb_line *bwb_DEFDBL(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  var_defx(l, 1);
  return bwb_zline(l);
}


x86 assembly (clang, -O0):
<bwb_DEFDBL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <var_defx@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <bwb_zline@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_DEFDBL>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <var_defx@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <bwb_zline@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_DEFDBL = [11 x i8] c"bwb_DEFDBL\00"
define %struct.bwb_line* @bwb_DEFDBL(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_DEFDBL, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, i32, ...) bitcast (i32 (...)* @var_defx to i32 (%struct.bwb_line*, i32, ...)*)(%struct.bwb_line* %4, i32 1)
%6 = load %struct.bwb_line*, %struct.bwb_line** %2
%7 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to %struct.bwb_line*
ret %struct.bwb_line* %9
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_DEFDBL = [11 x i8] c"bwb_DEFDBL\00"
define %struct.bwb_line* @bwb_DEFDBL(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_DEFDBL, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, i32, ...) bitcast (i32 (...)* @var_defx to i32 (%struct.bwb_line*, i32, ...)*)(%struct.bwb_line* %0, i32 1)
%4 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.bwb_line*
ret %struct.bwb_line* %6
}
extern unsigned short get_timer_counter(void) {
  return *(volatile unsigned short int *)(0 + 0x44);
}


x86 assembly (clang, -O0):
<get_timer_counter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%eax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timer_counter>:
movzwl 0x44,%eax
ret

LLVM IR (-O0):
define zeroext i16 @get_timer_counter() {
%1 = load volatile i16, i16* inttoptr (i64 68 to i16*)
ret i16 %1
}

LLVM IR (-O2):
define zeroext i16 @get_timer_counter() {
%1 = load volatile i16, i16* inttoptr (i64 68 to i16*)
ret i16 %1
}
/* Variables and functions */
int get8(unsigned char **);
int /*<<< orphan*/ printf(char *, int);
void readIp4Address(unsigned char **head) {
  int i;
  printf("%d", get8(head));
  for (i = 0; i < 3; i++)
    printf(".%d", get8(head));
}


x86 assembly (clang, -O0):
<readIp4Address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1179 <readIp4Address+0x59>
mov    -0x8(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <readIp4Address+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readIp4Address>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get8@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <get8@plt>
lea    0xeb7(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <get8@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <get8@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c".%d\00"
define void @readIp4Address(i8** %0) {
%2 = tail call i32 @get8(i8** %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @get8(i8** %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @get8(i8** %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @get8(i8** %0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}
int test_imm_91int16_mem(short *val) {
  return ((*val) & (0x91 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_91int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 145
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int arith_min(int x, int y) { return x > y ? y : x; }


x86 assembly (clang, -O0):
<arith_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <arith_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <arith_min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @arith_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ tag;

/* Variables and functions */
int /*<<< orphan*/ get_tag(char *, int);
int main(void) {
  char tag[4];
  unsigned long __cil_tmp2;
  unsigned long __cil_tmp3;
  char *__cil_tmp4;
  {
    {
      __cil_tmp2 = 0 * 1UL;
      __cil_tmp3 = (unsigned long)(tag) + __cil_tmp2;
      __cil_tmp4 = (char *)__cil_tmp3;
      get_tag(__cil_tmp4, 4);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <get_tag@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i32 0, i32* %1
store i64 0, i64* %3
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = ptrtoint i8* %6 to i64
%8 = load i64, i64* %3
%9 = add i64 %7, %8
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 @get_tag(i8* %12, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_tag(i8* %2, i32 4)
ret i32 0
}
/* Variables and functions */
void bzero(void *p, int len) {
  int n;
  char *pch = (char *)p;
  if ((n = len) <= 0) {
    return;
  }
  do {
    *pch++ = 0;
  } while (--n);
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jg     1127 <bzero+0x27>
jmp    1150 <bzero+0x50>
jmp    112c <bzero+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jne    112c <bzero+0x2c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
jle    1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void fa26(void) {
P0A:
  goto P0A;
  ({
    p01A:
      goto p01A;
      goto a;
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa26>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa26+0x4>

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

LLVM IR (-O0):
define void @fa26() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; preds = %10
br label %10
11: ; No predecessors!
br label %12
12: ; preds = %12, %11
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
br label %15
15: ; preds = %15, %14
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa26() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sapi_memact_deinit(void *cb) { free(cb); }


x86 assembly (clang, -O0):
<sapi_memact_deinit>:
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):
<sapi_memact_deinit>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sapi_memact_deinit(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int rand();
char randomize_company() {
  int random = (rand() % 3) + 1;
  char company;
  if (random == 1) {
    company = 'A';
  }
  if (random == 2) {
    company = 'B';
  }
  if (random == 3) {
    company = 'C';
  };
  return company;
}


x86 assembly (clang, -O0):
<randomize_company>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113b <randomize_company+0x2b>
movb   $0x41,-0x5(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1149 <randomize_company+0x39>
movb   $0x42,-0x5(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1157 <randomize_company+0x47>
movb   $0x43,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize_company>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
cmp    $0x2,%eax
sete   %cl
add    $0x41,%cl
cmp    $0x3,%eax
movzbl %cl,%ecx
mov    $0x43,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @randomize_company() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %0
store i8 65, i8* %2
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %9
store i8 66, i8* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13
store i8 67, i8* %2
br label %17
17: ; preds = %16, %13
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @randomize_company() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = add nsw i32 %2, 1
%4 = icmp eq i32 %3, 2
%5 = select i1 %4, i8 66, i8 65
%6 = icmp eq i32 %3, 3
%7 = select i1 %6, i8 67, i8 %5
ret i8 %7
}
void __ieee754_acos(void) {}


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

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

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

LLVM IR (-O2):
define void @__ieee754_acos() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
ulong my_ntohl(ulong netlong) { return ntohl(netlong); }


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

x86 assembly (clang, -O2):
<my_ntohl>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @my_ntohl(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t i = 0;
  while (string[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int ispower2(unsigned x) { return x && !(x & (x - 1)); }


x86 assembly (clang, -O0):
<ispower2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <ispower2+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispower2>:
test   %edi,%edi
je     110f <ispower2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ispower2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void enterSysPatchLrm(void) {}


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

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

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

LLVM IR (-O2):
define void @enterSysPatchLrm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char *, int, char, char *, int, char);
int main() {
  print("sdcsdc", "abracadabra", 12345, 'Z', "foo", 365, '%');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x3039,%edx
mov    $0x5a,%ecx
lea    0xed5(%rip),%r8
mov    $0x16d,%r9d
movl   $0x25,(%rsp)
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x25,(%rsp)
lea    0xee1(%rip),%rdi
lea    0xee1(%rip),%rsi
lea    0xee6(%rip),%r8
mov    $0x3039,%edx
mov    $0x5a,%ecx
mov    $0x16d,%r9d
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sdcsdc\00"
@.str.1 = [12 x i8] c"abracadabra\00"
@.str.2 = [4 x i8] c"foo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 12345, i8 signext 90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 365, i8 signext 37)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"sdcsdc\00"
@.str.1 = [12 x i8] c"abracadabra\00"
@.str.2 = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 12345, i8 signext 90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 365, i8 signext 37)
ret i32 0
}