xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ acos(int /*<<< orphan*/);
int /*<<< orphan*/ wPopNumber();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasACos() { wPushNumber(acos(wPopNumber())); }


x86 assembly (clang, -O0):
<wBasACos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <wPopNumber@plt>
mov    %eax,%edi
call   1040 <acos@plt>
mov    %eax,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasACos>:
push   %rax
xor    %eax,%eax
call   1050 <wPopNumber@plt>
mov    %eax,%edi
call   1040 <acos@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasACos() {
%1 = call i32 (...) @wPopNumber()
%2 = call i32 @acos(i32 %1)
%3 = call i32 @wPushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @wBasACos() {
%1 = tail call i32 (...) @wPopNumber()
%2 = tail call i32 @acos(i32 %1)
%3 = tail call i32 @wPushNumber(i32 %2)
ret void
}
char *ThisFunctionHasNotBeenTested(int Poor, char *LittleFunction) {
  (void)Poor;
  (void)LittleFunction;
  return (char *)0;
}


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

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

LLVM IR (-O0):
define i8* @ThisFunctionHasNotBeenTested(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 = load i8*, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ThisFunctionHasNotBeenTested(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: write_torture [-s <seconds>] [-b <blocksize>] <path>\n"
          "<seconds> defaults to '0' (run forever)\n"
          "<blocksize> defaults to 8092\n"
          "For best results choose a <blocksize> value that is not a\n"
          "multiple of the file system cluster size.\n");
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [230 x i8] c"usage: write_torture [-s <seconds>] [-b <blocksize>] <path>\0A<seconds> defaults to '0' (run forever)\0A<blocksize> defaults to 8092\0AFor best results choose a <blocksize> value that is not a\0Amultiple of the file system cluster size.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [230 x i8] c"usage: write_torture [-s <seconds>] [-b <blocksize>] <path>\0A<seconds> defaults to '0' (run forever)\0A<blocksize> defaults to 8092\0AFor best results choose a <blocksize> value that is not a\0Amultiple of the file system cluster size.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
int chomp(char *str) {
  if (str[strlen(str) - 1] == '\n') {
    str[strlen(str) - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1167 <chomp+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1131 <chomp+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret i32 undef
}
int get_wireway_thread_num() { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_wireway_thread_num() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_wireway_thread_num() {
ret i32 1
}
int test11(int x) { return x / -10 >= 2; }


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
xor    %eax,%eax
cmp    $0xffffffed,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @test11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp sge i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test11(i32 %0) {
%2 = icmp slt i32 %0, -19
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t g2(uint64_t x) {
  int i = 0;
  uint64_t r = x;
  do {
    r = r + 1;
  } while (r == 0 && i++ < 3);
  return r;
}


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    1147 <g2+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x3,%eax
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1117 <g2+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
inc    %rdi
mov    $0x1,%eax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @g2(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
store i32 0, i32* %3
%5 = load i64, i64* %2
store i64 %5, i64* %4
br label %6
6: ; preds = %16, %1
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 1
store i64 %8, i64* %4
br label %9
9: ; preds = %6
%10 = load i64, i64* %4
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = icmp slt i32 %13, 3
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @g2(i64 %0) {
%2 = add i64 %0, 1
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 1, i64 %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
int __sys_write(int hnd, char *buf, int len) {
  int foo = len;
  while (foo--)
    uart_putc(*buf++);
  return (len);
}


x86 assembly (clang, -O0):
<__sys_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1158 <__sys_write+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
jmp    1128 <__sys_write+0x18>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sys_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edx,%edx
je     1142 <__sys_write+0x32>
mov    %rsi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <uart_putc@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <__sys_write+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__sys_write(i32 %0, i8* nocapture %1, i32 returned %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %9, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = tail call i32 @uart_putc(i32 %11)
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret i32 %2
}
void glDeleteProgram(void) { return; }


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

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

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

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


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int unlink(char const *);
int metautils_syscall_unlink(const char *p) { return unlink(p); }


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

x86 assembly (clang, -O2):
<metautils_syscall_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @metautils_syscall_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ add_to_string(char *, char const *);
int /*<<< orphan*/ initialize_string(char *);
void build_path(char *variable, const char *base_path, const char *filename) {
  initialize_string(variable);
  add_to_string(variable, base_path);
  add_to_string(variable, "/");
  add_to_string(variable, filename);
}


x86 assembly (clang, -O0):
<build_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <initialize_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <add_to_string@plt>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <add_to_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add_to_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_path>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <initialize_string@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <add_to_string@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <add_to_string@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <add_to_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @build_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 @initialize_string(i8* %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @add_to_string(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = call i32 @add_to_string(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = call i32 @add_to_string(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @build_path(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @initialize_string(i8* %0)
%5 = tail call i32 @add_to_string(i8* %0, i8* %1)
%6 = tail call i32 @add_to_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @add_to_string(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Hello World!!\n");
  printf("\nComputer Programming");
  printf("\nRocks!!!!\nOur first program.");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello World!!\0A\00"
@.str.1 = [22 x i8] c"\0AComputer Programming\00"
@.str.2 = [30 x i8] c"\0ARocks!!!!\0AOur first program.\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"\0AComputer Programming\00"
@.str.2 = [30 x i8] c"\0ARocks!!!!\0AOur first program.\00"
@str = [14 x i8] c"Hello World!!\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int le_odd(n)
int n;
{ return ((n - 1) | 1); }


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

x86 assembly (clang, -O2):
<le_odd>:
lea    -0x1(%rdi),%eax
or     $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @le_odd(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, double);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s [-s skip] [percentile]\n"
          "       %s [-s skip] -d\n\n"
          "  percentile  select the specified percentile (default: %g)\n\n"
          "  -d          dump the histogram\n"
          "  -s skip     skip this number of samples from the beginning "
          "(default: 0)\n",
          name, name, 0.9);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec4(%rip),%rsi
movsd  0xeb4(%rip),%xmm0
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
movsd  0xec4(%rip),%xmm0
mov    %rcx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [226 x i8] c"usage: %s [-s skip] [percentile]\0A %s [-s skip] -d\0A\0A percentile select the specified percentile (default: %g)\0A\0A -d dump the histogram\0A -s skip skip this number of samples from the beginning (default: 0)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, double 9.000000e-01)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [226 x i8] c"usage: %s [-s skip] [percentile]\0A %s [-s skip] -d\0A\0A percentile select the specified percentile (default: %g)\0A\0A -d dump the histogram\0A -s skip skip this number of samples from the beginning (default: 0)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, double 9.000000e-01)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
main() {
  exit(0);
  printf("ERROR: No locking available. Running Samba would be unsafe\n");
  exit(1);
  printf("WARNING: No automated network interface determination\n");
  printf("ERROR: no seteuid method available\n");
  exit(1);
  printf("ERROR: No disk free routine!\n");
  exit(1);
  printf("ERROR: No random or srandom routine!\n");
  exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int getchar();
int PBIN(void) { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @PBIN() {
%1 = call i32 (...) @getchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @PBIN() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello World 1!");
  puts("Hello World 2!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello World 1!\00"
@.str.1 = [15 x i8] c"Hello World 2!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
__attribute__((hotpatch(0, -1))) int main(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned xrop3_88_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | T;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_88_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_88_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_88_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = xor i32 %4, %6
ret i32 %7
}
void ppu_exec() {}


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

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

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

LLVM IR (-O2):
define void @ppu_exec() {
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *khrIcdOsLibraryGetFunctionAddress(void *library,
                                        const char *functionName) {
  return dlsym(library, functionName);
}


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

x86 assembly (clang, -O2):
<khrIcdOsLibraryGetFunctionAddress>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @khrIcdOsLibraryGetFunctionAddress(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
struct opaque_auth {
  int dummy;
};
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
int /*<<< orphan*/ TRUE;
bool_t authnone_validate(AUTH *auth, struct opaque_auth *oa) { return TRUE; }


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

x86 assembly (clang, -O2):
<authnone_validate>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.opaque_auth = type { i32 }
@TRUE = global i32 0
define i32 @authnone_validate(i32* %0, %struct.opaque_auth* %1) {
%3 = alloca i32*
%4 = alloca %struct.opaque_auth*
store i32* %0, i32** %3
store %struct.opaque_auth* %1, %struct.opaque_auth** %4
%5 = load i32, i32* @TRUE
ret i32 %5
}

LLVM IR (-O2):
%struct.opaque_auth = type { i32 }
@TRUE = global i32 0
define i32 @authnone_validate(i32* nocapture readnone %0, %struct.opaque_auth* nocapture readnone %1) {
%3 = load i32, i32* @TRUE
ret i32 %3
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("\n%d", &number);
  printf("%d\n", is_prime(number));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int copy(int *a, int *b) {
  *a = *b;
  return 2;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @copy(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 = load i32, i32* %5
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret i32 2
}

LLVM IR (-O2):
define i32 @copy(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
ret i32 2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR7B_set(void) { return U_WMRCORENONE_set("U_WMR7B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR7B\00"
define i8* @U_WMR7B_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct fh_upval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fh_upval *);
void free_upval(struct fh_upval *upval) { free(upval); }


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

x86 assembly (clang, -O2):
<free_upval>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.fh_upval = type { i32 }
define void @free_upval(%struct.fh_upval* nocapture %0) {
%2 = tail call i32 @free(%struct.fh_upval* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ procdir;
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
scalar_t__ stat(char *, struct stat *);
int process_exists(pid_t pid) {
  char procdir[20];
  struct stat procstat;
  snprintf(procdir, sizeof(procdir), "/proc/%d", pid);
  return stat(procdir, &procstat) == 0;
}


x86 assembly (clang, -O0):
<process_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x14,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_exists>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <snprintf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [9 x i8] c"/proc/%d\00"
define i32 @process_exists(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca %struct.stat
store i32 %0, i32* %2
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = call i64 @stat(i8* %8, %struct.stat* %4)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [9 x i8] c"/proc/%d\00"
define i32 @process_exists(i32 %0) {
%2 = alloca [20 x i8]
%3 = alloca %struct.stat
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = bitcast %struct.stat* %3 to i8*
%6 = call i32 @snprintf(i8* %4, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i64 @stat(i8* %4, %struct.stat* %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int imul(unsigned int, unsigned int);
int mul(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *);
int main(int argc, char *argv[]) {
  unsigned int i, j;
  scanf("%d%d", &i, &j);
  printf("%d %d\n", mul(i, j), imul(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <mul@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <imul@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <mul@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1060 <imul@plt>
lea    0xe87(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @mul(i32 %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @imul(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @mul(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @imul(i32 %11, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %13)
ret i32 0
}
int setpwm(int motor, int pwm) {}


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

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

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

LLVM IR (-O2):
define i32 @setpwm(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) {
  puts("foo called");
  return;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"foo called\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"foo called\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
int read(int /*<<< orphan*/, char *, size_t);
int t_read(char *c, size_t len) {
  memset(c, 0, len * sizeof(char));
  return read(0, c, len);
}


x86 assembly (clang, -O0):
<t_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shl    $0x0,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1040 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_read>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <read@plt>

LLVM IR (-O0):
define i32 @t_read(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = mul i64 %6, 1
%8 = call i32 @memset(i8* %5, i32 0, i64 %7)
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @read(i32 0, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @t_read(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%4 = tail call i32 @read(i32 0, i8* %0, i64 %1)
ret i32 %4
}
/* Variables and functions */
long labs(long);
long c_labs(long int arg0) { return labs(arg0); }


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

x86 assembly (clang, -O2):
<c_labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @c_labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
unsigned long get_nulls_value(const struct hlist_nulls_node *ptr) {
  return ((unsigned long)ptr) >> 1;
}


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

x86 assembly (clang, -O2):
<get_nulls_value>:
mov    %rdi,%rax
shr    %rax
ret

LLVM IR (-O0):
%struct.hlist_nulls_node = type opaque
define i64 @get_nulls_value(%struct.hlist_nulls_node* %0) {
%2 = alloca %struct.hlist_nulls_node*
store %struct.hlist_nulls_node* %0, %struct.hlist_nulls_node** %2
%3 = load %struct.hlist_nulls_node*, %struct.hlist_nulls_node** %2
%4 = ptrtoint %struct.hlist_nulls_node* %3 to i64
%5 = lshr i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
%struct.hlist_nulls_node = type opaque
define i64 @get_nulls_value(%struct.hlist_nulls_node* %0) {
%2 = ptrtoint %struct.hlist_nulls_node* %0 to i64
%3 = lshr i64 %2, 1
ret i64 %3
}
/* Variables and functions */
double median_nocopy_double(int, double *);
double median_nocopy(int n, double *data) {
  return median_nocopy_double(n, data);
}


x86 assembly (clang, -O0):
<median_nocopy>:
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 <median_nocopy_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_nocopy>:
jmp    1030 <median_nocopy_double@plt>

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

LLVM IR (-O2):
define double @median_nocopy(i32 %0, double* %1) {
%3 = tail call double @median_nocopy_double(i32 %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ do_query();
int /*<<< orphan*/ wait_for_work();
int main() {
  for (;;) {
    do_query();
    wait_for_work();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_query@plt>
mov    $0x0,%al
call   1040 <wait_for_work@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <do_query@plt>
xor    %eax,%eax
call   1040 <wait_for_work@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @do_query()
%4 = call i32 (...) @wait_for_work()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @do_query()
%3 = tail call i32 (...) @wait_for_work()
br label %1
}
void f() {
  return;
  switch (1) { case 1:; }
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Time_hmsl(long, int *, int *, int *, int *);
long toMilli(long tm) {
  int h, m, s, l;
  Time_hmsl(tm, &h, &m, &s, &l);
  return ((long)h * 3600000L) + ((long)m * 60000L) + ((long)s * 1000L) +
         (long)l;
}


x86 assembly (clang, -O0):
<toMilli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <Time_hmsl@plt>
movslq -0xc(%rbp),%rax
imul   $0x36ee80,%rax,%rax
movslq -0x10(%rbp),%rcx
imul   $0xea60,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
imul   $0x3e8,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toMilli>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <Time_hmsl@plt>
movslq 0x14(%rsp),%rax
imul   $0x36ee80,%rax,%rax
movslq 0x10(%rsp),%rcx
imul   $0xea60,%rcx,%rcx
add    %rax,%rcx
movslq 0xc(%rsp),%rax
imul   $0x3e8,%rax,%rdx
add    %rcx,%rdx
movslq 0x8(%rsp),%rax
add    %rdx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @toMilli(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @Time_hmsl(i64 %7, i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %10, 3600000
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = mul nsw i64 %13, 60000
%15 = add nsw i64 %11, %14
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = mul nsw i64 %17, 1000
%19 = add nsw i64 %15, %18
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = add nsw i64 %19, %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @toMilli(i64 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @Time_hmsl(i64 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = mul nsw i64 %12, 3600000
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = mul nsw i64 %15, 60000
%17 = add nsw i64 %16, %13
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = mul nsw i64 %19, 1000
%21 = add nsw i64 %17, %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = add nsw i64 %21, %23
ret i64 %24
}
/* Variables and functions */
int /*<<< orphan*/ vertex(char, int /*<<< orphan*/, int /*<<< orphan*/);
void new_path() { vertex('Z', 0, 0); }


x86 assembly (clang, -O0):
<new_path>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5a,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <vertex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_path>:
mov    $0x5a,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <vertex@plt>

LLVM IR (-O0):
define void @new_path() {
%1 = call i32 @vertex(i8 signext 90, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @new_path() {
%1 = tail call i32 @vertex(i8 signext 90, i32 0, i32 0)
ret void
}
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int username_get(char *name) {
  struct passwd *p;
  p = getpwuid(getuid());
  if (p) {
    strcpy(name, p->pw_name);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<username_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <username_get+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
jmp    117b <username_get+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<username_get>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
test   %rax,%rax
je     115a <username_get+0x2a>
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @username_get(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.passwd*
store i8* %0, i8** %3
%5 = call i32 (...) @getuid()
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp ne %struct.passwd* %7, null
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load %struct.passwd*, %struct.passwd** %4
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @strcpy(i8* %10, i32 %13)
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @username_get(i8* %0) {
%2 = tail call i32 (...) @getuid()
%3 = tail call %struct.passwd* @getpwuid(i32 %2)
%4 = icmp eq %struct.passwd* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.passwd, %struct.passwd* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @strcpy(i8* %0, i32 %7)
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %10
}