xunge/DecIR huggingface dataset:
void yy_1_Attributes(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_Attributes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_Attributes(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_mem_res(const unsigned char *ptr) {
  if (ptr)
    free((void *)ptr);
}


x86 assembly (clang, -O0):
<free_mem_res>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_mem_res+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_mem_res(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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_mem_res(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_jsp_comment_entities();
void all_jsp_tests() { test_jsp_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_jsp_tests() {
%1 = tail call i32 (...) @test_jsp_comment_entities()
ret void
}
void SerialClose(void) {}


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

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

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

LLVM IR (-O2):
define void @SerialClose() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void house(int number) { printf("house: %d\n", number); }


x86 assembly (clang, -O0):
<house>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<house>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"house: %d\0A\00"
define void @house(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void HDrawArc(int x0, int y0, int x1, int y1, int stAngle, int arcAngle) {}


x86 assembly (clang, -O0):
<HDrawArc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HDrawArc(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @HDrawArc(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RemoveTargetVDD();
int /*<<< orphan*/ SetSCLKHiZ();
int /*<<< orphan*/ SetSDATAHiZ();
int /*<<< orphan*/ pr_err(char *, unsigned char);
void ErrorTrap(unsigned char bErrorNumber) {
  SetSCLKHiZ();
  SetSDATAHiZ();
  RemoveTargetVDD();
  pr_err("[TKEY] ErrorTrap..%d\n", bErrorNumber);
}


x86 assembly (clang, -O0):
<ErrorTrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <SetSCLKHiZ@plt>
mov    $0x0,%al
call   1040 <SetSDATAHiZ@plt>
mov    $0x0,%al
call   1030 <RemoveTargetVDD@plt>
lea    0xe96(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1050 <pr_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorTrap>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <SetSCLKHiZ@plt>
xor    %eax,%eax
call   1040 <SetSDATAHiZ@plt>
xor    %eax,%eax
call   1030 <RemoveTargetVDD@plt>
lea    0xea1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1050 <pr_err@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"[TKEY] ErrorTrap..%d\0A\00"
define void @ErrorTrap(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @SetSCLKHiZ()
%4 = call i32 (...) @SetSDATAHiZ()
%5 = call i32 (...) @RemoveTargetVDD()
%6 = load i8, i8* %2
%7 = call i32 @pr_err(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"[TKEY] ErrorTrap..%d\0A\00"
define void @ErrorTrap(i8 zeroext %0) {
%2 = tail call i32 (...) @SetSCLKHiZ()
%3 = tail call i32 (...) @SetSDATAHiZ()
%4 = tail call i32 (...) @RemoveTargetVDD()
%5 = tail call i32 @pr_err(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret void
}
/* Variables and functions */
double log(unsigned int);
int pow(double, double);
unsigned bin_binarynodes(unsigned sz) {
  if (sz <= 2) {
    return (1);
  }
  if (sz == 3) {
    return (2);
  }
  if (sz == 4) {
    return (3);
  }
  return (pow(2.0, (log(sz) / 0.693147180559945)) - 1);
}


x86 assembly (clang, -O0):
<bin_binarynodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
ja     1141 <bin_binarynodes+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1197 <bin_binarynodes+0x77>
cmpl   $0x3,-0x8(%rbp)
jne    1157 <bin_binarynodes+0x37>
movl   $0x2,-0x4(%rbp)
jmp    1197 <bin_binarynodes+0x77>
cmpl   $0x4,-0x8(%rbp)
jne    116d <bin_binarynodes+0x4d>
movl   $0x3,-0x4(%rbp)
jmp    1197 <bin_binarynodes+0x77>
mov    -0x8(%rbp),%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe88(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe74(%rip),%xmm0
call   1040 <pow@plt>
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_binarynodes>:
mov    $0x1,%eax
cmp    $0x3,%edi
jb     1163 <bin_binarynodes+0x43>
je     1137 <bin_binarynodes+0x17>
cmp    $0x4,%edi
jne    113d <bin_binarynodes+0x1d>
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
push   %rax
call   1030 <log@plt>
movapd %xmm0,%xmm1
divsd  0xeb1(%rip),%xmm1
movsd  0xeb1(%rip),%xmm0
call   1040 <pow@plt>
add    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @bin_binarynodes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %21
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %21
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %21
15: ; preds = %11
%16 = load i32, i32* %3
%17 = call double @log(i32 %16)
%18 = fdiv double %17, 0x3FE62E42FEFA39EC
%19 = call i32 @pow(double 2.000000e+00, double %18)
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %2
br label %21
21: ; preds = %15, %14, %10, %6
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @bin_binarynodes(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %10, label %3
3: ; preds = %1
switch i32 %0, label %5 [
i32 3, label %10
i32 4, label %4
]
4: ; preds = %3
br label %10
5: ; preds = %3
%6 = tail call double @log(i32 %0)
%7 = fdiv double %6, 0x3FE62E42FEFA39EC
%8 = tail call i32 @pow(double 2.000000e+00, double %7)
%9 = add nsw i32 %8, -1
br label %10
10: ; preds = %3, %1, %5, %4
%11 = phi i32 [ 3, %4 ], [ %9, %5 ], [ 1, %1 ], [ 2, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ leak_memory();
void leak_memory_test(void **state) { leak_memory(); }


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

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

LLVM IR (-O0):
define void @leak_memory_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (...) @leak_memory()
ret void
}

LLVM IR (-O2):
define void @leak_memory_test(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @leak_memory()
ret void
}
/* Variables and functions */
int get_checksum(unsigned char *img) {
  short unsigned s;
  s = img[0x3dfffc] + (img[0x3dfffd] << 8);
  return s;
}


x86 assembly (clang, -O0):
<get_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3dfffc(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3dfffd(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_checksum>:
movzwl 0x3dfffc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_checksum(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 4063228
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 4063229
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = add nsw i32 %7, %12
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_checksum(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4063228
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 4063229
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
ret i32 %9
}
int ft_isspace(int c) {
  return (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' ||
          c == ' ');
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ft_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ft_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ft_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ft_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ft_isspace+0x5c>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 9
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 10
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 11
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 12
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 32
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cat2(char *, char *);
char *cat3(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
char *cat6(char *str1, char *str2, char *str3, char *str4, char *str5,
           char *str6) {
  return cat3(cat2(str1, str2), cat2(str3, str4), cat2(str5, str6));
}


x86 assembly (clang, -O0):
<cat6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cat2@plt>
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <cat2@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <cat2@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    %eax,%edx
call   1030 <cat3@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat6>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
call   1040 <cat2@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <cat2@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <cat2@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <cat3@plt>

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

LLVM IR (-O2):
define i8* @cat6(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @cat2(i8* %0, i8* %1)
%8 = tail call i32 @cat2(i8* %2, i8* %3)
%9 = tail call i32 @cat2(i8* %4, i8* %5)
%10 = tail call i8* @cat3(i32 %7, i32 %8, i32 %9)
ret i8* %10
}
int f(double a) { return a * a; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(double %0) {
%2 = fmul double %0, %0
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
char *strndup(char const *, size_t);
char const *strstr(char const *, char const *);
char *strspan_c(const char *str, const char *end) {
  return strndup(str, (size_t)(strstr(str, end) - str));
}


x86 assembly (clang, -O0):
<strspan_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
sub    %rax,%rsi
call   1030 <strndup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strspan_c>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strstr@plt>
sub    %rbx,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <strndup@plt>

LLVM IR (-O0):
define i8* @strspan_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strstr(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = call i8* @strndup(i8* %5, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @strspan_c(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = tail call i8* @strndup(i8* %0, i64 %6)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x34_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x34_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x34_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x34_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x34_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("It worked 0 times\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [19 x i8] c"It worked 0 times\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [18 x i8] c"It worked 0 times\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void *RoutineWithoutReplacement() {
  register void *funptr __asm__("%eax");
  return funptr;
}


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

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

LLVM IR (-O0):
define i8* @RoutineWithoutReplacement() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @RoutineWithoutReplacement() {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int rpmlget32(FILE *fp) {
  int r;
  r = getc(fp);
  r = r << 8 | getc(fp);
  r = r << 8 | getc(fp);
  r = r << 8 | getc(fp);
  return r;
}


x86 assembly (clang, -O0):
<rpmlget32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmlget32>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %eax,%ebx
shl    $0x10,%ebp
shl    $0x8,%ebx
or     %ebp,%ebx
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
or     %ebx,%ebp
shl    $0x8,%ebp
mov    %r14,%rdi
call   1030 <getc@plt>
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rpmlget32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = call i32 @getc(i32* %8)
%10 = or i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = shl i32 %11, 8
%13 = load i32*, i32** %2
%14 = call i32 @getc(i32* %13)
%15 = or i32 %12, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = shl i32 %16, 8
%18 = load i32*, i32** %2
%19 = call i32 @getc(i32* %18)
%20 = or i32 %17, %19
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @rpmlget32(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %2, 16
%5 = shl i32 %3, 8
%6 = or i32 %5, %4
%7 = tail call i32 @getc(i32* %0)
%8 = or i32 %6, %7
%9 = shl i32 %8, 8
%10 = tail call i32 @getc(i32* %0)
%11 = or i32 %9, %10
ret i32 %11
}
void foo162() {}


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

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

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

LLVM IR (-O2):
define void @foo162() {
ret void
}
/* Variables and functions */
float modff(float, float *);
float fmodf(float x, float div) {
  float n0;
  x /= div;
  x = modff(x, &n0);
  x *= div;
  return x;
}


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1030 <modff@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
push   %rax
movss  %xmm1,(%rsp)
divss  %xmm1,%xmm0
lea    0x4(%rsp),%rdi
call   1030 <modff@plt>
mulss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fdiv float %7, %6
store float %8, float* %3
%9 = load float, float* %3
%10 = call float @modff(float %9, float* %5)
store float %10, float* %3
%11 = load float, float* %4
%12 = load float, float* %3
%13 = fmul float %12, %11
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = fdiv float %0, %1
%6 = call float @modff(float %5, float* %3)
%7 = fmul float %6, %1
ret float %7
}
void media_restart(void) {}


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

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

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

LLVM IR (-O2):
define void @media_restart() {
ret void
}
unsigned long long rdtsc(void) {
  unsigned long long int x;
  __asm__ volatile(".byte 0x0f, 0x31" : "=A"(x));
  return (x);
}


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

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

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call i64 asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int foo(double, int);
int main(int argc, char **argv) {
  double y;
  return foo(y, 1);
}


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)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(double undef, i32 1)
ret i32 %3
}
void f(char *a) { __builtin_memset(a, 0, 15); }


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

x86 assembly (clang, -O2):
<f>:
movq   $0x0,0x7(%rdi)
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @f(i8* nocapture writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(15) %0, i8 0, i64 15, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ work(int);
void easy() { work(1000); }


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

x86 assembly (clang, -O2):
<easy>:
mov    $0x3e8,%edi
jmp    1030 <work@plt>

LLVM IR (-O0):
define void @easy() {
%1 = call i32 @work(i32 1000)
ret void
}

LLVM IR (-O2):
define void @easy() {
%1 = tail call i32 @work(i32 1000)
ret void
}
/* Variables and functions */
scalar_t__ myfunction(int /*<<< orphan*/);
int myfunction2(int);
int main(void) {
  int i, j;
  for (i = 0, j = 0; i < 1000; ++i)
    j += myfunction(0);
  return myfunction2(j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    116c <main+0x4c>
xor    %edi,%edi
call   1040 <myfunction@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%edi
call   1030 <myfunction2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x3e8,%ebp
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <myfunction@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <myfunction2@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i64 @myfunction(i32 0)
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = call i32 @myfunction2(i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @myfunction(i32 0)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 1000
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @myfunction2(i32 %6)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void memcpy_wrap(void *trg, void *src, size_t n) { memcpy(trg, src, n); }


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

x86 assembly (clang, -O2):
<memcpy_wrap>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @memcpy_wrap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @memcpy_wrap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
int test_imm_1Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x1F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 31
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void UARTFIFOLevelGet(uint32_t ui32Base, uint32_t *pui32TxLevel,
                      uint32_t *pui32RxLevel) {
  ;
  *pui32TxLevel = ((*((volatile uint16_t *)(ui32Base + 0xA))) & 0x1F00) >> 8;
  *pui32RxLevel = ((*((volatile uint16_t *)(ui32Base + 0xB))) & 0x1F00) >> 8;
}


x86 assembly (clang, -O0):
<UARTFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
cltq
mov    (%rax),%ecx
and    $0x1f00,%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0xb,%eax
cltq
mov    (%rax),%ecx
and    $0x1f00,%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOLevelGet>:
movslq %edi,%rax
mov    0xa(%rax),%ecx
shr    $0x8,%ecx
and    $0x1f,%ecx
mov    %ecx,(%rsi)
mov    0xb(%rax),%eax
shr    $0x8,%eax
and    $0x1f,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @UARTFIFOLevelGet(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 10
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 7936
%13 = ashr i32 %12, 8
%14 = load i32*, i32** %5
store i32 %13, i32* %14
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 11
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = and i32 %19, 7936
%21 = ashr i32 %20, 8
%22 = load i32*, i32** %6
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @UARTFIFOLevelGet(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %0, 10
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = lshr i32 %7, 8
%9 = and i32 %8, 31
store i32 %9, i32* %1
%10 = add nsw i32 %0, 11
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = lshr i32 %13, 8
%15 = and i32 %14, 31
store i32 %15, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int lock_fp(int /*<<< orphan*/ *, int /*<<< orphan*/);
int unlock_file(FILE *f) { return lock_fp(f, 0); }


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

x86 assembly (clang, -O2):
<unlock_file>:
xor    %esi,%esi
jmp    1030 <lock_fp@plt>

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

LLVM IR (-O2):
define i32 @unlock_file(i32* %0) {
%2 = tail call i32 @lock_fp(i32* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void foo(int y) {
  print_int(y);
  print_string("\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xec6(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1040 <print_int@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print_int(i32 %3)
%5 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @print_int(i32 %0)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool dvbvbittx_get_field(const uint8_t *p) { return p[0] & 0x20; }


x86 assembly (clang, -O0):
<dvbvbittx_get_field>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvbvbittx_get_field>:
mov    (%rdi),%eax
and    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @dvbvbittx_get_field(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dvbvbittx_get_field(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 32
ret i32 %3
}
int yyerror(char *s) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yyerror(i8* nocapture readnone %0) {
ret i32 0
}
int gjmp(int t) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gjmp(i32 %0) {
ret i32 0
}
double haversine_distance(double lat1, double lon1, double lat2, double lon2) {
  double d = 0.0;
  return d;
}


x86 assembly (clang, -O0):
<haversine_distance>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<haversine_distance>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @haversine_distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @haversine_distance(double %0, double %1, double %2, double %3) {
ret double 0.000000e+00
}
double tosMemory_peekReal(int base, int offs) {
  return *((double *)(base + offs));
}


x86 assembly (clang, -O0):
<tosMemory_peekReal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMemory_peekReal>:
movslq %esi,%rax
movslq %edi,%rcx
movsd  (%rax,%rcx,1),%xmm0
ret

LLVM IR (-O0):
define double @tosMemory_peekReal(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 = add nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to double*
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @tosMemory_peekReal(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to double*
%6 = load double, double* %5
ret double %6
}
int ResetLink(LinkId)
int LinkId;
{}


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

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

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

LLVM IR (-O2):
define i32 @ResetLink(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_count_cover(char *, int);
float atanf(float);
float HMM_ATanF(float Radians) {
  { _hmt_count_cover("HMM_ATanF", 462); };
  float Result = atanf(Radians);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_ATanF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x1ce,%esi
call   1030 <_hmt_count_cover@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <atanf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_ATanF>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xed2(%rip),%rdi
mov    $0x1ce,%esi
call   1030 <_hmt_count_cover@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <atanf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"HMM_ATanF\00"
define float @HMM_ATanF(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call i32 @_hmt_count_cover(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 462)
%5 = load float, float* %2
%6 = call float @atanf(float %5)
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"HMM_ATanF\00"
define float @HMM_ATanF(float %0) {
%2 = tail call i32 @_hmt_count_cover(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 462)
%3 = tail call float @atanf(float %0)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int unsetenv(const char *name __attribute__((unused))) {
  assert(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @unsetenv(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
float asinf(float);
float __ocl_asin_float(float src) { return asinf(src); }


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

x86 assembly (clang, -O2):
<__ocl_asin_float>:
jmp    1030 <asinf@plt>

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

LLVM IR (-O2):
define float @__ocl_asin_float(float %0) {
%2 = tail call float @asinf(float %0)
ret float %2
}
void hgetfs_(cw, ch) float *cw, *ch;
{ hgetfontsize(cw, ch); }


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

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

LLVM IR (-O0):
define void @hgetfs_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 (float*, float*, ...) bitcast (i32 (...)* @hgetfontsize to i32 (float*, float*, ...)*)(float* %5, float* %6)
ret void
}

LLVM IR (-O2):
define void @hgetfs_(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @hgetfontsize to i32 (float*, float*, ...)*)(float* %0, float* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts_fastcall(char *);
printarray(int A[]) {
  int i;
  i = 0;
  while (i < 100) {
    printf("%d ", A[i++]);
  }
  puts_fastcall("");
}


x86 assembly (clang, -O0):
<printarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1163 <printarray+0x43>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1133 <printarray+0x13>
lea    0xe99(%rip),%rdi
call   1040 <puts_fastcall@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
cmp    $0x64,%rbx
jne    1140 <printarray+0x20>
lea    0xea6(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts_fastcall@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @printarray(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i32, i32* %0, i64 %3
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i64 %4, 100
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = tail call i32 @puts_fastcall(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct tms {
  int /*<<< orphan*/ tms_cutime;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t get_tms_cutime(struct tms *ptms) { return ptms->tms_cutime; }


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

x86 assembly (clang, -O2):
<get_tms_cutime>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @get_tms_cutime(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load %struct.tms*, %struct.tms** %2
%4 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @get_tms_cutime(%struct.tms* nocapture %0) {
%2 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_initialize_number_of_standard_Laurentials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(123, &length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_standard_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x7b,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_standard_Laurentials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x7b,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_standard_Laurentials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 123, i32* %2, i32* undef, double* undef)
ret i32 %3
}