xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ glutPostRedisplay();
void reshape(int w, int h) {
  glViewport(0, 0, w, h);
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glViewport@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glViewport@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @reshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
unsigned short vx86_NBSB_Read16(int, unsigned char);
unsigned short sb_Read16(unsigned char offset) {
  return vx86_NBSB_Read16(2, offset);
}


x86 assembly (clang, -O0):
<sb_Read16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
movzbl -0x1(%rbp),%esi
call   1030 <vx86_NBSB_Read16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_Read16>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <vx86_NBSB_Read16@plt>

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

LLVM IR (-O2):
define zeroext i16 @sb_Read16(i8 zeroext %0) {
%2 = tail call zeroext i16 @vx86_NBSB_Read16(i32 2, i8 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int factorial(int);
int nombre_combinatori(int a, int b) {
  return factorial(a) / (factorial(b) * factorial(a - b));
}


x86 assembly (clang, -O0):
<nombre_combinatori>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nombre_combinatori>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nombre_combinatori(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 = call i32 @factorial(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @factorial(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @factorial(i32 %11)
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @nombre_combinatori(i32 %0, i32 %1) {
%3 = tail call i32 @factorial(i32 %0)
%4 = tail call i32 @factorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @factorial(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ strcmp(char const *, char *);
void close_filename(const char *filename, FILE *file) {
  if (strcmp(filename, "-") != 0)
    fclose(file);
}


x86 assembly (clang, -O0):
<close_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1153 <close_filename+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_filename>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     113e <close_filename+0x1e>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
define void @close_filename(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define void @close_filename(i8* %0, i32* nocapture %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %5, %2
ret void
}
char *strpcpy(char *dst, const char *src) {
  char *q = dst;
  const char *p = src;
  char ch;
  do {
    *q++ = ch = *p++;
  } while (ch);
  return q - 1;
}


x86 assembly (clang, -O0):
<strpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    %cl,-0x21(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
cmpb   $0x0,-0x21(%rbp)
jne    111c <strpcpy+0x1c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %5
}
/* Variables and functions */
char parity(char, int, int /*<<< orphan*/);
char cmd_parity(char cmd) { return parity(cmd, 3, 0); }


x86 assembly (clang, -O0):
<cmd_parity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%esi
xor    %edx,%edx
movsbl -0x1(%rbp),%edi
call   1030 <parity@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_parity>:
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <parity@plt>

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

LLVM IR (-O2):
define signext i8 @cmd_parity(i8 signext %0) {
%2 = tail call signext i8 @parity(i8 signext %0, i32 3, i32 0)
ret i8 %2
}
unsigned bitpos_invert(const unsigned bitpos, const unsigned width) {
  return ((width - 1) - bitpos) << 3;
}


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

x86 assembly (clang, -O2):
<bitpos_invert>:
not    %edi
lea    (%rdi,%rsi,1),%eax
shl    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @bitpos_invert(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub i32 %5, 1
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = shl i32 %8, 3
ret i32 %9
}

LLVM IR (-O2):
define i32 @bitpos_invert(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = add i32 %3, %1
%5 = shl i32 %4, 3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _IOW(unsigned char, int, int /*<<< orphan*/);
int /*<<< orphan*/ __u32;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int usb_raw_vbus_draw(int fd, uint32_t power) {
  return ioctl(fd, _IOW('U', 10, __u32), power);
}


x86 assembly (clang, -O0):
<usb_raw_vbus_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x55,%edi
mov    $0xa,%esi
call   1030 <_IOW@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_raw_vbus_draw>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    $0x55,%edi
mov    $0xa,%esi
call   1030 <_IOW@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
@__u32 = global i32 0
define i32 @usb_raw_vbus_draw(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* @__u32
%7 = call i32 @_IOW(i8 zeroext 85, i32 10, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @ioctl(i32 %5, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@__u32 = global i32 0
define i32 @usb_raw_vbus_draw(i32 %0, i32 %1) {
%3 = load i32, i32* @__u32
%4 = tail call i32 @_IOW(i8 zeroext 85, i32 10, i32 %3)
%5 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %1)
ret i32 %5
}
/* Type definitions */
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_gen_decls(struct html *h) { puts("<!DOCTYPE html>"); }


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

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

LLVM IR (-O0):
%struct.html = type { i32 }
@.str = [16 x i8] c"<!DOCTYPE html>\00"
define void @print_gen_decls(%struct.html* %0) {
%2 = alloca %struct.html*
store %struct.html* %0, %struct.html** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.html = type { i32 }
@.str = [16 x i8] c"<!DOCTYPE html>\00"
define void @print_gen_decls(%struct.html* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct oscap_string {
  int dummy;
};

/* Variables and functions */
scalar_t__ oscap_buffer_new();
struct oscap_string *oscap_string_new() {
  return (struct oscap_string *)oscap_buffer_new();
}


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

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

LLVM IR (-O0):
%struct.oscap_string = type { i32 }
define %struct.oscap_string* @oscap_string_new() {
%1 = call i64 (...) @oscap_buffer_new()
%2 = inttoptr i64 %1 to %struct.oscap_string*
ret %struct.oscap_string* %2
}

LLVM IR (-O2):
%struct.oscap_string = type { i32 }
define %struct.oscap_string* @oscap_string_new() {
%1 = tail call i64 (...) @oscap_buffer_new()
%2 = inttoptr i64 %1 to %struct.oscap_string*
ret %struct.oscap_string* %2
}
/* Variables and functions */
int tolower(unsigned char const);
int str_util_lowercase(const char *s) {
  return tolower(*(const unsigned char *)s);
}


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

x86 assembly (clang, -O2):
<str_util_lowercase>:
movzbl (%rdi),%edi
jmp    1030 <tolower@plt>

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

LLVM IR (-O2):
define i32 @str_util_lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
ret i32 %3
}
void Interpret(const unsigned char *pc) {
  static const void *const addresses[] = {&&l0, &&l1, &&l2};
l0:
  goto *addresses[*pc++];
l1:
  goto *addresses[*pc++];
l2:
  return;
}


x86 assembly (clang, -O0):
<Interpret>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0x2d0d(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    115a <Interpret+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0x2ce5(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    115a <Interpret+0x5a>
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<Interpret>:
movzbl (%rdi),%ecx
add    $0x1,%rdi
lea    0x2d22(%rip),%rax
jmp    *(%rax,%rcx,8)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
jmp    *(%rax,%rcx,8)
ret

LLVM IR (-O0):
@Interpret.addresses = internal constant [3 x i8*] [i8* blockaddress(@Interpret, %3), i8* blockaddress(@Interpret, %10), i8* blockaddress(@Interpret, %17)]
define void @Interpret(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %18
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8, i8* %4
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* @Interpret.addresses, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %18
10: ; preds = %18
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = zext i8 %13 to i64
%15 = getelementptr inbounds [3 x i8*], [3 x i8*]* @Interpret.addresses, i64 0, i64 %14
%16 = load i8*, i8** %15
br label %18
17: ; preds = %18
ret void
18: ; preds = %10, %3
%19 = phi i8* [ %9, %3 ], [ %16, %10 ]
indirectbr i8* %19, [label %3, label %10, label %17]
}

LLVM IR (-O2):
@Interpret.addresses = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@Interpret, %3), i8* blockaddress(@Interpret, %3), i8* blockaddress(@Interpret, %2)]
define void @Interpret(i8* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %3, %1
%4 = phi i8* [ %0, %1 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* @Interpret.addresses, i64 0, i64 %7
%9 = load i8*, i8** %8
indirectbr i8* %9, [label %3, label %2]
}
/* Variables and functions */
int genrand_int32();
double genrand_res53() {
  unsigned long a = genrand_int32() >> 5;
  unsigned long b = genrand_int32() >> 6;
  return ((a * 67108864.0) + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <genrand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @genrand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @genrand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @genrand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @genrand_res53() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @genrand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
int bin8_to_s16(unsigned char *a) { return (int)(short)(a[0] << 8) + a[1]; }


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

x86 assembly (clang, -O2):
<bin8_to_s16>:
movzbl (%rdi),%eax
shl    $0x8,%eax
movswl %ax,%ecx
movzbl 0x1(%rdi),%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bin8_to_s16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = sext i16 %4 to i32
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void putchar(int c) {
  char d = c;
  write(0, &d, 1);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 @write(i32 0, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @write(i32 0, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xchat_mail_check();
int timeout_cb(void *userdata) {
  xchat_mail_check();
  return 1;
}


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

x86 assembly (clang, -O2):
<timeout_cb>:
push   %rax
xor    %eax,%eax
call   1030 <xchat_mail_check@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @timeout_cb(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @xchat_mail_check()
ret i32 1
}
void hkgc_grab_dirty_resource() { ; }


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

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

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

LLVM IR (-O2):
define void @hkgc_grab_dirty_resource() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: mkdir [-p] directory ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: mkdir [-p] directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: mkdir [-p] directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_epel_v16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v16_8_sse4() {
ret void
}
/* Variables and functions */
int f(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int data1, data2;
  scanf("%d %d", &data1, &data2);
  printf("%d\n", f(data1, data2) % 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <f@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <f@plt>
movslq %eax,%rsi
imul   $0x10624dd3,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\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 = call i32 @f(i32 %5, i32 %6)
%8 = srem i32 %7, 1000
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\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 = call i32 @f(i32 %6, i32 %7)
%9 = srem i32 %8, 1000
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void audio_queueflush(struct audio_info_struct *ai) {}


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

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

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

LLVM IR (-O2):
%struct.audio_info_struct = type opaque
define void @audio_queueflush(%struct.audio_info_struct* nocapture %0) {
ret void
}
short test_57_2(short *mem) { return __atomic_xor_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_57_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
xor    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test_57_2+0x5d>
jmp    1125 <test_57_2+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
xor    %cx,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_57_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
xor    $0x1,%ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_57_2+0x10>
xor    $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @test_57_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 0
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw xor i16* %6, i16 %7 acq_rel
%9 = xor i16 %8, %7
store i16 %9, i16* %4
%10 = load i16, i16* %4
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @test_57_2(i16* nocapture %0) {
%2 = atomicrmw xor i16* %0, i16 1 acq_rel
%3 = xor i16 %2, 1
ret i16 %3
}
/* Variables and functions */
double simpson_helper(double (*)(double), double, double, int);
double integral(double (*f)(double), double from, double to, int precision,
                int method) {
  switch (method) {
  case 1:
  default:
    return simpson_helper(f, from, to, precision);
  }
}


x86 assembly (clang, -O0):
<integral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
jne    1142 <integral+0x32>
jmp    113d <integral+0x2d>
jmp    1142 <integral+0x32>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
call   1030 <simpson_helper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integral>:
jmp    1030 <simpson_helper@plt>

LLVM IR (-O0):
define double @integral(double (double)* %0, double %1, double %2, i32 %3, i32 %4) {
%6 = alloca double (double)*
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store double (double)* %0, double (double)** %6
store double %1, double* %7
store double %2, double* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
switch i32 %11, label %13 [
i32 1, label %12
]
12: ; preds = %5
br label %13
13: ; preds = %5, %12
%14 = load double (double)*, double (double)** %6
%15 = load double, double* %7
%16 = load double, double* %8
%17 = load i32, i32* %9
%18 = call double @simpson_helper(double (double)* %14, double %15, double %16, i32 %17)
ret double %18
}

LLVM IR (-O2):
define double @integral(double (double)* %0, double %1, double %2, i32 %3, i32 %4) {
%6 = tail call double @simpson_helper(double (double)* %0, double %1, double %2, i32 %3)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void threadpool_donothing_proc(void *args) {
  printf("Doing nothing..\n");
  sleep(1);
  printf("Done doing nothing ..\n");
  return;
}


x86 assembly (clang, -O0):
<threadpool_donothing_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadpool_donothing_proc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Doing nothing..\0A\00"
@.str.1 = [23 x i8] c"Done doing nothing ..\0A\00"
define void @threadpool_donothing_proc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Doing nothing..\00"
@str.2 = [22 x i8] c"Done doing nothing ..\00"
define void @threadpool_donothing_proc(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *do_u_strcasestr(char const *, char const *, int);
char *u_strcasestr_base(const char *haystack, const char *needle) {
  return do_u_strcasestr(haystack, needle, 1);
}


x86 assembly (clang, -O0):
<u_strcasestr_base>:
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    $0x1,%edx
call   1030 <do_u_strcasestr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_strcasestr_base>:
mov    $0x1,%edx
jmp    1030 <do_u_strcasestr@plt>

LLVM IR (-O0):
define i8* @u_strcasestr_base(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** %4
%7 = call i8* @do_u_strcasestr(i8* %5, i8* %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @u_strcasestr_base(i8* %0, i8* %1) {
%3 = tail call i8* @do_u_strcasestr(i8* %0, i8* %1, i32 1)
ret i8* %3
}
signed char GetMaxChar(void) { return ((unsigned char)-1) >> 1; }


x86 assembly (clang, -O0):
<GetMaxChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxChar>:
mov    $0x7f,%al
ret

LLVM IR (-O0):
define signext i8 @GetMaxChar() {
ret i8 127
}

LLVM IR (-O2):
define signext i8 @GetMaxChar() {
ret i8 127
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: %s keypath\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"usage: %s keypath\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"usage: %s keypath\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, const char *argv[]) {
  printf("Going to sleep for 60 seconds\n");
  sleep(60);
  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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Going to sleep for 60 seconds\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 ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 60)
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Going to sleep for 60 seconds\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 60)
ret i32 0
}
double func(double x) {
  int i;
  if (x < 3.14159265)
    return 0;
  if (x < (3 * 3.14159265) / 2)
    return x - 3.14159265;
  return -x + 2 * 3.14159265;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <func+0x29>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <func+0x84>
movsd  0xed7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1157 <func+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <func+0x84>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
xorpd  %xmm1,%xmm1
movsd  0xef4(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     1135 <func+0x35>
movsd  0xeee(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1129 <func+0x29>
addsd  0xef0(%rip),%xmm0
ret
movsd  0xedf(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @func(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 0x400921FB53C8D4F1
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %18
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp olt double %9, 0x4012D97C7ED69FB5
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load double, double* %3
%13 = fsub double %12, 0x400921FB53C8D4F1
store double %13, double* %2
br label %18
14: ; preds = %8
%15 = load double, double* %3
%16 = fneg double %15
%17 = fadd double %16, 0x401921FB53C8D4F1
store double %17, double* %2
br label %18
18: ; preds = %14, %11, %7
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @func(double %0) {
%2 = fcmp olt double %0, 0x400921FB53C8D4F1
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 0x4012D97C7ED69FB5
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = fadd double %0, 0xC00921FB53C8D4F1
br label %9
7: ; preds = %3
%8 = fsub double 0x401921FB53C8D4F1, %0
br label %9
9: ; preds = %1, %7, %5
%10 = phi double [ %6, %5 ], [ %8, %7 ], [ 0.000000e+00, %1 ]
ret double %10
}
double eval_as_double(double x) {
  double y = x;
  return y;
}


x86 assembly (clang, -O0):
<eval_as_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @eval_as_double(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void free_socket(int sockfd) { close(sockfd); }


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

x86 assembly (clang, -O2):
<free_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @free_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void fus_nametable_node_destroy(struct fus_nametable_node_t *node) {}


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

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

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

LLVM IR (-O2):
%struct.fus_nametable_node_t = type opaque
define void @fus_nametable_node_destroy(%struct.fus_nametable_node_t* nocapture %0) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare(const char *desc, const char *src) { return strcmp(desc, src); }


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void TM05_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TM05_intr() {
ret void
}
/* Variables and functions */
unsigned long long get_timeval_current();
unsigned long long get_timeval_by_diff(unsigned long long dt) {
  return get_timeval_current() + dt;
}


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

x86 assembly (clang, -O2):
<get_timeval_by_diff>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_timeval_current@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_timeval_by_diff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @get_timeval_current()
%4 = load i64, i64* %2
%5 = add i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_timeval_by_diff(i64 %0) {
%2 = tail call i64 (...) @get_timeval_current()
%3 = add i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This is nothing but text.\n");
  printf("So is this\n"
         "but on two lines.\n\n");
  printf("This final example\n"
         "is spread across several lines\n"
         "and several\nstrings\nof\noutput\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%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    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"This is nothing but text.\0A\00"
@.str.1 = [31 x i8] c"So is this\0Abut on two lines.\0A\0A\00"
@.str.2 = [82 x i8] c"This final example\0Ais spread across several lines\0Aand several\0Astrings\0Aof\0Aoutput\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"This is nothing but text.\00"
@str.3 = [30 x i8] c"So is this\0Abut on two lines.\0A\00"
@str.4 = [81 x i8] c"This final example\0Ais spread across several lines\0Aand several\0Astrings\0Aof\0Aoutput\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int hw_cores();
int mergesort_mts(void *, size_t, size_t, int (*)(void const *, void const *),
                  int);
int mergesort_mt(void *base, size_t nel, size_t width,
                 int (*compar)(const void *, const void *)) {
  return mergesort_mts(base, nel, width, compar, 2 * hw_cores());
}


x86 assembly (clang, -O0):
<mergesort_mt>:
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    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <hw_cores@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %eax,%r8d
shl    $0x1,%r8d
call   1030 <mergesort_mts@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort_mt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <hw_cores@plt>
lea    (%rax,%rax,1),%r8d
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <mergesort_mts@plt>

LLVM IR (-O0):
define i32 @mergesort_mt(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%13 = call i32 (...) @hw_cores()
%14 = mul nsw i32 2, %13
%15 = call i32 @mergesort_mts(i8* %9, i64 %10, i64 %11, i32 (i8*, i8*)* %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mergesort_mt(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 (...) @hw_cores()
%6 = shl nsw i32 %5, 1
%7 = tail call i32 @mergesort_mts(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3, i32 %6)
ret i32 %7
}
/* Variables and functions */
int particion(int *, int, int);
int quicksorth(int lista[], int f, int l) {
  int s;
  if (f < l) {
    s = particion(lista, f, l);
    quicksorth(lista, f, s);
    quicksorth(lista, s + 1, l);
  }
}


x86 assembly (clang, -O0):
<quicksorth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1171 <quicksorth+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <particion@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <quicksorth@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1040 <quicksorth@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @quicksorth(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @particion(i32* %0, i32 %6, i32 %2)
%8 = tail call i32 @quicksorth(i32* %0, i32 %6, i32 %7)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret i32 undef
}