xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bdos_f_delete(void) {
  fprintf(stderr, "BDOS F_DELETE not yet implemented\n");
}


x86 assembly (clang, -O0):
<bdos_f_delete>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdos_f_delete>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"BDOS F_DELETE not yet implemented\0A\00"
define void @bdos_f_delete() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"BDOS F_DELETE not yet implemented\0A\00"
define void @bdos_f_delete() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
f(int i) { return i - 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    -0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, -2
ret i32 %2
}
void g_unichar_get_mirror_char() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_get_mirror_char() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void IF(char *text) { printf("%s    if:%s %s\n", "\x1B[33m", "\x1B[0m", text); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"%s if:%s %s\0A\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @IF(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s if:%s %s\0A\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @IF(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
void reverse_str(char *str, char *end) {
  if (str == end) {
    return;
  }
  end--;
  while (str < end) {
    char tmp = *str;
    *str = *end;
    *end = tmp;
    str++;
    end--;
  }
}


x86 assembly (clang, -O0):
<reverse_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    111f <reverse_str+0x1f>
jmp    1174 <reverse_str+0x74>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1174 <reverse_str+0x74>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <reverse_str+0x2b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_str>:
cmp    %rsi,%rdi
je     113c <reverse_str+0x3c>
add    $0xffffffffffffffff,%rsi
cmp    %rdi,%rsi
jbe    113c <reverse_str+0x3c>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x1(%rdi),%eax
movzbl (%rsi),%ecx
mov    %cl,-0x1(%rdi)
mov    %al,(%rsi)
add    $0xffffffffffffffff,%rsi
lea    0x1(%rdi),%rax
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1120 <reverse_str+0x20>
ret

LLVM IR (-O0):
define void @reverse_str(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
%7 = load i8*, i8** %4
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
br label %29
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %4
br label %13
13: ; preds = %17, %10
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = icmp ult i8* %14, %15
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
store i8 %19, i8* %5
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = load i8*, i8** %3
store i8 %21, i8* %22
%23 = load i8, i8* %5
%24 = load i8*, i8** %4
store i8 %23, i8* %24
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 -1
store i8* %28, i8** %4
br label %13
29: ; preds = %9, %13
ret void
}

LLVM IR (-O2):
define void @reverse_str(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, %1
%4 = getelementptr inbounds i8, i8* %1, i64 -1
%5 = icmp ugt i8* %4, %0
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %15
7: ; preds = %2, %7
%8 = phi i8* [ %13, %7 ], [ %4, %2 ]
%9 = phi i8* [ %12, %7 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = load i8, i8* %8
store i8 %11, i8* %9
store i8 %10, i8* %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 -1
%14 = icmp ult i8* %12, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
void *caller() { return (__builtin_return_address(0)); }


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

x86 assembly (clang, -O2):
<caller>:
mov    (%rsp),%rax
ret

LLVM IR (-O0):
define i8* @caller() {
%1 = call i8* @llvm.returnaddress(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @caller() {
%1 = tail call i8* @llvm.returnaddress(i32 0)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x2e() {
  Assert_real((isalpha(46) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              235, ("isalpha should be 0 for ."));
}


x86 assembly (clang, -O0):
<t_isalpha_0x2e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xeb,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x2e>:
push   %rax
mov    $0x2e,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xeb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for .\00"
define void @t_isalpha_0x2e() {
%1 = call i64 @isalpha(i32 46)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for .\00"
define void @t_isalpha_0x2e() {
%1 = tail call i64 @isalpha(i32 46)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long file_puts_thunk(unsigned long, int, unsigned long *);
unsigned long get_variable(int /*<<< orphan*/);
int /*<<< orphan*/ intern(char *);
unsigned long int kernel_puts_thunk(unsigned long int recv, int argc,
                                    unsigned long int *argv) {
  unsigned long int self = get_variable(intern("stdout"));
  return file_puts_thunk(self, argc, argv);
}


x86 assembly (clang, -O0):
<kernel_puts_thunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb6(%rip),%rdi
call   1050 <intern@plt>
mov    %eax,%edi
call   1040 <get_variable@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <file_puts_thunk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_puts_thunk>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
lea    0xec1(%rip),%rdi
call   1050 <intern@plt>
mov    %eax,%edi
call   1040 <get_variable@plt>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <file_puts_thunk@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"stdout\00"
define i64 @kernel_puts_thunk(i64 %0, i32 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%8 = call i32 @intern(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = call i64 @get_variable(i32 %8)
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i32, i32* %5
%12 = load i64*, i64** %6
%13 = call i64 @file_puts_thunk(i64 %10, i32 %11, i64* %12)
ret i64 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"stdout\00"
define i64 @kernel_puts_thunk(i64 %0, i32 %1, i64* %2) {
%4 = tail call i32 @intern(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @get_variable(i32 %4)
%6 = tail call i64 @file_puts_thunk(i64 %5, i32 %1, i64* %2)
ret i64 %6
}
char nibble_to_hex(unsigned char nibble) {
  if (nibble < 10) {
    return '0' + nibble;
  } else if (nibble < 16) {
    return 'A' + nibble - 10;
  } else {
    return '\0';
  }
}


x86 assembly (clang, -O0):
<nibble_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <nibble_to_hex+0x26>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <nibble_to_hex+0x49>
movzbl -0x2(%rbp),%eax
cmp    $0x10,%eax
jge    1145 <nibble_to_hex+0x45>
movzbl -0x2(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <nibble_to_hex+0x49>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_to_hex>:
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
xor    %edx,%edx
cmp    $0x10,%dil
movzbl %cl,%ecx
cmovae %edx,%ecx
cmp    $0xa,%dil
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @nibble_to_hex(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 48, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %23
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp slt i32 %14, 16
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = add nsw i32 65, %18
%20 = sub nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %23
22: ; preds = %12
store i8 0, i8* %2
br label %23
23: ; preds = %22, %16, %7
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @nibble_to_hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = add i8 %0, 48
%4 = icmp ult i8 %0, 16
%5 = add i8 %0, 55
%6 = select i1 %4, i8 %5, i8 0
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(void) {
  int x = 2;
  printf("%d\n", x);
}


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

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrretstk_pc();
int /*<<< orphan*/ stoend();
void clpall(void) {
  clrretstk_pc();
  stoend();
}


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

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

LLVM IR (-O0):
define void @clpall() {
%1 = call i32 (...) @clrretstk_pc()
%2 = call i32 (...) @stoend()
ret void
}

LLVM IR (-O2):
define void @clpall() {
%1 = tail call i32 (...) @clrretstk_pc()
%2 = tail call i32 (...) @stoend()
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_unget_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_unget_wch>:
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_unget_wch+0x2a>
jmp    1170 <cmd_unget_wch+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_unget_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_unget_wch+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_unget_wch(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_unget_wch(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
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
uint32_t usys_htonl(uint32_t n) { return htonl(n); }


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

x86 assembly (clang, -O2):
<usys_htonl>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i32 @usys_htonl(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRB1_get(void) { return U_WMRCORENONE_get("U_WMRB1"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB1\00"
define i32 @U_WMRB1_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB1\00"
define i32 @U_WMRB1_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int leap_year(int year) {
  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <leap_year+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <leap_year+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <leap_year+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <leap_year+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap_year>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @leap_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ check_byte_swap();
int /*<<< orphan*/ check_conversion();
int /*<<< orphan*/ check_synchronize();
int /*<<< orphan*/ check_synchsafe();
int /*<<< orphan*/ check_verify();
int /*<<< orphan*/ printf(char *);
int main() {
  check_synchsafe();
  check_byte_swap();
  check_synchronize();
  check_verify();
  check_conversion();
  printf("Passed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <check_synchsafe@plt>
mov    $0x0,%al
call   1050 <check_byte_swap@plt>
mov    $0x0,%al
call   1030 <check_synchronize@plt>
mov    $0x0,%al
call   1060 <check_verify@plt>
mov    $0x0,%al
call   1080 <check_conversion@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <check_synchsafe@plt>
xor    %eax,%eax
call   1050 <check_byte_swap@plt>
xor    %eax,%eax
call   1040 <check_synchronize@plt>
xor    %eax,%eax
call   1060 <check_verify@plt>
xor    %eax,%eax
call   1080 <check_conversion@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Passed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_synchsafe()
%3 = call i32 (...) @check_byte_swap()
%4 = call i32 (...) @check_synchronize()
%5 = call i32 (...) @check_verify()
%6 = call i32 (...) @check_conversion()
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Passed!\00"
define i32 @main() {
%1 = tail call i32 (...) @check_synchsafe()
%2 = tail call i32 (...) @check_byte_swap()
%3 = tail call i32 (...) @check_synchronize()
%4 = tail call i32 (...) @check_verify()
%5 = tail call i32 (...) @check_conversion()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ stdlib_strided_snanvariancech(int /*<<< orphan*/ const,
                                                 float const, float const *,
                                                 int /*<<< orphan*/ const);
float stdlib_strided_snanstdevch(const int64_t N, const float correction,
                                 const float *X, const int64_t stride) {
  return sqrtf(stdlib_strided_snanvariancech(N, correction, X, stride));
}


x86 assembly (clang, -O0):
<stdlib_strided_snanstdevch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <stdlib_strided_snanvariancech@plt>
mov    %eax,%edi
call   1030 <sqrtf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_snanstdevch>:
push   %rax
call   1040 <stdlib_strided_snanvariancech@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @stdlib_strided_snanstdevch(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call i32 @stdlib_strided_snanvariancech(i32 %9, float %10, float* %11, i32 %12)
%14 = call float @sqrtf(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @stdlib_strided_snanstdevch(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call i32 @stdlib_strided_snanvariancech(i32 %0, float %1, float* %2, i32 %3)
%6 = tail call float @sqrtf(i32 %5)
ret float %6
}
int delete_all_comments(int type, char *host_name, char *svc_description) {}


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

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

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

LLVM IR (-O2):
define i32 @delete_all_comments(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_msgget;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int);
int msgget(key_t key, int msgflg) { return syscall(__NR_msgget, key, msgflg); }


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

x86 assembly (clang, -O2):
<msgget>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_msgget = global i32 0
define i32 @msgget(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_msgget
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\n Hello World");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"\0A Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0A Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_nest_lock_t;

/* Variables and functions */
void c_pomp_init_nest_lock_(omp_nest_lock_t *s) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @c_pomp_init_nest_lock_(i32* nocapture %0) {
ret void
}
int main(void) { return (__builtin_clz(42)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1a,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 26
}
/* Variables and functions */
void *malloc(size_t);
void *a_malloc(size_t size) {
  void *ptr = NULL;
  long diff;
  ptr = malloc(size + 32);
  if (ptr) {
    diff = ((~(long)ptr) & (32 - 1)) + 1;
    ptr = (char *)ptr + diff;
    ((char *)ptr)[-1] = (char)diff;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<a_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <a_malloc+0x5d>
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    $0x1f,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,-0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_malloc>:
push   %rax
add    $0x20,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     113c <a_malloc+0x2c>
mov    %eax,%edx
and    $0x1f,%edx
mov    $0x20,%esi
sub    %rdx,%rsi
mov    %rax,%rcx
add    %rsi,%rcx
neg    %rdx
mov    %sil,0x1f(%rax,%rdx,1)
jmp    113e <a_malloc+0x2e>
xor    %ecx,%ecx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @a_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
store i8* null, i8** %3
%5 = load i64, i64* %2
%6 = add i64 %5, 32
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %23
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %11 to i64
%13 = xor i64 %12, -1
%14 = and i64 %13, 31
%15 = add nsw i64 %14, 1
store i64 %15, i64* %4
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8* %18, i8** %3
%19 = load i64, i64* %4
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 -1
store i8 %20, i8* %22
br label %23
23: ; preds = %10, %1
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @a_malloc(i64 %0) {
%2 = add i64 %0, 32
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = ptrtoint i8* %3 to i64
%7 = and i64 %6, 31
%8 = sub nuw nsw i64 32, %7
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = trunc i64 %8 to i8
%11 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 %10, i8* %11
br label %12
12: ; preds = %5, %1
%13 = phi i8* [ %9, %5 ], [ null, %1 ]
ret i8* %13
}
int main(int argc, char **argv) {
  __asm__("movl $0x88888888, %esi\n\t"
          "movl $0x40000000, %edi\n\t"
          "movl $10, %ecx\n\t"
          "rep/movsl");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x88888888,%esi
mov    $0x40000000,%edi
mov    $0xa,%ecx
rep movsl %ds:(%rsi),%es:(%rdi)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x88888888,%esi
mov    $0x40000000,%edi
mov    $0xa,%ecx
rep movsl %ds:(%rsi),%es:(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "movl $$0x88888888, %esi\0A\09movl $$0x40000000, %edi\0A\09movl $$10, %ecx\0A\09rep/movsl", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SysCtlResetCauseClear(uint32_t ui32Causes) {
  (*((volatile unsigned long *)(0x400FE05C))) &= ~(ui32Causes);
}


x86 assembly (clang, -O0):
<SysCtlResetCauseClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fe05c,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fe05c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlResetCauseClear>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x400fe05c
40
ret

LLVM IR (-O0):
define void @SysCtlResetCauseClear(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074782300 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074782300 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlResetCauseClear(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074782300 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074782300 to i64*)
ret void
}
void swap(int *arr, int i, int j) {
  int keys = arr[i];
  arr[i] = arr[j];
  arr[j] = keys;
}


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
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap16(uint16_t x) { return (x >> 8) | (x << 8); }


x86 assembly (clang, -O0):
<bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bswap16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
void McSrv_EnableIrq(void) {}


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

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

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

LLVM IR (-O2):
define void @McSrv_EnableIrq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doQKD(int, int);
int main(int argc, char *argv[]) {
  doQKD(4, 1000);
  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)
mov    $0x4,%edi
mov    $0x3e8,%esi
call   1030 <doQKD@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x3e8,%esi
call   1030 <doQKD@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 @doQKD(i32 4, i32 1000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @doQKD(i32 4, i32 1000)
ret i32 0
}
extern double n1n2n3n4(int n1, int n2, int n3, int n4) {
  return (double)(n1 + n2 + n3 + n4);
}


x86 assembly (clang, -O0):
<n1n2n3n4>:
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
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n1n2n3n4>:
add    %esi,%edi
add    %edx,%edi
add    %ecx,%edi
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @n1n2n3n4(i32 %0, i32 %1, i32 %2, i32 %3) {
%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
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
%16 = sitofp i32 %15 to double
ret double %16
}

LLVM IR (-O2):
define double @n1n2n3n4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
%8 = sitofp i32 %7 to double
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ hldec(int /*<<< orphan*/ *, int);
int sudp_vis(u_char *data, int len) {
  hldec(data, len);
  return (len);
}


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

x86 assembly (clang, -O2):
<sudp_vis>:
push   %rbx
mov    %esi,%ebx
call   1030 <hldec@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sudp_vis(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 @hldec(i32* %5, i32 %6)
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @sudp_vis(i32* %0, i32 returned %1) {
%3 = tail call i32 @hldec(i32* %0, i32 %1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *Show_Time_CharFormat(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *Get_date(const char *format) {
  time_t now;
  time(&now);
  return Show_Time_CharFormat(now, format);
}


x86 assembly (clang, -O0):
<Get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <Show_Time_CharFormat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_date>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1040 <time@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1030 <Show_Time_CharFormat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Get_date(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* %3)
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i8* @Show_Time_CharFormat(i32 %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @Get_date(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = load i32, i32* %2
%6 = call i8* @Show_Time_CharFormat(i32 %5, i8* %0)
ret i8* %6
}
/* Variables and functions */
double song_enable_cmd(double, double, double, int /*<<< orphan*/,
                       int /*<<< orphan*/);
double modipulategml_song_disable_volume(double songid, double ch, double cmd) {
  return song_enable_cmd(songid, ch, cmd, 0, 0);
}


x86 assembly (clang, -O0):
<modipulategml_song_disable_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
xor    %esi,%esi
mov    %esi,%edi
call   1030 <song_enable_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modipulategml_song_disable_volume>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <song_enable_cmd@plt>

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

LLVM IR (-O2):
define double @modipulategml_song_disable_volume(double %0, double %1, double %2) {
%4 = tail call double @song_enable_cmd(double %0, double %1, double %2, i32 0, i32 0)
ret double %4
}
/* Type definitions */
struct mainwindow {
  int dummy;
};

/* Variables and functions */
int low_item(struct mainwindow *);
int handle_low_item(struct mainwindow *mw) { return low_item(mw); }


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

x86 assembly (clang, -O2):
<handle_low_item>:
jmp    1030 <low_item@plt>

LLVM IR (-O0):
%struct.mainwindow = type { i32 }
define i32 @handle_low_item(%struct.mainwindow* %0) {
%2 = alloca %struct.mainwindow*
store %struct.mainwindow* %0, %struct.mainwindow** %2
%3 = load %struct.mainwindow*, %struct.mainwindow** %2
%4 = call i32 @low_item(%struct.mainwindow* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.mainwindow = type { i32 }
define i32 @handle_low_item(%struct.mainwindow* %0) {
%2 = tail call i32 @low_item(%struct.mainwindow* %0)
ret i32 %2
}
void fn00000000004017D0() { return; }


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

x86 assembly (clang, -O2):
ret

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

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


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

x86 assembly (clang, -O2):
<arg1>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg1(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
int pci_save_state(struct pci_dev *dev) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_save_state(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
%3 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_save_state(%struct.pci_dev* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_llround();
scalar_t__ llround(double);
void test_llround(double d) {
  if (llround(d) != llround(d))
    link_failure_llround();
}


x86 assembly (clang, -O0):
<test_llround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <llround@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <llround@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_llround+0x3c>
mov    $0x0,%al
call   1030 <link_failure_llround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_llround>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <llround@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <llround@plt>
cmp    %rax,%rbx
jne    1149 <test_llround+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_llround@plt>

LLVM IR (-O0):
define void @test_llround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @llround(double %3)
%5 = load double, double* %2
%6 = call i64 @llround(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_llround()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_llround(double %0) {
%2 = tail call i64 @llround(double %0)
%3 = tail call i64 @llround(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_llround()
br label %7
7: ; preds = %5, %1
ret void
}
double fn(double x, double a[], int i) {
  if (i == 0)
    return a[4];
  else
    return fn(x, a, i - 1) * x + a[4 - i];
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1141 <fn+0x31>
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <fn+0x6b>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
call   1030 <fn@plt>
movsd  -0x10(%rbp),%xmm2
mov    -0x18(%rbp),%rax
mov    $0x4,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
je     1143 <fn+0x33>
mov    %esi,%ebx
lea    -0x1(%rbx),%esi
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
call   1030 <fn@plt>
mov    $0x4,%eax
sub    %ebx,%eax
cltq
mulsd  (%rsp),%xmm0
addsd  (%r14,%rax,8),%xmm0
jmp    1149 <fn+0x39>
movsd  0x20(%r14),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @fn(double %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca i32
store double %0, double* %5
store double* %1, double** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 4
%13 = load double, double* %12
store double %13, double* %4
br label %28
14: ; preds = %3
%15 = load double, double* %5
%16 = load double*, double** %6
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 1
%19 = call double @fn(double %15, double* %16, i32 %18)
%20 = load double, double* %5
%21 = load double*, double** %6
%22 = load i32, i32* %7
%23 = sub nsw i32 4, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %21, i64 %24
%26 = load double, double* %25
%27 = call double @llvm.fmuladd.f64(double %19, double %20, double %26)
store double %27, double* %4
br label %28
28: ; preds = %14, %10
%29 = load double, double* %4
ret double %29
}

LLVM IR (-O2):
define double @fn(double %0, double* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = getelementptr inbounds double, double* %1, i64 4
%7 = load double, double* %6
br label %8
8: ; preds = %5, %10
%9 = phi double [ %17, %10 ], [ %7, %5 ]
ret double %9
10: ; preds = %3
%11 = add nsw i32 %2, -1
%12 = tail call double @fn(double %0, double* %1, i32 %11)
%13 = sub nsw i32 4, %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %1, i64 %14
%16 = load double, double* %15
%17 = tail call double @llvm.fmuladd.f64(double %12, double %0, double %16)
br label %8
}
void EVP_Cipher(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_Cipher() {
ret void
}