xunge/DecIR huggingface dataset:
void transfer_YUV_PLANAR_to_YUV444P(unsigned char *input_y,
                                    unsigned char *input_u,
                                    unsigned char *input_v,
                                    unsigned char *output_y,
                                    unsigned char *output_u,
                                    unsigned char *output_v, int j) {
  output_y[j] = *input_y;
  output_u[j] = *input_u;
  output_v[j] = *input_v;
}


x86 assembly (clang, -O0):
<transfer_YUV_PLANAR_to_YUV444P>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
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    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x20(%rbp),%rax
movslq 0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%dl
mov    -0x28(%rbp),%rax
movslq 0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x30(%rbp),%rax
movslq 0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_YUV_PLANAR_to_YUV444P>:
movslq 0x8(%rsp),%r10
mov    (%rdi),%al
mov    %al,(%rcx,%r10,1)
mov    (%rsi),%al
mov    %al,(%r8,%r10,1)
mov    (%rdx),%al
mov    %al,(%r9,%r10,1)
ret

LLVM IR (-O0):
define void @transfer_YUV_PLANAR_to_YUV444P(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i8, i8* %15
%17 = load i8*, i8** %11
%18 = load i32, i32* %14
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
%21 = load i8*, i8** %9
%22 = load i8, i8* %21
%23 = load i8*, i8** %12
%24 = load i32, i32* %14
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8*, i8** %10
%28 = load i8, i8* %27
%29 = load i8*, i8** %13
%30 = load i32, i32* %14
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
ret void
}

LLVM IR (-O2):
define void @transfer_YUV_PLANAR_to_YUV444P(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4, i8* nocapture writeonly %5, i32 %6) {
%8 = load i8, i8* %0
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %3, i64 %9
store i8 %8, i8* %10
%11 = load i8, i8* %1
%12 = getelementptr inbounds i8, i8* %4, i64 %9
store i8 %11, i8* %12
%13 = load i8, i8* %2
%14 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 %13, i8* %14
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int decoder_freeStream(int /*<<< orphan*/);
int SSP_Decoder_FreeStream(uint32_t handle) {
  return decoder_freeStream(handle);
}


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

x86 assembly (clang, -O2):
<SSP_Decoder_FreeStream>:
jmp    1030 <decoder_freeStream@plt>

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

LLVM IR (-O2):
define i32 @SSP_Decoder_FreeStream(i32 %0) {
%2 = tail call i32 @decoder_freeStream(i32 %0)
ret i32 %2
}
float fahr_to_celsius(float fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


x86 assembly (clang, -O0):
<fahr_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahr_to_celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
unsigned int next_power_of_two3(unsigned int n) {
  if (n && !(n & (n - 1))) {
    return n;
  }
  unsigned int p = 1;
  while (p < n) {
    p <<= 1;
  }
  return p;
}


x86 assembly (clang, -O0):
<next_power_of_two3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <next_power_of_two3+0x30>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1130 <next_power_of_two3+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <next_power_of_two3+0x57>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1151 <next_power_of_two3+0x51>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <next_power_of_two3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two3>:
lea    -0x1(%rdi),%eax
test   %eax,%edi
sete   %al
test   %edi,%edi
setne  %cl
test   %al,%cl
je     1114 <next_power_of_two3+0x14>
mov    %edi,%eax
ret
mov    $0x1,%ecx
nopl   0x0(%rax)
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1120 <next_power_of_two3+0x20>
ret

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

LLVM IR (-O2):
define i32 @next_power_of_two3(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = icmp ult i32 %5, %0
%7 = shl i32 %5, 1
br i1 %6, label %4, label %8
8: ; preds = %4, %1
%9 = phi i32 [ %0, %1 ], [ %5, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ remove_irq(int);
void adb_clear_mouse_int() { remove_irq(0x04000); }


x86 assembly (clang, -O0):
<adb_clear_mouse_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000,%edi
call   1030 <remove_irq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adb_clear_mouse_int>:
mov    $0x4000,%edi
jmp    1030 <remove_irq@plt>

LLVM IR (-O0):
define void @adb_clear_mouse_int() {
%1 = call i32 @remove_irq(i32 16384)
ret void
}

LLVM IR (-O2):
define void @adb_clear_mouse_int() {
%1 = tail call i32 @remove_irq(i32 16384)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
unsigned long strtoul_l(const char *nptr, char **endptr, int base,
                        locale_t loc) {
  return strtoul(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtoul_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoul_l>:
jmp    1030 <strtoul@plt>

LLVM IR (-O0):
define i64 @strtoul_l(i8* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = call i64 @strtoul(i8* %9, i8** %10, i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @strtoul_l(i8* %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwscanw(int /*<<< orphan*/ *, int, int, char *, int *, int *);
int ii_mvwscanw(WINDOW *win, int y, int x, char *fmt, int *i, int *j) {
  return (mvwscanw(win, y, x, fmt, i, j));
}


x86 assembly (clang, -O0):
<ii_mvwscanw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <mvwscanw@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ii_mvwscanw>:
jmp    1030 <mvwscanw@plt>

LLVM IR (-O0):
define i32 @ii_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i32*, i32** %11
%18 = load i32*, i32** %12
%19 = call i32 @mvwscanw(i32* %13, i32 %14, i32 %15, i8* %16, i32* %17, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @ii_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i32* %4, i32* %5) {
%7 = tail call i32 @mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i32* %4, i32* %5)
ret i32 %7
}
/* Variables and functions */
size_t strlen2(char const *);
int /*<<< orphan*/ strnset(char **, char const *, size_t);
void strset_truncated(char **str_field, const char *str) {
  size_t n = strlen2(str);
  for (; !strnset(str_field, str, n) && n > 1; n /= 2) {
  }
}


x86 assembly (clang, -O0):
<strset_truncated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strnset@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jne    1169 <strset_truncated+0x49>
cmpq   $0x1,-0x18(%rbp)
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1179 <strset_truncated+0x59>
jmp    118f <strset_truncated+0x6f>
jmp    117e <strset_truncated+0x5e>
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113d <strset_truncated+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset_truncated>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen2@plt>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <strnset@plt>
cmp    $0x2,%rbx
jb     115b <strset_truncated+0x3b>
shr    %rbx
test   %eax,%eax
je     1140 <strset_truncated+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @strset_truncated(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i64
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen2(i8* %6)
store i64 %7, i64* %5
br label %8
8: ; preds = %20, %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = call i32 @strnset(i8** %9, i8* %10, i64 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = load i64, i64* %5
%16 = icmp ugt i64 %15, 1
br label %17
17: ; preds = %14, %8
%18 = phi i1 [ false, %8 ], [ %16, %14 ]
br i1 %18, label %19, label %23
19: ; preds = %17
br label %20
20: ; preds = %19
%21 = load i64, i64* %5
%22 = udiv i64 %21, 2
store i64 %22, i64* %5
br label %8
23: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @strset_truncated(i8** %0, i8* %1) {
%3 = tail call i64 @strlen2(i8* %1)
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %3, %2 ], [ %10, %4 ]
%6 = tail call i32 @strnset(i8** %0, i8* %1, i64 %5)
%7 = icmp eq i32 %6, 0
%8 = icmp ugt i64 %5, 1
%9 = and i1 %8, %7
%10 = lshr i64 %5, 1
br i1 %9, label %4, label %11
11: ; preds = %4
ret void
}
unsigned hash_str(const char *str) {
  unsigned hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash_str+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_str+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_str+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_str+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
char *strerror(int);
char *strerror_l(int error, locale_t locale) {
  (void)(locale);
  return strerror(error);
}


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

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

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

LLVM IR (-O2):
define i8* @strerror_l(i32 %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %0)
ret i8* %3
}
int _add2(int src1, int src2) {
  short s1[2], s2[2], r[2];
  int result;
  *((int *)s1) = src1;
  *((int *)s2) = src2;
  r[0] = s1[0] + s2[0];
  r[1] = s1[1] + s2[1];
  result = *(int *)r;
  return result;
}


x86 assembly (clang, -O0):
<_add2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movswl -0xc(%rbp),%eax
movswl -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x14(%rbp)
movswl -0xa(%rbp),%eax
movswl -0xe(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_add2>:
lea    (%rsi,%rdi,1),%eax
and    $0xffff0000,%edi
lea    (%rdi,%rsi,1),%ecx
and    $0xffff0000,%ecx
movzwl %ax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_add2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
%6 = alloca [2 x i16]
%7 = alloca [2 x i16]
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%11 = bitcast i16* %10 to i32*
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%14 = bitcast i16* %13 to i32*
store i32 %12, i32* %14
%15 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%16 = load i16, i16* %15
%17 = sext i16 %16 to i32
%18 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = add nsw i32 %17, %20
%22 = trunc i32 %21 to i16
%23 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 0
store i16 %22, i16* %23
%24 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 1
%25 = load i16, i16* %24
%26 = sext i16 %25 to i32
%27 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 1
%28 = load i16, i16* %27
%29 = sext i16 %28 to i32
%30 = add nsw i32 %26, %29
%31 = trunc i32 %30 to i16
%32 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 1
store i16 %31, i16* %32
%33 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 0
%34 = bitcast i16* %33 to i32*
%35 = load i32, i32* %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
ret i32 %36
}

LLVM IR (-O2):
define i32 @_add2(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = and i32 %0, -65536
%5 = add i32 %4, %1
%6 = and i32 %5, -65536
%7 = and i32 %3, 65535
%8 = or i32 %6, %7
ret i32 %8
}
int islower(int ch) { return ((ch >= 'a') && (ch <= 'z')); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
in_addr_t netmask(int prefix) {
  if (prefix == 0)
    return (~((in_addr_t)-1));
  else
    return (~((1 << (32 - prefix)) - 1));
}


x86 assembly (clang, -O0):
<netmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <netmask+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1135 <netmask+0x35>
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<netmask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shl    %cl,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @netmask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 32, %8
%10 = shl i32 1, %9
%11 = sub nsw i32 %10, 1
%12 = xor i32 %11, -1
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @netmask(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = sub nsw i32 32, %0
%4 = shl nsw i32 -1, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *, char *, int);
void foo(char *left, char *rite, int element) {
  while (left <= rite) {
    rite -= element;
    bar(left, rite, element);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     115c <foo+0x4c>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bar@plt>
jmp    1123 <foo+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %rdi,%rsi
jb     1146 <foo+0x36>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
movslq %edx,%r15
neg    %r15
nopl   0x0(%rax,%rax,1)
add    %r15,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <bar@plt>
cmp    %rbp,%rbx
jae    1130 <foo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i8* %0, i8* %1, i32 %2) {
%4 = icmp ult i8* %1, %0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sub nsw i64 0, %6
br label %8
8: ; preds = %5, %8
%9 = phi i8* [ %1, %5 ], [ %10, %8 ]
%10 = getelementptr inbounds i8, i8* %9, i64 %7
%11 = tail call i32 @bar(i8* %0, i8* %10, i32 %2)
%12 = icmp ult i8* %10, %0
br i1 %12, label %13, label %8
13: ; preds = %8, %3
ret void
}
int graph_id(int width, int height, int x, int y) {
  if (y < 0 || y >= height || x < 0 || x >= width) {
    return -1;
  }
  return (x * width) + y;
}


x86 assembly (clang, -O0):
<graph_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     113c <graph_id+0x3c>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <graph_id+0x3c>
cmpl   $0x0,-0x10(%rbp)
jl     113c <graph_id+0x3c>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1148 <graph_id+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <graph_id+0x55>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_id>:
mov    $0xffffffff,%eax
test   %ecx,%ecx
js     111c <graph_id+0x1c>
cmp    %edi,%edx
jge    111c <graph_id+0x1c>
test   %edx,%edx
js     111c <graph_id+0x1c>
cmp    %esi,%ecx
jge    111c <graph_id+0x1c>
imul   %edi,%edx
add    %ecx,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @graph_id(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 0
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = icmp slt i32 %3, %1
%8 = icmp sgt i32 %2, -1
%9 = and i1 %8, %7
%10 = icmp slt i32 %2, %0
%11 = and i1 %10, %9
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = mul nsw i32 %2, %0
%14 = add nsw i32 %13, %3
br label %15
15: ; preds = %4, %6, %12
%16 = phi i32 [ %14, %12 ], [ -1, %6 ], [ -1, %4 ]
ret i32 %16
}
void ff_hevc_put_hevc_uni_w_pel_pixels8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels8_12_sse4() {
ret void
}
int g2(int a, int b) {
  if (b == 0)
    return a;
  return g2(b, a % b);
}


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <g2+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <g2+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <g2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
mov    %edi,%eax
test   %esi,%esi
je     111d <g2+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <g2+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @g2(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
int rand();
in_addr_t RandomIp() { return rand() % 0xffffffff + 0x1; }


x86 assembly (clang, -O0):
<RandomIp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xffffffff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomIp>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
inc    %eax
mov    $0x1,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @RandomIp() {
%1 = call i32 (...) @rand()
%2 = urem i32 %1, -1
%3 = add i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @RandomIp() {
%1 = tail call i32 (...) @rand()
%2 = icmp eq i32 %1, -1
%3 = add i32 %1, 1
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
void h32_to_bytes(char *bytes, uint32_t value) {
  value = htonl(value);
  *(uint32_t *)bytes = value;
}


x86 assembly (clang, -O0):
<h32_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h32_to_bytes>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @h32_to_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @h32_to_bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htonl(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tf_test_list();
int main(void) {
  tf_test_list();
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ARGBAddRow_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((weak)) double floor(double a) { abort(); }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<floor>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define weak double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define weak double @floor(double %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
int isLower(const int c) { return c >= 'A' && c <= 'Z'; }


x86 assembly (clang, -O0):
<isLower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isLower+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLower>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isLower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int DeadAntsCount(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char string[100] = {0};
  fflush(stdin);
  gets(string);
  printf("%d\n", DeadAntsCount(string));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    -0x80(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <DeadAntsCount@plt>
mov    %eax,%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <DeadAntsCount@plt>
lea    0xe6b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [100 x i8]* %6 to i8*
%8 = load i32, i32* @stdin
%9 = call i32 @fflush(i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = call i32 @DeadAntsCount(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @gets(i8* %4)
%8 = call i32 @DeadAntsCount(i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int ushort;

/* Variables and functions */
ushort ConvertCase(ushort caseij) {
  ushort inc = 0;
  while (caseij > 0) {
    caseij = caseij >> 1;
    inc++;
  }
  return inc - 1;
}


x86 assembly (clang, -O0):
<ConvertCase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <ConvertCase+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ConvertCase+0xe>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertCase>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111c <ConvertCase+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ConvertCase+0x10>
ret

LLVM IR (-O0):
define i32 @ConvertCase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = ashr i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @ConvertCase(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int __isxdigit_impl(int);
int isxdigit(int c) { return __isxdigit_impl(c); }


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

x86 assembly (clang, -O2):
<isxdigit>:
jmp    1030 <__isxdigit_impl@plt>

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i32 @__isxdigit_impl(i32 %0)
ret i32 %2
}
void DH_compute_key(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_compute_key() {
ret void
}
/* Variables and functions */
char *cvt(long double, int, int *, int *, int);
char *_ecvt(long double value, int ndigit, int *decpt, int *sign) {
  return (cvt(value, ndigit, decpt, sign, 1));
}


x86 assembly (clang, -O0):
<_ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x1,%ecx
call   1030 <cvt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ecvt>:
mov    $0x1,%ecx
jmp    1030 <cvt@plt>

LLVM IR (-O0):
define i8* @_ecvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca x86_fp80
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store x86_fp80 %0, x86_fp80* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load x86_fp80, x86_fp80* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i8* @cvt(x86_fp80 %9, i32 %10, i32* %11, i32* %12, i32 1)
ret i8* %13
}

LLVM IR (-O2):
define i8* @_ecvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i8* @cvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3, i32 1)
ret i8* %5
}
/* Variables and functions */
int fun(int, int);
int main() { return fun(5, 20); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x14,%esi
call   1030 <fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x14,%esi
jmp    1030 <fun@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(i32 5, i32 20)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ destroy_socket_pool();
void rpc_destroy() { destroy_socket_pool(); }


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

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

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

LLVM IR (-O2):
define void @rpc_destroy() {
%1 = tail call i32 (...) @destroy_socket_pool()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (ret)
    return ret;
  perror("Error: malloc");
  exit(errno);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Error: malloc\00"
@errno = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @errno
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Error: malloc\00"
@errno = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @errno
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int labs(int);
int DistBetPtsOnCircBound(int PtsOnBound, int IndexA, int IndexB) {
  int distance;
  if (labs(IndexA - IndexB) < labs(PtsOnBound - labs(IndexA - IndexB))) {
    distance = labs(IndexA - IndexB);
  } else {
    distance = labs(PtsOnBound - labs(IndexA - IndexB));
  }
  return distance;
}


x86 assembly (clang, -O0):
<DistBetPtsOnCircBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <labs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <labs@plt>
mov    -0x18(%rbp),%edi
sub    %eax,%edi
call   1030 <labs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    116a <DistBetPtsOnCircBound+0x5a>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <labs@plt>
mov    %eax,-0x10(%rbp)
jmp    1188 <DistBetPtsOnCircBound+0x78>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <labs@plt>
mov    -0x1c(%rbp),%edi
sub    %eax,%edi
call   1030 <labs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DistBetPtsOnCircBound>:
sub    %edx,%esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
sub    %ecx,%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cmp    %eax,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DistBetPtsOnCircBound(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %8, %9
%11 = call i32 @labs(i32 %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
%16 = call i32 @labs(i32 %15)
%17 = sub nsw i32 %12, %16
%18 = call i32 @labs(i32 %17)
%19 = icmp slt i32 %11, %18
br i1 %19, label %20, label %25
20: ; preds = %3
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = sub nsw i32 %21, %22
%24 = call i32 @labs(i32 %23)
store i32 %24, i32* %7
br label %33
25: ; preds = %3
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = sub nsw i32 %27, %28
%30 = call i32 @labs(i32 %29)
%31 = sub nsw i32 %26, %30
%32 = call i32 @labs(i32 %31)
store i32 %32, i32* %7
br label %33
33: ; preds = %25, %20
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @DistBetPtsOnCircBound(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = sub nsw i32 %0, %5
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = icmp ult i32 %5, %7
%9 = select i1 %8, i32 %5, i32 %7
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getdns_get_version_number(void) { return 0x00030201; }


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

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

LLVM IR (-O0):
define i32 @getdns_get_version_number() {
ret i32 197121
}

LLVM IR (-O2):
define i32 @getdns_get_version_number() {
ret i32 197121
}
/* Variables and functions */
int gfx_i2c_read(int, int, unsigned char, int, unsigned char *);
int saa7114_read_reg(unsigned char reg, unsigned char *val) {
  return gfx_i2c_read(2, 0x42, reg, 1, val);
}


x86 assembly (clang, -O0):
<saa7114_read_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%r8
mov    $0x2,%edi
mov    $0x42,%esi
mov    $0x1,%ecx
movzbl %al,%edx
call   1030 <gfx_i2c_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_read_reg>:
mov    %rsi,%r8
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x42,%esi
mov    $0x1,%ecx
jmp    1030 <gfx_i2c_read@plt>

LLVM IR (-O0):
define i32 @saa7114_read_reg(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
%7 = call i32 @gfx_i2c_read(i32 2, i32 66, i8 zeroext %5, i32 1, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @saa7114_read_reg(i8 zeroext %0, i8* %1) {
%3 = tail call i32 @gfx_i2c_read(i32 2, i32 66, i8 zeroext %0, i32 1, i8* %1)
ret i32 %3
}
void routesimple_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @routesimple_deinit() {
ret void
}
int test_imm_CDuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xCD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CDuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 205
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ snmp_call_callbacks(int /*<<< orphan*/, int,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ snmp_close_sessions();
int /*<<< orphan*/ snmp_store(char const *);
void snmp_shutdown(const char *type) {
  snmp_store(type);
  snmp_call_callbacks(0, 2, 0);
  snmp_close_sessions();
}


x86 assembly (clang, -O0):
<snmp_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <snmp_store@plt>
xor    %edx,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1050 <snmp_call_callbacks@plt>
mov    $0x0,%al
call   1030 <snmp_close_sessions@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snmp_shutdown>:
push   %rax
call   1040 <snmp_store@plt>
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1050 <snmp_call_callbacks@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <snmp_close_sessions@plt>

LLVM IR (-O0):
define void @snmp_shutdown(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @snmp_store(i8* %3)
%5 = call i32 @snmp_call_callbacks(i32 0, i32 2, i32 0)
%6 = call i32 (...) @snmp_close_sessions()
ret void
}

LLVM IR (-O2):
define void @snmp_shutdown(i8* %0) {
%2 = tail call i32 @snmp_store(i8* %0)
%3 = tail call i32 @snmp_call_callbacks(i32 0, i32 2, i32 0)
%4 = tail call i32 (...) @snmp_close_sessions()
ret void
}