xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ console_putc(int /*<<< orphan*/, unsigned int);
void console_puts(char *s, unsigned int color) {
  while (*s != '\0') {
    console_putc(*s++, color);
  }
}


x86 assembly (clang, -O0):
<console_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <console_puts+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <console_putc@plt>
jmp    111f <console_puts+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_puts>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <console_puts+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <console_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <console_puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @console_puts(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @console_putc(i32 %8, i32 %1)
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int get_device_disc_id(const char *device, char **disc_id, int *num_tracks) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @get_device_disc_id(i8* nocapture readnone %0, i8** nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__8__IO__set();
void CC2420ReceiveP__CSN__set(void) { HplAtm128GeneralIOPinP__8__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ReceiveP__CSN__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__8__IO__set()
ret void
}
/* Variables and functions */
int arg_function_pointer(int, int (*)(int, int));
int use_arg_function_pointer(int i, int (*func)(int, int)) {
  return arg_function_pointer(i, func);
}


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

x86 assembly (clang, -O2):
<use_arg_function_pointer>:
jmp    1030 <arg_function_pointer@plt>

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

LLVM IR (-O2):
define i32 @use_arg_function_pointer(i32 %0, i32 (i32, i32)* %1) {
%3 = tail call i32 @arg_function_pointer(i32 %0, i32 (i32, i32)* %1)
ret i32 %3
}
/* Variables and functions */
double fd2ts(char *);
int /*<<< orphan*/ free(char *);
char *ut2fd();
double ut2ts() {
  double tsec;
  char *datestring;
  datestring = ut2fd();
  tsec = fd2ts(datestring);
  free(datestring);
  return (tsec);
}


x86 assembly (clang, -O0):
<ut2ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ut2fd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fd2ts@plt>
movsd  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut2ts>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <ut2fd@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fd2ts@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ut2ts() {
%1 = alloca double
%2 = alloca i8*
%3 = call i8* (...) @ut2fd()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call double @fd2ts(i8* %4)
store double %5, double* %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = load double, double* %1
ret double %8
}

LLVM IR (-O2):
define double @ut2ts() {
%1 = tail call i8* (...) @ut2fd()
%2 = tail call double @fd2ts(i8* %1)
%3 = tail call i32 @free(i8* %1)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n%s\n",
                "usage: ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file "
                "[target_file]",
                "       ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file "
                "... target_dir",
                "       link source_file target_file");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xf11(%rip),%rcx
lea    0xf54(%rip),%r8
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
lea    0xed2(%rip),%rdx
lea    0xf14(%rip),%rcx
lea    0xf57(%rip),%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@.str.1 = [73 x i8] c"usage: ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file [target_file]\00"
@.str.2 = [74 x i8] c" ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir\00"
@.str.3 = [36 x i8] c" link source_file target_file\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@.str.1 = [73 x i8] c"usage: ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file [target_file]\00"
@.str.2 = [74 x i8] c" ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir\00"
@.str.3 = [36 x i8] c" link source_file target_file\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void pce_log_nothing(int priority, const char *format, ...) { return; }


x86 assembly (clang, -O0):
<pce_log_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pce_log_nothing(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
char *getpass(char const *);
int main() {
  char *pass;
  const char prompt[] = "Password:";
  pass = getpass(prompt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <getpass@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x64726f7773736150,%rax
6f 72 64
mov    %rax,0x8(%rsp)
movw   $0x3a,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <getpass@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.prompt = [10 x i8] c"Password:\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca [10 x i8]
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i8* @getpass(i8* %4)
store i8* %5, i8** %1
ret i32 0
}

LLVM IR (-O2):
@__const.main.prompt = [10 x i8] c"Password:\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i8* @getpass(i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ __get_cpuid(int, unsigned int *, unsigned int *, unsigned int *,
                       unsigned int *);
int ss_crc32c_hw_enabled(void) {
  unsigned int ax, bx, cx, dx;
  if (__get_cpuid(1, &ax, &bx, &cx, &dx) == 0)
    return 0;
  return (cx & (1 << 20)) != 0;
}


x86 assembly (clang, -O0):
<ss_crc32c_hw_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <__get_cpuid@plt>
cmp    $0x0,%rax
jne    1148 <ss_crc32c_hw_enabled+0x38>
movl   $0x0,-0x4(%rbp)
jmp    115e <ss_crc32c_hw_enabled+0x4e>
mov    -0x10(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_crc32c_hw_enabled>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1030 <__get_cpuid@plt>
mov    0x8(%rsp),%edx
shr    $0x14,%edx
and    $0x1,%edx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %edx,%ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @ss_crc32c_hw_enabled() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i64 @__get_cpuid(i32 1, i32* %2, i32* %3, i32* %4, i32* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %14
9: ; preds = %0
%10 = load i32, i32* %4
%11 = and i32 %10, 1048576
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @ss_crc32c_hw_enabled() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i64 @__get_cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = icmp eq i64 %9, 0
%11 = load i32, i32* %3
%12 = lshr i32 %11, 20
%13 = and i32 %12, 1
%14 = select i1 %10, i32 0, i32 %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ read_imm();
int /*<<< orphan*/ write_src(char *, int /*<<< orphan*/);
void PUSHimm_handler(void) {
  write_src("PUSH("
            "%d"
            ");\n",
            read_imm());
}


x86 assembly (clang, -O0):
<PUSHimm_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <read_imm@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUSHimm_handler>:
push   %rax
xor    %eax,%eax
call   1030 <read_imm@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <write_src@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"PUSH(%d);\0A\00"
define void @PUSHimm_handler() {
%1 = call i32 (...) @read_imm()
%2 = call i32 @write_src(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"PUSH(%d);\0A\00"
define void @PUSHimm_handler() {
%1 = tail call i32 (...) @read_imm()
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void _set_miss(unsigned char *u) { u[2] |= (1 << 4); }


x86 assembly (clang, -O0):
<_set_miss>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
or     $0x10,%ecx
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_miss>:
orb    $0x10,0x2(%rdi)
ret

LLVM IR (-O0):
define void @_set_miss(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 16
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_miss(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = or i8 %3, 16
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("This seems like a hex numnber: %x\n", 255);
  printf("This seems like a decimal number: %d\n", 0xff);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"This seems like a hex numnber: %x\0A\00"
@.str.1 = [38 x i8] c"This seems like a decimal number: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 255)
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 255)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"This seems like a hex numnber: %x\0A\00"
@.str.1 = [38 x i8] c"This seems like a decimal number: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 255)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 255)
ret i32 0
}
char *_strcpy(char *dest, const char *src) {
  char *temp = dest;
  while ((*dest++ = *src++) != '\0')
    ;
  return temp;
}


x86 assembly (clang, -O0):
<_strcpy>:
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,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <_strcpy+0x47>
jmp    1114 <_strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <_strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @_strcpy(i8* returned 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* %0
}
void arch_spin_lock(unsigned long *lock) { *lock = 1; }


x86 assembly (clang, -O0):
<arch_spin_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_spin_lock>:
movq   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @arch_spin_lock(i64* nocapture writeonly %0) {
store i64 1, i64* %0
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvvline_set(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvvline_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvvline_set+0x2a>
jmp    1170 <cmd_mvvline_set+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvvline_set>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvvline_set+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvvline_set(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
unsigned int hx(unsigned int n) { return 3 * n * (n - 1) + 1; }


x86 assembly (clang, -O0):
<hx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hx>:
lea    -0x1(%rdi),%eax
imul   %edi,%eax
lea    (%rax,%rax,2),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @hx(i32 %0) {
%2 = mul i32 %0, 3
%3 = add i32 %0, -1
%4 = mul i32 %2, %3
%5 = add i32 %4, 1
ret i32 %5
}
int bit_get(char *data, int bit) {
  int pos = bit / 8;
  int b = bit % 8;
  if (data[pos] & (1 << b)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<bit_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1156 <bit_get+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <bit_get+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_get>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bit_get(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
void prepareCryptTable(void) {}


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

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

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

LLVM IR (-O2):
define void @prepareCryptTable() {
ret void
}
int fun1165() { return 1165; }


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

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

LLVM IR (-O0):
define i32 @fun1165() {
ret i32 1165
}

LLVM IR (-O2):
define i32 @fun1165() {
ret i32 1165
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_goto_tb0(long);
int /*<<< orphan*/ gen_op_goto_tb1(long);
void gen_op_goto_tb(int dummy, int n, long tb) {
  if (n == 0) {
    gen_op_goto_tb0((long)(tb));
  } else {
    gen_op_goto_tb1((long)(tb));
  }
}


x86 assembly (clang, -O0):
<gen_op_goto_tb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114a <gen_op_goto_tb+0x2a>
mov    -0x10(%rbp),%rdi
call   1030 <gen_op_goto_tb0@plt>
jmp    1153 <gen_op_goto_tb+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <gen_op_goto_tb1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_op_goto_tb>:
mov    %rdx,%rdi
test   %esi,%esi
je     112c <gen_op_goto_tb+0xc>
jmp    1040 <gen_op_goto_tb1@plt>
jmp    1030 <gen_op_goto_tb0@plt>

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

LLVM IR (-O2):
define void @gen_op_goto_tb(i32 %0, i32 %1, i64 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @gen_op_goto_tb0(i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @gen_op_goto_tb1(i64 %2)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
void *malloc(size_t);
void *malloc_array_1(size_t n, size_t size) {
  if (n && size > SIZE_MAX / n)
    return NULL;
  return malloc(n * size);
}


x86 assembly (clang, -O0):
<malloc_array_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <malloc_array_1+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    1162 <malloc_array_1+0x52>
movq   $0x0,-0x8(%rbp)
jmp    1174 <malloc_array_1+0x64>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_array_1>:
test   %rdi,%rdi
je     1141 <malloc_array_1+0x31>
mov    0x2ebc(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rcx
or     %rdi,%rcx
shr    $0x20,%rcx
je     1138 <malloc_array_1+0x28>
xor    %edx,%edx
div    %rdi
cmp    %rsi,%rax
jae    1141 <malloc_array_1+0x31>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %edi
cmp    %rsi,%rax
jb     1135 <malloc_array_1+0x25>
imul   %rdi,%rsi
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i8* @malloc_array_1(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i64, i64* %5
%10 = load i64, i64* @SIZE_MAX
%11 = load i64, i64* %4
%12 = udiv i64 %10, %11
%13 = icmp ugt i64 %9, %12
br i1 %13, label %14, label %15
14: ; preds = %8
store i8* null, i8** %3
br label %20
15: ; preds = %8, %2
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = mul i64 %16, %17
%19 = call i8* @malloc(i64 %18)
store i8* %19, i8** %3
br label %20
20: ; preds = %15, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define noalias i8* @malloc_array_1(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i64, i64* @SIZE_MAX
%6 = udiv i64 %5, %0
%7 = icmp ult i64 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %4, %2
%9 = mul i64 %1, %0
%10 = tail call i8* @malloc(i64 %9)
br label %11
11: ; preds = %4, %8
%12 = phi i8* [ %10, %8 ], [ null, %4 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int num) {
  printf("signal %d raised\n", num);
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"signal %d raised\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void F2(int **Y) { *Y = (int *)0; }


x86 assembly (clang, -O0):
<F2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @F2(i32** nocapture writeonly %0) {
store i32* null, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Not_Valid(char *error_message) {
  fprintf(stderr, error_message);
  fprintf(stderr, "\n");
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<Not_Valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Not_Valid>:
push   %rbx
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @Not_Valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @Not_Valid(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_EX;
int sw_flock(int, int /*<<< orphan*/);
int sw_ex_flock(int fd) { return sw_flock(fd, LOCK_EX); }


x86 assembly (clang, -O0):
<sw_ex_flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <sw_flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_ex_flock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <sw_flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
define i32 @sw_ex_flock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_EX
%5 = call i32 @sw_flock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
define i32 @sw_ex_flock(i32 %0) {
%2 = load i32, i32* @LOCK_EX
%3 = tail call i32 @sw_flock(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int strlen(char *s) {
  int n;
  for (n = 0; *s != '\0'; s++) {
    n++;
  }
  return n;
}


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

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void case_conclude(int pass, int fail) {
  if (fail == 0)
    printf("\033[0;32mall test case(s) passed, congratulations!\033[0;0m\n");
  else
    printf("\033[0;31m%d of %d test case(s) passed\033[0;0m\n", pass,
           fail + pass);
}


x86 assembly (clang, -O0):
<case_conclude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113b <case_conclude+0x2b>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1152 <case_conclude+0x42>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
add    -0x4(%rbp),%edx
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<case_conclude>:
mov    %esi,%edx
test   %esi,%esi
je     1138 <case_conclude+0x18>
mov    %edi,%esi
add    %edi,%edx
lea    0xecf(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xeec(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"\1B[0;32mall test case(s) passed, congratulations!\1B[0;0m\0A\00"
@.str.1 = [43 x i8] c"\1B[0;31m%d of %d test case(s) passed\1B[0;0m\0A\00"
define void @case_conclude(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %13)
br label %15
15: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str.1 = [43 x i8] c"\1B[0;31m%d of %d test case(s) passed\1B[0;0m\0A\00"
@str = [55 x i8] c"\1B[0;32mall test case(s) passed, congratulations!\1B[0;0m\00"
define void @case_conclude(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = add nsw i32 %1, %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
void swap(int array[], int idx1, int idx2) {
  int tmp = array[idx1];
  array[idx1] = array[idx2];
  array[idx2] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
char *strcat(s, append)
register char *s;
register const char *append;
{
  char *save = s;
  for (; *s; ++s)
    ;
  while (*s++ = *append++)
    ;
  return (save);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <strcat+0x37>
jmp    1126 <strcat+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113c <strcat+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     116b <strcat+0x6b>
jmp    113c <strcat+0x3c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_gio(int sig) { printf("GIO\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"GIO\00"
define void @catch_gio(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
int test29(int a, int b, int c, int d) {
  int x = a != b;
  int y = c != 0;
  return x * y;
}


x86 assembly (clang, -O0):
<test29>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test29>:
cmp    %esi,%edi
setne  %al
test   %edx,%edx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test29(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = mul nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test29(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = icmp ne i32 %2, 0
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void f15(void) {}


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

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

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

LLVM IR (-O2):
define void @f15() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_add_new(float *, float const *, float const *, int);
void vec3f_add_new(float result[3], const float a[3], const float b[3]) {
  vecNf_add_new(result, a, b, 3);
}


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

x86 assembly (clang, -O2):
<vec3f_add_new>:
mov    $0x3,%ecx
jmp    1030 <vecNf_add_new@plt>

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

LLVM IR (-O2):
define void @vec3f_add_new(float* %0, float* %1, float* %2) {
%4 = tail call i32 @vecNf_add_new(float* %0, float* %1, float* %2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doCriticalErrorAndQuit(char *);
void simpleArrayDestroyDebug(void *ARRAY, char *file, int line) {
  doCriticalErrorAndQuit("Not implemented!");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Not implemented!\00"
define void @simpleArrayDestroyDebug(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @doCriticalErrorAndQuit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented!\00"
define void @simpleArrayDestroyDebug(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @doCriticalErrorAndQuit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short __inw_p(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
out    %al,$0x80
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inw_p>:
mov    %edi,%edx
in     (%dx),%ax
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i16 @__inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @__inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i16 %2
}
float sacylinder(float a, float b) {
  float x = 3.141592 * 2 * a * b;
  return (x + (3.141592 * 2 * a * a));
}


x86 assembly (clang, -O0):
<sacylinder>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xead(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sacylinder>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm2
mulsd  %xmm0,%xmm2
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @sacylinder(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fmul double 0x401921FAFC8B007A, %7
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = fmul double %8, %10
%12 = fptrunc double %11 to float
store float %12, float* %5
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fmul double 0x401921FAFC8B007A, %16
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = call double @llvm.fmuladd.f64(double %17, double %19, double %14)
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
define float @sacylinder(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x401921FAFC8B007A
%5 = fpext float %1 to double
%6 = fmul double %4, %5
%7 = fptrunc double %6 to float
%8 = fpext float %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %4, double %3, double %8)
%10 = fptrunc double %9 to float
ret float %10
}