xunge/DecIR huggingface dataset:
/* Variables and functions */
long double cosh(long double);
long double fun_cosh(long double a) { return cosh(a); }


x86 assembly (clang, -O0):
<fun_cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cosh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_cosh>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define x86_fp80 @fun_cosh(x86_fp80 %0) {
%2 = tail call x86_fp80 @cosh(x86_fp80 %0)
ret x86_fp80 %2
}
void reverse(char *buf, int sz) {}


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

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

LLVM IR (-O0):
define void @reverse(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 @reverse(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void repeat(char *theString, int numberOfTimes) {
  int i;
  for (i = 0; i < numberOfTimes; i++) {
    printf("%s", theString);
  }
}


x86 assembly (clang, -O0):
<repeat>:
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    1150 <repeat+0x40>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <repeat+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1140 <repeat+0x30>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <repeat+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @repeat(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
#define AF_INET 130
#define AF_INET6 129
#define AF_UNSPEC 128
int /*<<< orphan*/ g_return_val_if_reached(char);
char nm_utils_addr_family_to_char(int addr_family) {
  switch (addr_family) {
  case AF_UNSPEC:
    return 'X';
  case AF_INET:
    return '4';
  case AF_INET6:
    return '6';
  }
  g_return_val_if_reached('?');
}


x86 assembly (clang, -O0):
<nm_utils_addr_family_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     1157 <nm_utils_addr_family_to_char+0x47>
jmp    1131 <nm_utils_addr_family_to_char+0x21>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
je     1169 <nm_utils_addr_family_to_char+0x59>
jmp    1144 <nm_utils_addr_family_to_char+0x34>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
je     1160 <nm_utils_addr_family_to_char+0x50>
jmp    1172 <nm_utils_addr_family_to_char+0x62>
movb   $0x58,-0x1(%rbp)
jmp    117c <nm_utils_addr_family_to_char+0x6c>
movb   $0x34,-0x1(%rbp)
jmp    117c <nm_utils_addr_family_to_char+0x6c>
movb   $0x36,-0x1(%rbp)
jmp    117c <nm_utils_addr_family_to_char+0x6c>
mov    $0x3f,%edi
call   1030 <g_return_val_if_reached@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nm_utils_addr_family_to_char>:
add    $0xffffff80,%edi
cmp    $0x3,%edi
jae    1125 <nm_utils_addr_family_to_char+0x15>
shl    $0x3,%edi
mov    $0x343658,%eax
mov    %edi,%ecx
shr    %cl,%eax
ret
push   %rax
mov    $0x3f,%edi
call   1030 <g_return_val_if_reached@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define signext i8 @nm_utils_addr_family_to_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 128, label %5
i32 130, label %6
i32 129, label %7
]
5: ; preds = %1
store i8 88, i8* %2
br label %10
6: ; preds = %1
store i8 52, i8* %2
br label %10
7: ; preds = %1
store i8 54, i8* %2
br label %10
8: ; preds = %1
%9 = call i32 @g_return_val_if_reached(i8 signext 63)
br label %10
10: ; preds = %8, %7, %6, %5
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @nm_utils_addr_family_to_char(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 3
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @g_return_val_if_reached(i8 signext 63)
br label %11
6: ; preds = %1
%7 = trunc i32 %2 to i24
%8 = shl i24 %7, 3
%9 = lshr i24 3421784, %8
%10 = trunc i24 %9 to i8
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ undef, %4 ], [ %10, %6 ]
ret i8 %12
}
/* Variables and functions */
int foo(int /*<<< orphan*/, int, int, int);
int main() {
  int x;
  x = 50;
  int y = 50;
  return foo(0, 1, 2, 3) - x - y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <foo@plt>
sub    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <foo@plt>
add    $0xffffff9c,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 1, i32 2, i32 3)
%2 = add nsw i32 %1, -100
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ output(char *, ...);
void show_version() {
  output("Build at %s %s by GCC %d.%d.%d", "Mar 15 2022", "19:13:20", 9, 4, 0);
  output("https://github.com/rom1nux/mtkimg");
  output("No logo support");
  exit(0);
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xef2(%rip),%rdx
mov    $0x9,%ecx
mov    $0x4,%r8d
xor    %r9d,%r9d
mov    $0x0,%al
call   1030 <output@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <output@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <output@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef0(%rip),%rsi
lea    0xef5(%rip),%rdx
mov    $0x9,%ecx
mov    $0x4,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1030 <output@plt>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <output@plt>
lea    0xef6(%rip),%rdi
xor    %eax,%eax
call   1030 <output@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Build at %s %s by GCC %d.%d.%d\00"
@.str.1 = [12 x i8] c"Mar 15 2022\00"
@.str.2 = [9 x i8] c"19:13:20\00"
@.str.3 = [34 x i8] c"https://github.com/rom1nux/mtkimg\00"
@.str.4 = [16 x i8] c"No logo support\00"
define void @show_version() {
%1 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 9, i32 4, i32 0)
%2 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Build at %s %s by GCC %d.%d.%d\00"
@.str.1 = [12 x i8] c"Mar 15 2022\00"
@.str.2 = [9 x i8] c"19:13:20\00"
@.str.3 = [34 x i8] c"https://github.com/rom1nux/mtkimg\00"
@.str.4 = [16 x i8] c"No logo support\00"
define void @show_version() {
%1 = tail call i32 (i8*, ...) @output(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 9, i32 4, i32 0)
%2 = tail call i32 (i8*, ...) @output(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @output(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ BLS_LOAD_BINARY_SPLASH_PNG_IMG();
void display_splash() { BLS_LOAD_BINARY_SPLASH_PNG_IMG(); }


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

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

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

LLVM IR (-O2):
define void @display_splash() {
%1 = tail call i32 (...) @BLS_LOAD_BINARY_SPLASH_PNG_IMG()
ret void
}
void write_register(unsigned component, unsigned reg, unsigned value) {
  *(((unsigned *)(((component & ~(1 << 31)) | 0xFDD00000) + reg))) = value;
}


x86 assembly (clang, -O0):
<write_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
or     $0xfdd00000,%eax
add    -0x8(%rbp),%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_register>:
or     $0xfdd00000,%edi
add    %esi,%edi
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @write_register(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* %6
%8 = load i32, i32* %4
%9 = and i32 %8, 2147483647
%10 = or i32 %9, -36700160
%11 = load i32, i32* %5
%12 = add i32 %10, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @write_register(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %0, -36700160
%5 = add i32 %4, %1
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32 %2, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charrep(char, int);
int /*<<< orphan*/ printf(char *);
void display_cstates_footer(void) {
  charrep('-', 80);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<display_cstates_footer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
mov    $0x50,%esi
call   1040 <charrep@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_cstates_footer>:
push   %rax
mov    $0x2d,%edi
mov    $0x50,%esi
call   1040 <charrep@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
define void @display_cstates_footer() {
%1 = call i32 @charrep(i8 signext 45, i32 80)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @display_cstates_footer() {
%1 = tail call i32 @charrep(i8 signext 45, i32 80)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) {
  printf("fix some bugs");
  printf("add a new line\n");
  printf("hello world!\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fix some bugs\00"
@.str.1 = [16 x i8] c"add a new line\0A\00"
@.str.2 = [14 x i8] c"hello world!\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fix some bugs\00"
@str = [15 x i8] c"add a new line\00"
@str.3 = [13 x i8] c"hello world!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
void uint322netbytes(uint32_t i, uint8_t *s) {
  uint32_t ret = htonl(i);
  uint8_t *p = (uint8_t *)&ret;
  s[0] = *(p);
  s[1] = *(p + 1);
  s[2] = *(p + 2);
  s[3] = *(p + 3);
}


x86 assembly (clang, -O0):
<uint322netbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint322netbytes>:
push   %rbx
mov    %rsi,%rbx
call   1030 <htonl@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uint322netbytes(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @htonl(i32 %0)
store i32 %3, i32* %1
ret void
}
void ASN1_STRING_type(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void PrintHelp(const char *szProg) {
  printf("\n\nUsage: %s InputFileName\n\n", szProg);
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"\0A\0AUsage: %s InputFileName\0A\0A\00"
define void @PrintHelp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *xml_serialize_(char const *, int /*<<< orphan*/);
char *xml_serialize(const char *str) { return xml_serialize_(str, 0); }


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

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

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

LLVM IR (-O2):
define i8* @xml_serialize(i8* %0) {
%2 = tail call i8* @xml_serialize_(i8* %0, i32 0)
ret i8* %2
}
void f(int a[2][2]) {}


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

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

LLVM IR (-O0):
define void @f([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @f([2 x i32]* nocapture %0) {
ret void
}
void H010ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @H010ToARGB() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solve_with_quad_doubles(int max, double eps, int *nit) {
  int fail = _ada_use_c2phc(274, &max, nit, &eps);
  return fail;
}


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

x86 assembly (clang, -O2):
<solve_with_quad_doubles>:
sub    $0x18,%rsp
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x112,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @solve_with_quad_doubles(i32 %0, double %1, i32* %2) {
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%6 = call i32 @_ada_use_c2phc(i32 274, i32* %4, i32* %2, double* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ glutPostRedisplay();
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(1);
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114e <Key+0x2e>
jmp    1144 <Key+0x24>
mov    $0x1,%edi
call   1040 <exit@plt>
jmp    1153 <Key+0x33>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     112d <Key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void add_trailing_slash(char *s) {
  if (s[strlen(s) - 1] != '/')
    strcat(s, "/");
}


x86 assembly (clang, -O0):
<add_trailing_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1166 <add_trailing_slash+0x46>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_trailing_slash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    1134 <add_trailing_slash+0x14>
pop    %rbx
ret
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @add_trailing_slash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 47
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @add_trailing_slash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
void rop3_54_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_54_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_54_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_54_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
struct pipeline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pipelineFree(struct pipeline **);
int pipelineWait(struct pipeline *);
int pipelineClose(struct pipeline **pPl) {
  struct pipeline *pl = *pPl;
  int ret = 0;
  if (pl != NULL) {
    ret = pipelineWait(pl);
    pipelineFree(pPl);
  }
  return ret;
}


x86 assembly (clang, -O0):
<pipelineClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <pipelineClose+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <pipelineWait@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pipelineFree@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipelineClose>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <pipelineClose+0x21>
call   1030 <pipelineWait@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <pipelineFree@plt>
mov    %ebp,%eax
jmp    1143 <pipelineClose+0x23>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pipeline = type { i32 }
define i32 @pipelineClose(%struct.pipeline** %0) {
%2 = alloca %struct.pipeline**
%3 = alloca %struct.pipeline*
%4 = alloca i32
store %struct.pipeline** %0, %struct.pipeline*** %2
%5 = load %struct.pipeline**, %struct.pipeline*** %2
%6 = load %struct.pipeline*, %struct.pipeline** %5
store %struct.pipeline* %6, %struct.pipeline** %3
store i32 0, i32* %4
%7 = load %struct.pipeline*, %struct.pipeline** %3
%8 = icmp ne %struct.pipeline* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load %struct.pipeline*, %struct.pipeline** %3
%11 = call i32 @pipelineWait(%struct.pipeline* %10)
store i32 %11, i32* %4
%12 = load %struct.pipeline**, %struct.pipeline*** %2
%13 = call i32 @pipelineFree(%struct.pipeline** %12)
br label %14
14: ; preds = %9, %1
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
%struct.pipeline = type { i32 }
define i32 @pipelineClose(%struct.pipeline** %0) {
%2 = load %struct.pipeline*, %struct.pipeline** %0
%3 = icmp eq %struct.pipeline* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @pipelineWait(%struct.pipeline* %2)
%6 = tail call i32 @pipelineFree(%struct.pipeline** %0)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fdim(double, double);
int /*<<< orphan*/ fdimf(float, float);
int /*<<< orphan*/ fdiml(long double, long double);
void uninitvar_fdim(void) {
  float f1, f2;
  (void)fdimf(f1, f2);
  double d1, d2;
  (void)fdim(d1, d2);
  long double ld1, ld2;
  (void)fdiml(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_fdim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <fdimf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <fdim@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fdiml@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fdim>:
sub    $0x28,%rsp
call   1040 <fdimf@plt>
call   1050 <fdim@plt>
call   1030 <fdiml@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_fdim() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call i32 @fdimf(float %7, float %8)
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @fdim(double %10, double %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load x86_fp80, x86_fp80* %6
%15 = call i32 @fdiml(x86_fp80 %13, x86_fp80 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fdim() {
%1 = tail call i32 @fdimf(float undef, float undef)
%2 = tail call i32 @fdim(double undef, double undef)
%3 = tail call i32 @fdiml(x86_fp80 undef, x86_fp80 undef)
ret void
}
int endianness() {
  union {
    int i;
    char c[4];
  } bint = {0x01020304};
  return (bint.c[0] == 1);
}


x86 assembly (clang, -O0):
<endianness>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.endianness.bint = %union.anon { i32 16909060 }
define i32 @endianness() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @endianness() {
ret i32 0
}
int serial_receive_bit(int in, int reset) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @serial_receive_bit(i32 %0, i32 %1) {
ret i32 1
}
/* Type definitions */
struct pavl_table {
  int dummy;
};

/* Variables and functions */
void **pavl_probe(struct pavl_table *, void *);
void *pavl_insert(struct pavl_table *table, void *item) {
  void **p = pavl_probe(table, item);
  return p == NULL || *p == item ? NULL : *p;
}


x86 assembly (clang, -O0):
<pavl_insert>:
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   1030 <pavl_probe@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114d <pavl_insert+0x3d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1158 <pavl_insert+0x48>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1163 <pavl_insert+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pavl_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pavl_probe@plt>
test   %rax,%rax
je     112c <pavl_insert+0x1c>
mov    (%rax),%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
cmovne %rcx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pavl_table = type { i32 }
define i8* @pavl_insert(%struct.pavl_table* %0, i8* %1) {
%3 = alloca %struct.pavl_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.pavl_table* %0, %struct.pavl_table** %3
store i8* %1, i8** %4
%6 = load %struct.pavl_table*, %struct.pavl_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @pavl_probe(%struct.pavl_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp eq i8** %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %11, %2
br label %20
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
br label %20
20: ; preds = %17, %16
%21 = phi i8* [ null, %16 ], [ %19, %17 ]
ret i8* %21
}

LLVM IR (-O2):
%struct.pavl_table = type { i32 }
define i8* @pavl_insert(%struct.pavl_table* %0, i8* %1) {
%3 = tail call i8** @pavl_probe(%struct.pavl_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = select i1 %7, i8* null, i8* %6
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ null, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void DumpAscii(FILE *fp) {
  unsigned char c = 0;
  for (c = 32; c < 128; c++) {
    fwrite(&c, sizeof(c), 1, fp);
  }
  return;
}


x86 assembly (clang, -O0):
<DumpAscii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movb   $0x20,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x80,%eax
jge    1154 <DumpAscii+0x44>
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1124 <DumpAscii+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpAscii>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x20,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0x1,%ebp
cmp    $0x80,%ebp
jne    1120 <DumpAscii+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @DumpAscii(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
store i8 0, i8* %3
store i8 32, i8* %3
br label %4
4: ; preds = %11, %1
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32* %9)
br label %11
11: ; preds = %8
%12 = load i8, i8* %3
%13 = add i8 %12, 1
store i8 %13, i8* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @DumpAscii(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 32, %1 ], [ %5, %2 ]
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 128
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
void __ipipe_report_sigwake(struct task_struct *p) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__ipipe_report_sigwake(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CreateAndDestroyStack();
int /*<<< orphan*/ assert(int /*<<< orphan*/, char *);
void StackTests() { assert(CreateAndDestroyStack(), "CreateAndDestroyStack"); }


x86 assembly (clang, -O0):
<StackTests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CreateAndDestroyStack@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StackTests>:
push   %rax
xor    %eax,%eax
call   1030 <CreateAndDestroyStack@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"CreateAndDestroyStack\00"
define void @StackTests() {
%1 = call i32 (...) @CreateAndDestroyStack()
%2 = call i32 @assert(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"CreateAndDestroyStack\00"
define void @StackTests() {
%1 = tail call i32 (...) @CreateAndDestroyStack()
%2 = tail call i32 @assert(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
int HsStrcmp(char *x, char *y) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @HsStrcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
int istab(char buf[8]) { return buf[0] == 9; }


x86 assembly (clang, -O0):
<istab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<istab>:
xor    %eax,%eax
cmpb   $0x9,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @istab(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 9
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @istab(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
int xmlUCSIsTaiLe(int code) { return (((code >= 0x1950) && (code <= 0x197F))); }


x86 assembly (clang, -O0):
<xmlUCSIsTaiLe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1950,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsTaiLe+0x26>
cmpl   $0x197f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsTaiLe>:
add    $0xffffe6b0,%edi
xor    %eax,%eax
cmp    $0x30,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsTaiLe(i32 %0) {
%2 = add i32 %0, -6480
%3 = icmp ult i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ has_suffix(char const *, char const *);
int has_suffix_failed(const char *str, const char *suffix) {
  if (has_suffix(str, suffix))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<has_suffix_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <has_suffix@plt>
cmp    $0x0,%rax
je     1143 <has_suffix_failed+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <has_suffix_failed+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @has_suffix_failed(i8* %0, i8* %1) {
%3 = tail call i64 @has_suffix(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%.3lf\n", a * b / 12.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeaa(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
imul   0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xeb7(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.200000e+01
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.200000e+01
%11 = fptosi double %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTDMAEnable(unsigned long ulBase, unsigned long ulDMAFlags) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000048))) |= ulDMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMAEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x48(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMAEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
or     %r14,0x48(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @UARTBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add i64 %9, 72
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = tail call i32 @UARTBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 72
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %1
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
unsigned int video_bytes_per_pixel();
unsigned video_offset(unsigned x) { return x * video_bytes_per_pixel(); }


x86 assembly (clang, -O0):
<video_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <video_bytes_per_pixel@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_offset>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <video_bytes_per_pixel@plt>
imul   %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @video_offset(i32 %0) {
%2 = tail call i32 (...) @video_bytes_per_pixel()
%3 = mul i32 %2, %0
ret i32 %3
}
int getlength(char *input) {
  int length = 0;
  while (input[length] != 0) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<getlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <getlength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <getlength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}