xunge/DecIR huggingface dataset:
void reverse(char *psz, int cch) {
  int ich;
  char chTemp;
  for (ich = 0; ich < --cch; ich++) {
    chTemp = psz[ich];
    psz[ich] = psz[cch];
    psz[cch] = chTemp;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    %ecx,%eax
jge    1166 <reverse+0x66>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reverse+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    $0x2,%esi
jl     1131 <reverse+0x31>
mov    %esi,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define void @reverse(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
store i32 0, i32* %5
br label %7
7: ; preds = %32, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %35
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %6
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8, i8* %6
%28 = load i8*, i8** %3
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 %27, i8* %31
br label %32
32: ; preds = %12
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %7
35: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = phi i64 [ %6, %4 ], [ %15, %7 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = add nuw nsw i64 %8, 1
%15 = add nsw i64 %9, -1
%16 = icmp slt i64 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
void V34_init(struct V34State *s, int calling) {}


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

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

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

LLVM IR (-O2):
%struct.V34State = type opaque
define void @V34_init(%struct.V34State* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int remove(char const *);
int c_remove(const char *arg0) { return remove(arg0); }


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

x86 assembly (clang, -O2):
<c_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @c_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
char *strdup(char const *);
char *xp_strdup(const char *src) { return strdup(src); }


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

x86 assembly (clang, -O2):
<xp_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @xp_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char name[40];
  printf("What's your name? ");
  scanf("%s", name);
  printf("Hello, %s. %s\n", name, "You are an extraordinary being.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xebe(%rip),%rdi
lea    0xec6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
lea    0xed2(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"What's your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [32 x i8] c"You are an extraordinary being.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"What's your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [32 x i8] c"You are an extraordinary being.\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int cal_linear_ordered_search(void const *, void const *, size_t, size_t,
                              int (*)(void *, void const *, void const *),
                              void *, size_t *);
int calpriv_fbt_search_l_search(void *ctx, const void *key, const void *ptr,
                                size_t count, size_t size,
                                int (*cmp)(void *, const void *, const void *),
                                void *cmp_ctx, size_t *pos_out) {
  (void)ctx;
  return cal_linear_ordered_search(key, ptr, count, size, cmp, cmp_ctx,
                                   pos_out);
}


x86 assembly (clang, -O0):
<calpriv_fbt_search_l_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <cal_linear_ordered_search@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calpriv_fbt_search_l_search>:
push   %rax
mov    %r9,%rax
mov    %rsi,%rdi
mov    0x10(%rsp),%r9
mov    0x18(%rsp),%rsi
mov    %rsi,(%rsp)
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
call   1030 <cal_linear_ordered_search@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calpriv_fbt_search_l_search(i8* %0, i8* %1, i8* %2, i64 %3, i64 %4, i32 (i8*, i8*, i8*)* %5, i8* %6, i64* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32 (i8*, i8*, i8*)*
%15 = alloca i8*
%16 = alloca i64*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store i32 (i8*, i8*, i8*)* %5, i32 (i8*, i8*, i8*)** %14
store i8* %6, i8** %15
store i64* %7, i64** %16
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = load i64, i64* %12
%21 = load i64, i64* %13
%22 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %14
%23 = load i8*, i8** %15
%24 = load i64*, i64** %16
%25 = call i32 @cal_linear_ordered_search(i8* %18, i8* %19, i64 %20, i64 %21, i32 (i8*, i8*, i8*)* %22, i8* %23, i64* %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @calpriv_fbt_search_l_search(i8* nocapture readnone %0, i8* %1, i8* %2, i64 %3, i64 %4, i32 (i8*, i8*, i8*)* %5, i8* %6, i64* %7) {
%9 = tail call i32 @cal_linear_ordered_search(i8* %1, i8* %2, i64 %3, i64 %4, i32 (i8*, i8*, i8*)* %5, i8* %6, i64* %7)
ret i32 %9
}
int host_open(const char *name) {
  int fd;
  touch_buffer(name, strlen(name) + 1);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, "
                       "0x10"
                       "\n"
                       ".byte "
                       "0x00"
                       ", 0x00\n"
                       ".byte 0x00, 0x00, 0x00\n"
                       ".byte 0x00\n"
                       : "=a"(fd)
                       : "a"(name));
  return fd;
}


x86 assembly (clang, -O0):
<host_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x0,%al
call   1040 <touch_buffer@plt>
mov    -0x8(%rbp),%rax
(bad)
add    %dl,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_open>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <touch_buffer@plt>
mov    %rbx,%rax
(bad)
add    %dl,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @host_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = add i64 %6, 1
%8 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @touch_buffer to i32 (i8*, i64, ...)*)(i8* %4, i64 %7)
%9 = load i8*, i8** %2
%10 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x10\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8* %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @host_open(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @touch_buffer to i32 (i8*, i64, ...)*)(i8* %0, i64 %3)
%5 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x10\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int IsObject(int /*<<< orphan*/);
int Cnd_IsObject(void) { return (IsObject(ArgItem())); }


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

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

LLVM IR (-O0):
define i32 @Cnd_IsObject() {
%1 = call i32 (...) @ArgItem()
%2 = call i32 @IsObject(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @Cnd_IsObject() {
%1 = tail call i32 (...) @ArgItem()
%2 = tail call i32 @IsObject(i32 %1)
ret i32 %2
}
/* Variables and functions */
float __avr32_f32_sub_fast(float, float);
float float_sub(float a, float b) { return __avr32_f32_sub_fast(a, b); }


x86 assembly (clang, -O0):
<float_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__avr32_f32_sub_fast@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_sub>:
jmp    1030 <__avr32_f32_sub_fast@plt>

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

LLVM IR (-O2):
define float @float_sub(float %0, float %1) {
%3 = tail call float @__avr32_f32_sub_fast(float %0, float %1)
ret float %3
}
int hf_open_file(char *filename) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @hf_open_file(i8* nocapture readnone %0) {
ret i32 -1
}
void sr_location_eat_char_ext(int *line, int *column, char c) {
  if (c == '\n') {
    *line += 1;
    *column = 0;
  } else
    *column += 1;
}


x86 assembly (clang, -O0):
<sr_location_eat_char_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1138 <sr_location_eat_char_ext+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1143 <sr_location_eat_char_ext+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_location_eat_char_ext>:
cmp    $0xa,%dl
jne    110d <sr_location_eat_char_ext+0xd>
addl   $0x1,(%rdi)
xor    %eax,%eax
mov    %eax,(%rsi)
ret
mov    (%rsi),%eax
add    $0x1,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @sr_location_eat_char_ext(i32* nocapture %0, i32* nocapture %1, i8 signext %2) {
%4 = icmp eq i8 %2, 10
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* %0
%7 = add nsw i32 %6, 1
store i32 %7, i32* %0
br label %11
8: ; preds = %3
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %10, %8 ], [ 0, %5 ]
store i32 %12, i32* %1
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *arr, int p, int r) {
  int q = 0;
  if (p < r) {
    q = partition(arr, p, r);
    quick_sort(arr, p, q - 1);
    quick_sort(arr, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <quick_sort+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
scalar_t__ islower(char);
int numLower(char ch, int count) {
  int tempCount = count;
  if (isalpha(ch) && islower(ch)) {
    tempCount++;
  }
  return tempCount;
}


x86 assembly (clang, -O0):
<numLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1166 <numLower+0x46>
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1166 <numLower+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numLower>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <isalpha@plt>
test   %rax,%rax
je     1141 <numLower+0x21>
movsbl %bpl,%edi
call   1030 <islower@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @numLower(i8 signext %0, i32 %1) {
%3 = tail call i64 @isalpha(i8 signext %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @islower(i8 signext %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %8, %1
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %9, %5 ]
ret i32 %11
}
void foo(int N) {
  if (N) {
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <foo+0x16>
jmp    1116 <foo+0x16>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(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 %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
size_t cl_zlib_compress_output_len(size_t uncomp_len) { return uncomp_len; }


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

x86 assembly (clang, -O2):
<cl_zlib_compress_output_len>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cl_zlib_compress_output_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @cl_zlib_compress_output_len(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t etna_align_up(uint32_t value, uint32_t granularity) {
  return (value + (granularity - 1)) & (~(granularity - 1));
}


x86 assembly (clang, -O0):
<etna_align_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<etna_align_up>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @etna_align_up(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 = sub nsw i32 %6, 1
%8 = add nsw i32 %5, %7
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = xor i32 %10, -1
%12 = and i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @etna_align_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
void arch_kernel_init(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_kernel_init() {
ret void
}
/* Variables and functions */
int dhcpv6_promote_server_cand();
int dhcpv6_commit_advert(void) { return dhcpv6_promote_server_cand(); }


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

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

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

LLVM IR (-O2):
define i32 @dhcpv6_commit_advert() {
%1 = tail call i32 (...) @dhcpv6_promote_server_cand()
ret i32 %1
}
void TimPro_lc898122(void) {}


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

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

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

LLVM IR (-O2):
define void @TimPro_lc898122() {
ret void
}
int s2n_calculate_stacktrace(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @s2n_calculate_stacktrace() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_out(int /*<<< orphan*/);
int puts(const char *s) {
  while (*s)
    serial_out(*s++);
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <serial_out@plt>
jmp    111c <puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <serial_out@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @serial_out(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, scalar_t__);
int /*<<< orphan*/ strncpy(char *, char *, int);
void expected(char *s) {
  char err[1024];
  strncpy(err, s, 1024);
  strncat(err, " Expected", 1024 - strlen(" Expected"));
  fail(err);
}


x86 assembly (clang, -O0):
<expected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
lea    0xe87(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x418(%rbp),%rdi
mov    $0x400,%edx
sub    %rax,%rdx
lea    0xe6c(%rip),%rsi
call   1060 <strncat@plt>
lea    -0x410(%rbp),%rdi
call   1040 <fail@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expected>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%edx
call   1030 <strncpy@plt>
lea    0xeae(%rip),%rsi
mov    $0x3f7,%edx
mov    %rbx,%rdi
call   1050 <strncat@plt>
mov    %rbx,%rdi
call   1040 <fail@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c" Expected\00"
define void @expected(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 1024)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i64 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = sub nsw i64 1024, %8
%10 = call i32 @strncat(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = call i32 @fail(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" Expected\00"
define void @expected(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 1024)
%5 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 1015)
%6 = call i32 @fail(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *prog) {
  printf("Usage: %s TIME CHILDREN\n\n", prog);
  printf("    TIME     : sleep time in miliseconds\n");
  printf("    CHILDREN : number of children to spawn\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s TIME CHILDREN\0A\0A\00"
@.str.1 = [42 x i8] c" TIME : sleep time in miliseconds\0A\00"
@.str.2 = [44 x i8] c" CHILDREN : number of children to spawn\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s TIME CHILDREN\0A\0A\00"
@str = [41 x i8] c" TIME : sleep time in miliseconds\00"
@str.3 = [43 x i8] c" CHILDREN : number of children to spawn\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ IsPrimeNumber(int);
int GetMaxPrimeNumber(int number) {
  int i;
  for (i = number; i > 0; i--) {
    if (IsPrimeNumber(i)) {
      return i;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<GetMaxPrimeNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115b <GetMaxPrimeNumber+0x4b>
mov    -0xc(%rbp),%edi
call   1030 <IsPrimeNumber@plt>
cmp    $0x0,%rax
je     1148 <GetMaxPrimeNumber+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <GetMaxPrimeNumber+0x52>
jmp    114d <GetMaxPrimeNumber+0x3d>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <GetMaxPrimeNumber+0x11>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxPrimeNumber>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %edi,%edi
jle    113a <GetMaxPrimeNumber+0x2a>
mov    %edi,%ebx
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <IsPrimeNumber@plt>
test   %rax,%rax
jne    1138 <GetMaxPrimeNumber+0x28>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jg     1120 <GetMaxPrimeNumber+0x10>
jmp    113a <GetMaxPrimeNumber+0x2a>
mov    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @GetMaxPrimeNumber(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = tail call i64 @IsPrimeNumber(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = icmp sgt i32 %4, 1
br i1 %9, label %3, label %10
10: ; preds = %3, %7, %1
%11 = phi i32 [ 1, %1 ], [ 1, %7 ], [ %4, %3 ]
ret i32 %11
}
int test_imm_CBuint8_mem(unsigned char *val) {
  return ((*val) & (-0xCB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CBuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -203
%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_CBuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 53
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int c) {
  if (isalpha(c) || isdigit(c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
jne    114f <isalnum+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115b <isalnum+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isalnum+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void function_empty_time() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_time() {
ret void
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int procnumber() { return sys_call(0x0F, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<procnumber>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<procnumber>:
mov    $0xf,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @procnumber() {
%1 = call i32 @sys_call(i32 15, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @procnumber() {
%1 = tail call i32 @sys_call(i32 15, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
void _farsetsel(unsigned short selector) {
  __asm__ __volatile__("movw %w0,%%fs" : : "rm"(selector));
}


x86 assembly (clang, -O0):
<_farsetsel>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%fs
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farsetsel>:
mov    %di,-0x2(%rsp)
mov    -0x2(%rsp),%fs
ret

LLVM IR (-O0):
define void @_farsetsel(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret void
}

LLVM IR (-O2):
define void @_farsetsel(i16 zeroext %0) {
tail call void asm sideeffect "movw ${0:w},%fs", "rm,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret void
}
int f1(int t, int v) {
  int a = t - 1U;
  int b = a * v;
  return b + v;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ realloc(void *, int);
void *SfRealloc(void *pMem, int nNewSize) {
  if (pMem == NULL)
    return ((void *)malloc(nNewSize));
  else
    return ((void *)realloc(pMem, nNewSize));
}


x86 assembly (clang, -O0):
<SfRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <SfRealloc+0x2b>
mov    -0x14(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    115b <SfRealloc+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SfRealloc>:
push   %rax
test   %rdi,%rdi
je     112d <SfRealloc+0xd>
call   1040 <realloc@plt>
pop    %rcx
ret
mov    %esi,%edi
call   1030 <malloc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @SfRealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
br label %17
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i64 @realloc(i8* %13, i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %3
br label %17
17: ; preds = %12, %8
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @SfRealloc(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @malloc(i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i64 @realloc(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i64 [ %5, %4 ], [ %7, %6 ]
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ set_flag(int, int);
void set_zero(bool set) { set_flag(7, set); }


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

x86 assembly (clang, -O2):
<set_zero>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <set_flag@plt>

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

LLVM IR (-O2):
define void @set_zero(i32 %0) {
%2 = tail call i32 @set_flag(i32 7, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *arg0) {
  printf("Garmin TRK Parser, (c) 2013-2016 by Bernhard R. Fischer, "
         "<bf@abenteuerland.at>\n"
         "usage: %s [OPTIONS]\n"
         "   -f <format> ..... <format> := 'csv' | 'osm' | 'gpx'\n",
         arg0);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"Garmin TRK Parser, (c) 2013-2016 by Bernhard R. Fischer, <bf@abenteuerland.at>\0Ausage: %s [OPTIONS]\0A -f <format> ..... <format> := 'csv' | 'osm' | 'gpx'\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"Garmin TRK Parser, (c) 2013-2016 by Bernhard R. Fischer, <bf@abenteuerland.at>\0Ausage: %s [OPTIONS]\0A -f <format> ..... <format> := 'csv' | 'osm' | 'gpx'\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double doy2jd(year, doy)
int year;
double doy;
{
  double dj0;
  double date;
  double time;
  date = (double)year + 0.0101;
  time = 0.0;
  dj0 = dt2jd(date, time);
  return (dj0 + doy - 1.0);
}


x86 assembly (clang, -O0):
<doy2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doy2jd>:
push   %rax
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
addsd  0xedb(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
addsd  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @doy2jd(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.010000e-02
store double %10, double* %6
store double 0.000000e+00, double* %7
%11 = load double, double* %6
%12 = load double, double* %7
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %11, double %12)
%14 = sitofp i32 %13 to double
store double %14, double* %5
%15 = load double, double* %5
%16 = load double, double* %4
%17 = fadd double %15, %16
%18 = fsub double %17, 1.000000e+00
ret double %18
}

LLVM IR (-O2):
define double @doy2jd(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, 1.010000e-02
%5 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %4, double 0.000000e+00)
%6 = sitofp i32 %5 to double
%7 = fadd double %6, %1
%8 = fadd double %7, -1.000000e+00
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ double_stack();
int /*<<< orphan*/ linked_queue();
int /*<<< orphan*/ linked_stack();
int /*<<< orphan*/ loop_queue();
int /*<<< orphan*/ sequential_queue();
int /*<<< orphan*/ sequential_stack();
int main(int argc, char *argv[]) {
  sequential_stack();
  double_stack();
  linked_stack();
  sequential_queue();
  loop_queue();
  linked_queue();
  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   1070 <sequential_stack@plt>
mov    $0x0,%al
call   1050 <double_stack@plt>
mov    $0x0,%al
call   1030 <linked_stack@plt>
mov    $0x0,%al
call   1060 <sequential_queue@plt>
mov    $0x0,%al
call   1080 <loop_queue@plt>
mov    $0x0,%al
call   1040 <linked_queue@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <sequential_stack@plt>
xor    %eax,%eax
call   1050 <double_stack@plt>
xor    %eax,%eax
call   1030 <linked_stack@plt>
xor    %eax,%eax
call   1060 <sequential_queue@plt>
xor    %eax,%eax
call   1080 <loop_queue@plt>
xor    %eax,%eax
call   1040 <linked_queue@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 (...) @sequential_stack()
%7 = call i32 (...) @double_stack()
%8 = call i32 (...) @linked_stack()
%9 = call i32 (...) @sequential_queue()
%10 = call i32 (...) @loop_queue()
%11 = call i32 (...) @linked_queue()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sequential_stack()
%4 = tail call i32 (...) @double_stack()
%5 = tail call i32 (...) @linked_stack()
%6 = tail call i32 (...) @sequential_queue()
%7 = tail call i32 (...) @loop_queue()
%8 = tail call i32 (...) @linked_queue()
ret i32 0
}