xunge/DecIR huggingface dataset:
float round_sample(int *sum) {
  int sum1;
  sum1 = (*sum) >> (14 + 15 - 15);
  *sum &= (1 << (14 + 15 - 15)) - 1;
  if (sum1 < (-32768)) {
    return -1.0f;
  } else if (sum1 > (32767)) {
    return 1.0f;
  } else {
    float value = (float)sum1;
    return value / 32768.0f;
  }
}


x86 assembly (clang, -O0):
<round_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0xe,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
and    $0x3fff,%ecx
mov    %ecx,(%rax)
cmpl   $0xffff8000,-0x14(%rbp)
jge    1141 <round_sample+0x41>
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1180 <round_sample+0x80>
cmpl   $0x7fff,-0x14(%rbp)
jle    1160 <round_sample+0x60>
movss  0xeae(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1180 <round_sample+0x80>
cvtsi2ssl -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xe89(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_sample>:
mov    (%rdi),%eax
mov    %eax,%ecx
and    $0x3fff,%ecx
mov    %ecx,(%rdi)
cmp    $0xe0000000,%eax
jge    111c <round_sample+0x1c>
movss  0xee5(%rip),%xmm0
ret
cmp    $0x1fffffff,%eax
jle    112c <round_sample+0x2c>
movss  0xed9(%rip),%xmm0
ret
sar    $0xe,%eax
cvtsi2ss %eax,%xmm0
mulss  0xecd(%rip),%xmm0
ret

LLVM IR (-O0):
define float @round_sample(i32* %0) {
%2 = alloca float
%3 = alloca i32*
%4 = alloca i32
%5 = alloca float
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = ashr i32 %7, 14
store i32 %8, i32* %4
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = and i32 %10, 16383
store i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, -32768
br i1 %13, label %14, label %15
14: ; preds = %1
store float -1.000000e+00, float* %2
br label %24
15: ; preds = %1
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 32767
br i1 %17, label %18, label %19
18: ; preds = %15
store float 1.000000e+00, float* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to float
store float %21, float* %5
%22 = load float, float* %5
%23 = fdiv float %22, 3.276800e+04
store float %23, float* %2
br label %24
24: ; preds = %19, %18, %14
%25 = load float, float* %2
ret float %25
}

LLVM IR (-O2):
define float @round_sample(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 14
%4 = and i32 %2, 16383
store i32 %4, i32* %0
%5 = icmp slt i32 %2, -536870912
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = icmp sgt i32 %2, 536870911
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = sitofp i32 %3 to float
%10 = fmul float %9, 0x3F00000000000000
br label %11
11: ; preds = %6, %1, %8
%12 = phi float [ %10, %8 ], [ -1.000000e+00, %1 ], [ 1.000000e+00, %6 ]
ret float %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(int const, int /*<<< orphan*/ *const);
__attribute__((__unused__)) int(cheat_unwrapped_putc)(int const character,
                                                      FILE *const stream) {
  return putc(character, stream);
}


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

x86 assembly (clang, -O2):
<cheat_unwrapped_putc>:
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define i32 @cheat_unwrapped_putc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @putc(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while ((*s != c) && *s)
    s++;
  if (!*s)
    return NULL;
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x15(%rbp)
je     1130 <strchr+0x30>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1140 <strchr+0x40>
jmp    1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116b <strchr+0x6b>
movq   $0x0,-0x8(%rbp)
jmp    1173 <strchr+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %edx,%edx
test   %cl,%cl
cmove  %rdx,%rax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %6
%18 = phi i1 [ false, %6 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %6
22: ; preds = %17
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = icmp ne i8 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
store i8* null, i8** %3
br label %29
27: ; preds = %22
%28 = load i8*, i8** %4
store i8* %28, i8** %3
br label %29
29: ; preds = %27, %26
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = icmp eq i8 %5, 0
%9 = or i1 %8, %7
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %8, i8* null, i8* %4
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void plugin(void) { printf("This is the second plug-in\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"This is the second plug-in\0A\00"
define void @plugin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"This is the second plug-in\00"
define void @plugin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
float relu(float value) {
  if (value < 0.0f) {
    return 0.0f;
  }
  return value;
}


x86 assembly (clang, -O0):
<relu>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <relu+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    112d <relu+0x2d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<relu>:
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @relu(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %9
7: ; preds = %1
%8 = load float, float* %3
store float %8, float* %2
br label %9
9: ; preds = %7, %6
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @relu(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float 0.000000e+00, float %0
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ CIN_OGM_Init();
int /*<<< orphan*/ CIN_ROQ_Init();
void CIN_Init(void) {
  CIN_ROQ_Init();
  CIN_OGM_Init();
}


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

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

LLVM IR (-O0):
define void @CIN_Init() {
%1 = call i32 (...) @CIN_ROQ_Init()
%2 = call i32 (...) @CIN_OGM_Init()
ret void
}

LLVM IR (-O2):
define void @CIN_Init() {
%1 = tail call i32 (...) @CIN_ROQ_Init()
%2 = tail call i32 (...) @CIN_OGM_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *prog, int N) {
  int i;
  for (i = 0; i < N; i++) {
    printf("%d ", prog[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void manos_check_watcher_destroy(void *watcher) { free(watcher); }


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

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

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

LLVM IR (-O2):
define void @manos_check_watcher_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_res_function_list();
void res_init() { register_res_function_list(); }


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

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

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

LLVM IR (-O2):
define void @res_init() {
%1 = tail call i32 (...) @register_res_function_list()
ret void
}
int test_imm_2Duint8_reg(unsigned char val) {
  return ((val) & (-0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffd3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_2Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -45
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ mark_and_replace(char, char, char *);
char *reader();
int main(int argc, char const *argv[]) {
  char *str_1 = reader();
  mark_and_replace('a', 'b', str_1);
  free(str_1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <reader@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x61,%edi
mov    $0x62,%esi
call   1040 <mark_and_replace@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <reader@plt>
mov    %rax,%rbx
mov    $0x61,%edi
mov    $0x62,%esi
mov    %rax,%rdx
call   1040 <mark_and_replace@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* (...) @reader()
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @mark_and_replace(i8 signext 97, i8 signext 98, i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @reader()
%4 = tail call i32 @mark_and_replace(i8 signext 97, i8 signext 98, i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
int ENOTSUP;
int cpu_validate_image_cpuinfo_single(void) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<cpu_validate_image_cpuinfo_single>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @cpu_validate_image_cpuinfo_single() {
%1 = load i32, i32* @ENOTSUP
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @cpu_validate_image_cpuinfo_single() {
%1 = load i32, i32* @ENOTSUP
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Type definitions */
typedef unsigned char uint16_t;

/* Variables and functions */
uint16_t bs_read_2(unsigned char *ptr) { return (ptr[0] << 8) | ptr[1]; }


x86 assembly (clang, -O0):
<bs_read_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_read_2>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @bs_read_2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @bs_read_2(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
/* Type definitions */
struct itimerval {
  int dummy;
};
typedef enum __itimer_which { ____Placeholder___itimer_which } __itimer_which;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setitimer(enum __itimer_which which, const struct itimerval *new,
                struct itimerval *old) {
  if (new == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setitimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <__setitimer+0x38>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <__setitimer+0x4d>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setitimer>:
push   %rax
test   %rsi,%rsi
jne    111f <__setitimer+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__setitimer+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.itimerval*
%7 = alloca %struct.itimerval*
store i32 %0, i32* %5
store %struct.itimerval* %1, %struct.itimerval** %6
store %struct.itimerval* %2, %struct.itimerval** %7
%8 = load %struct.itimerval*, %struct.itimerval** %6
%9 = icmp eq %struct.itimerval* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* @EINVAL
%12 = call i32 @__set_errno(i32 %11)
store i32 -1, i32* %4
br label %16
13: ; preds = %3
%14 = load i32, i32* @ENOSYS
%15 = call i32 @__set_errno(i32 %14)
store i32 -1, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__setitimer(i32 %0, %struct.itimerval* readnone %1, %struct.itimerval* nocapture readnone %2) {
%4 = icmp eq %struct.itimerval* %1, null
%5 = load i32, i32* @EINVAL
%6 = load i32, i32* @ENOSYS
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @__set_errno(i32 %7)
ret i32 -1
}
/* Variables and functions */
unsigned long mem_get_size(void *);
int /*<<< orphan*/ memcmp(void *, void *, unsigned long);
unsigned char mem_compare(void *a, void *b) {
  unsigned long len = mem_get_size(a);
  unsigned long len2 = mem_get_size(b);
  if (len != len2)
    return (0);
  return (!memcmp(a, b, len));
}


x86 assembly (clang, -O0):
<mem_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mem_get_size@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <mem_get_size@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1161 <mem_compare+0x41>
movb   $0x0,-0x1(%rbp)
jmp    1182 <mem_compare+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_compare>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <mem_get_size@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <mem_get_size@plt>
cmp    %rax,%rbx
jne    1155 <mem_compare+0x35>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <bcmp@plt>
test   %eax,%eax
sete   %al
jmp    1157 <mem_compare+0x37>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define zeroext i8 @mem_compare(i8* %0, i8* %1) {
%3 = tail call i64 @mem_get_size(i8* %0)
%4 = tail call i64 @mem_get_size(i8* %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %2, %6
%11 = phi i8 [ %9, %6 ], [ 0, %2 ]
ret i8 %11
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_UART_RXD1_PIN() { return 0x01 & (inp_emulate(0x44) >> 2); }


x86 assembly (clang, -O0):
<TOSH_READ_UART_RXD1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <inp_emulate@plt>
sar    $0x2,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_UART_RXD1_PIN>:
push   %rax
mov    $0x44,%edi
call   1030 <inp_emulate@plt>
shr    $0x2,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_UART_RXD1_PIN() {
%1 = call i32 @inp_emulate(i32 68)
%2 = ashr i32 %1, 2
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_UART_RXD1_PIN() {
%1 = tail call i32 @inp_emulate(i32 68)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 2
%4 = and i8 %3, 1
ret i8 %4
}
void test17(void) {
  int a = 100;
  int b = 1000;
  long int longa;
  a = sizeof(b = 2000U);
}


x86 assembly (clang, -O0):
<test17>:
push   %rbp
mov    %rsp,%rbp
movl   $0x64,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movl   $0x4,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test17() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 100, i32* %1
store i32 1000, i32* %2
store i32 4, i32* %1
ret void
}

LLVM IR (-O2):
define void @test17() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LcdWriteChar(int);
int /*<<< orphan*/ LcdXY(int /*<<< orphan*/, int /*<<< orphan*/);
void ClearScreen() {
  LcdXY(0, 0);
  for (int i = 0; i < 504; ++i) {
    LcdWriteChar(0x20);
  }
}


x86 assembly (clang, -O0):
<ClearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <LcdXY@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f8,-0x4(%rbp)
jge    115d <ClearScreen+0x3d>
mov    $0x20,%edi
call   1040 <LcdWriteChar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <ClearScreen+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearScreen>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <LcdXY@plt>
mov    $0x1f8,%ebx
nop
mov    $0x20,%edi
call   1040 <LcdWriteChar@plt>
add    $0xffffffff,%ebx
jne    1130 <ClearScreen+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ClearScreen() {
%1 = alloca i32
%2 = call i32 @LcdXY(i32 0, i32 0)
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 504
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @LcdWriteChar(i32 32)
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ClearScreen() {
%1 = tail call i32 @LcdXY(i32 0, i32 0)
br label %3
2: ; preds = %3
ret void
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @LcdWriteChar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 504
br i1 %7, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_constStaticSizedArray(int *);
void f_11(void) {
  int t[10];
  doStuff_constStaticSizedArray(t);
}


x86 assembly (clang, -O0):
<f_11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <doStuff_constStaticSizedArray@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_11>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <doStuff_constStaticSizedArray@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @f_11() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @doStuff_constStaticSizedArray(i32* %2)
ret void
}

LLVM IR (-O2):
define void @f_11() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_constStaticSizedArray(i32* %3)
ret void
}
void __attribute__((section(".after_vectors"))) UsageFault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UsageFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UsageFault_Handler+0x9>
jmp    1109 <UsageFault_Handler+0x9>

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

LLVM IR (-O0):
define void @UsageFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UsageFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
int Kit_DsdLitNotCond(int Lit, int c) { return Lit ^ (int)(c > 0); }


x86 assembly (clang, -O0):
<Kit_DsdLitNotCond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x8(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_DsdLitNotCond>:
xor    %eax,%eax
test   %esi,%esi
setg   %al
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @Kit_DsdLitNotCond(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = xor i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @Kit_DsdLitNotCond(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = zext i1 %3 to i32
%5 = xor i32 %4, %0
ret i32 %5
}
void av_frame_move_ref() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_move_ref() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ out_of_memory();
void *xmalloc(size_t size) {
  void *p = malloc(size ? size : 1);
  if (p == NULL) {
    out_of_memory();
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <xmalloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <xmalloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1152 <xmalloc+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <xmalloc+0x51>
mov    $0x0,%al
call   1030 <out_of_memory@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <xmalloc+0x21>
xor    %eax,%eax
call   1030 <out_of_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @out_of_memory()
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void memleak_insert_aliases(struct memleak_offset *ml_off_start,
                            struct memleak_offset *ml_off_end) {}


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

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

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

LLVM IR (-O2):
%struct.memleak_offset = type opaque
define void @memleak_insert_aliases(%struct.memleak_offset* nocapture %0, %struct.memleak_offset* nocapture %1) {
ret void
}
/* Type definitions */
struct music_pipe {
  int dummy;
};

/* Variables and functions */
scalar_t__ music_pipe_size(struct music_pipe const *);
bool music_pipe_empty(const struct music_pipe *mp) {
  return music_pipe_size(mp) == 0;
}


x86 assembly (clang, -O0):
<music_pipe_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <music_pipe_size@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<music_pipe_empty>:
push   %rax
call   1030 <music_pipe_size@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.music_pipe = type { i32 }
define i32 @music_pipe_empty(%struct.music_pipe* %0) {
%2 = alloca %struct.music_pipe*
store %struct.music_pipe* %0, %struct.music_pipe** %2
%3 = load %struct.music_pipe*, %struct.music_pipe** %2
%4 = call i64 @music_pipe_size(%struct.music_pipe* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.music_pipe = type { i32 }
define i32 @music_pipe_empty(%struct.music_pipe* %0) {
%2 = tail call i64 @music_pipe_size(%struct.music_pipe* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int isalpha(int c) { return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <isalpha+0x24>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1147 <isalpha+0x47>
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     1141 <isalpha+0x41>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 97, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
size_t unknown_function();
void l5_external_Warn_Bad() {
  int a[10];
  a[unknown_function()] = 0;
}


x86 assembly (clang, -O0):
<l5_external_Warn_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <unknown_function@plt>
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @l5_external_Warn_Bad() {
%1 = alloca [10 x i32]
%2 = call i64 (...) @unknown_function()
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %2
store i32 0, i32* %3
ret void
}

LLVM IR (-O2):
define void @l5_external_Warn_Bad() {
%1 = tail call i64 (...) @unknown_function()
ret void
}
void blk_backing_dev_unplug(struct backing_dev_info *bdi, struct page *page) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.backing_dev_info = type opaque
%struct.page = type opaque
define void @blk_backing_dev_unplug(%struct.backing_dev_info* nocapture %0, %struct.page* nocapture %1) {
ret void
}
int f_ge_rc1(float a1) { return (((a1) >= (100))); }


x86 assembly (clang, -O0):
<f_ge_rc1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ge_rc1>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_ge_rc1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_ge_rc1(float %0) {
%2 = fcmp oge float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
const char *SKP_Silk_SDK_get_version() {
  static const char version[] = "1.0.8";
  return version;
}


x86 assembly (clang, -O0):
<SKP_Silk_SDK_get_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SKP_Silk_SDK_get_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@SKP_Silk_SDK_get_version.version = internal constant [6 x i8] c"1.0.8\00"
define i8* @SKP_Silk_SDK_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @SKP_Silk_SDK_get_version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@SKP_Silk_SDK_get_version.version = internal constant [6 x i8] c"1.0.8\00"
define i8* @SKP_Silk_SDK_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @SKP_Silk_SDK_get_version.version, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ft_memdel(void **);
void ft_strdel(char **a_str) {
  if (!a_str)
    return;
  ft_memdel((void **)a_str);
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_strdel+0x1c>
jmp    1135 <ft_strdel+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <ft_memdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     111a <ft_strdel+0xa>
jmp    1030 <ft_memdel@plt>
ret

LLVM IR (-O0):
define void @ft_strdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = call i32 @ft_memdel(i8** %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @ft_memdel(i8** %0)
br label %5
5: ; preds = %1, %3
ret void
}
void pptp_shutdown() {}


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

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

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

LLVM IR (-O2):
define void @pptp_shutdown() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ fatal_util(char *);
void *calloc_util(size_t numobjs, size_t size) {
  void *ret;
  if ((ret = calloc(numobjs, size)) == NULL)
    fatal_util("calloc_util: Out of memory");
  return ret;
}


x86 assembly (clang, -O0):
<calloc_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1157 <calloc_util+0x37>
lea    0xeae(%rip),%rdi
call   1030 <fatal_util@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_util>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <calloc_util+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fatal_util@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"calloc_util: Out of memory\00"
define i8* @calloc_util(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @fatal_util(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"calloc_util: Out of memory\00"
define noalias i8* @calloc_util(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal_util(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
unsigned short __lzcnt16(unsigned short);
unsigned short __attribute__((__target__("lzcnt")))
lzcnt16_wrap(unsigned short x) {
  return __lzcnt16(x);
}


x86 assembly (clang, -O0):
<lzcnt16_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <__lzcnt16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzcnt16_wrap>:
jmp    1030 <__lzcnt16@plt>

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

LLVM IR (-O2):
define zeroext i16 @lzcnt16_wrap(i16 zeroext %0) {
%2 = tail call zeroext i16 @__lzcnt16(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int strcmp(char *, char *);
int _zzip_fnmatch(char *pattern, char *string, int flags) {
  return strcmp(pattern, string);
}


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

x86 assembly (clang, -O2):
<_zzip_fnmatch>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_zzip_fnmatch(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcmp(i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_zzip_fnmatch(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mc_int64_value(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int64_t proto_read_int64(char *p, int len) {
  char num[32] = {0};
  strncpy(num, p, len);
  return mc_int64_value(num);
}


x86 assembly (clang, -O0):
<proto_read_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
lea    -0x30(%rbp),%rdi
call   1050 <mc_int64_value@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto_read_int64>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1040 <mc_int64_value@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @proto_read_int64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [32 x i8]* %5 to i8*
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%12 = call i32 @mc_int64_value(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @proto_read_int64(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %0, i32 %1)
%6 = call i32 @mc_int64_value(i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "9ls [-dU] [-p port] [-u user] addr path\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"9ls [-dU] [-p port] [-u user] addr path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"9ls [-dU] [-p port] [-u user] addr path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int *malloc(int);
int *getheap2() { return malloc(100); }


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

x86 assembly (clang, -O2):
<getheap2>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @getheap2() {
%1 = call i32* @malloc(i32 100)
ret i32* %1
}

LLVM IR (-O2):
define noalias i32* @getheap2() {
%1 = tail call i32* @malloc(i32 100)
ret i32* %1
}
/* Variables and functions */
int gen_rand();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  while (i < 20) {
    printf("%d\n", (int)(gen_rand() * 1000) % 3);
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1171 <main+0x51>
mov    $0x0,%al
call   1040 <gen_rand@plt>
imul   $0x3e8,%eax,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x13,%ebp
lea    0xed1(%rip),%rbx
nop
xor    %eax,%eax
call   1040 <gen_rand@plt>
imul   $0x3e8,%eax,%eax
movslq %eax,%rsi
imul   $0x55555556,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %7, %1 ]
%3 = tail call i32 (...) @gen_rand()
%4 = mul nsw i32 %3, 1000
%5 = srem i32 %4, 3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 20
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
int execlp(const char *file, const char *arg0, ...) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<execlp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    0xed7(%rip),%rsi
lea    0xee2(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1137 <execlp+0x27>

x86 assembly (clang, -O2):
<execlp>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <execlp+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.execlp = [7 x i8] c"execlp\00"
define i32 @execlp(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.execlp, i64 0, i64 0))
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.execlp = [7 x i8] c"execlp\00"
define i32 @execlp(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.execlp, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
br label %4
}