xunge/DecIR huggingface dataset:
/* Variables and functions */
int send(int, void *, int, int /*<<< orphan*/);
int idrnet_send_buf(int sockfd, void *data, int len) {
  return send(sockfd, data, len, 0);
}


x86 assembly (clang, -O0):
<idrnet_send_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_send_buf>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @idrnet_send_buf(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ substr(char *, char *);
int main() {
  char *haystack = "aaaam";
  char *needle = "aaam";
  puts(substr(haystack, needle));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <substr@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"aaaam\00"
@.str.1 = [5 x i8] c"aaam\00"
define i32 @main() {
%1 = tail call i32 @substr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i32 %1)
ret i32 0
}
/* Type definitions */
struct timespec {
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long timer_end(struct timespec start_time) {
  struct timespec end_time;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end_time);
  long diffInNanos = end_time.tv_nsec - start_time.tv_nsec;
  return diffInNanos;
}


x86 assembly (clang, -O0):
<timer_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_end>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i64 @timer_end(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = alloca i64
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %0, i64* %5
%6 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %3)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sub nsw i64 %9, %11
store i64 %12, i64* %4
%13 = load i64, i64* %4
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i64 @timer_end(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = sub nsw i64 %7, %0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int var;
  printf("Enter a number \n");
  scanf("%d", &var);
  if (var >= 9)
    printf("%d is larger than 9 \n", var);
  else
    printf("%d is less than or equal to 9 \n", var);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x9,-0x4(%rbp)
jl     1166 <main+0x46>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <main+0x57>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x9,%esi
lea    0xea7(%rip),%rax
lea    0xeb6(%rip),%rdi
cmovge %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"%d is larger than 9 \0A\00"
@.str.3 = [32 x i8] c"%d is less than or equal to 9 \0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 9
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"%d is larger than 9 \0A\00"
@.str.3 = [32 x i8] c"%d is less than or equal to 9 \0A\00"
@str = [16 x i8] c"Enter a number \00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 8
%7 = select i1 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("C Hello world"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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"C Hello world\00"
define i32 @main() {
%1 = 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"C 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
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n%s\n", "usage: cut -b list [-n] [file ...]",
                "       cut -c list [file ...]",
                "       cut -f list [-s] [-w | -d delim] [file ...]");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@.str.1 = [35 x i8] c"usage: cut -b list [-n] [file ...]\00"
@.str.2 = [30 x i8] c" cut -c list [file ...]\00"
@.str.3 = [51 x i8] c" cut -f list [-s] [-w | -d delim] [file ...]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@.str.1 = [35 x i8] c"usage: cut -b list [-n] [file ...]\00"
@.str.2 = [30 x i8] c" cut -c list [file ...]\00"
@.str.3 = [51 x i8] c" cut -f list [-s] [-w | -d delim] [file ...]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ F_my_sub();
int /*<<< orphan*/ F_mysub();
int myc(void) {
  F_mysub();
  F_my_sub();
  return 0;
}


x86 assembly (clang, -O0):
<myc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <F_mysub@plt>
mov    $0x0,%al
call   1030 <F_my_sub@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myc>:
push   %rax
xor    %eax,%eax
call   1040 <F_mysub@plt>
xor    %eax,%eax
call   1030 <F_my_sub@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @myc() {
%1 = call i32 (...) @F_mysub()
%2 = call i32 (...) @F_my_sub()
ret i32 0
}

LLVM IR (-O2):
define i32 @myc() {
%1 = tail call i32 (...) @F_mysub()
%2 = tail call i32 (...) @F_my_sub()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int);
void testTortureExecute(void) {
  foo(0, 1);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @foo(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @foo(i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void error_exit(char *msg) {
  fputs(msg, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int /*<<< orphan*/ *);
void check_intInput(uint *a) {
  if ((scanf("%d", a)) != 1) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_intInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     116f <check_intInput+0x3f>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_intInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <check_intInput+0x17>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @check_intInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @check_intInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printUndefined(void *a) { fputs("Undefined", stdout); }


x86 assembly (clang, -O0):
<printUndefined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUndefined>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Undefined\00"
@stdout = global i32 0
define void @printUndefined(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Undefined\00"
@stdout = global i32 0
define void @printUndefined(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void isakmp_chkph1there_stub(p) void *p;
{ isakmp_chkph1there((struct ph2handle *)p); }


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

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

LLVM IR (-O0):
%struct.ph2handle = type opaque
define void @isakmp_chkph1there_stub(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.ph2handle*
%5 = call i32 (%struct.ph2handle*, ...) bitcast (i32 (...)* @isakmp_chkph1there to i32 (%struct.ph2handle*, ...)*)(%struct.ph2handle* %4)
ret void
}

LLVM IR (-O2):
%struct.ph2handle = type opaque
define void @isakmp_chkph1there_stub(i8* %0) {
%2 = bitcast i8* %0 to %struct.ph2handle*
%3 = tail call i32 (%struct.ph2handle*, ...) bitcast (i32 (...)* @isakmp_chkph1there to i32 (%struct.ph2handle*, ...)*)(%struct.ph2handle* %2)
ret void
}
/* Variables and functions */
double c2f(int);
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  for (int i = 0; i <= 200; i += 5)
    printf("%4d %4.3f\n", i, c2f(i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     116e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <c2f@plt>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffb,%ebx
lea    0xed0(%rip),%r14
add    $0x5,%ebx
mov    %ebx,%edi
call   1030 <c2f@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0xc4,%ebx
jb     1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%4d %4.3f\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call double @c2f(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3, double %4)
%6 = add nuw nsw i32 %3, 5
%7 = icmp ult i32 %3, 196
br i1 %7, label %2, label %1
}
void glOrthox(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glOrthox() {
ret void
}
void look_ast() { return; }


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

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

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

LLVM IR (-O2):
define void @look_ast() {
ret void
}
/* Variables and functions */
double cos(double);
double sqrt(double);
double dry_mapping_function(double elevation) {
  double d = cos(elevation);
  d /= 1.001012704615527;
  return (1.0 / sqrt(1.0 - d * d));
}


x86 assembly (clang, -O0):
<dry_mapping_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dry_mapping_function>:
push   %rax
call   1030 <cos@plt>
movapd %xmm0,%xmm1
divsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xeca(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1156 <dry_mapping_function+0x36>
sqrtsd %xmm0,%xmm0
jmp    1163 <dry_mapping_function+0x43>
call   1040 <sqrt@plt>
movsd  0xea5(%rip),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dry_mapping_function(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @cos(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fdiv double %6, 0x3FF00425E5D34464
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double 1.000000e+00)
%12 = call double @sqrt(double %11)
%13 = fdiv double 1.000000e+00, %12
ret double %13
}

LLVM IR (-O2):
define double @dry_mapping_function(double %0) {
%2 = tail call double @cos(double %0)
%3 = fdiv double %2, 0x3FF00425E5D34464
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.000000e+00)
%6 = tail call double @sqrt(double %5)
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
/* Variables and functions */
char *malloc(int);
int main(void) {
  char *p = malloc(1 << 24);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
short gshortxor(short x, short y) {
  x ^= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gshortxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%ecx
movswl -0x2(%rbp),%eax
xor    %ecx,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1148 <gshortxor+0x38>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gshortxor>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%ebx
test   %bx,%bx
jne    1121 <gshortxor+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @gshortxor(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = xor i32 %8, %6
%10 = trunc i32 %9 to i16
store i16 %10, i16* %3
%11 = load i16, i16* %3
%12 = icmp ne i16 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @foo(i8* null)
br label %15
15: ; preds = %13, %2
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @gshortxor(i16 signext %0, i16 signext %1) {
%3 = xor i16 %1, %0
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char const *);
int /*<<< orphan*/ setenv(char *, char const *, int);
void change_root(const char *path) {
  setenv("web_root", path, 1);
  setenv("DOCUMENT_ROOT", path, 1);
  chdir(path);
}


x86 assembly (clang, -O0):
<change_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    -0x8(%rbp),%rdi
call   1040 <chdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_root>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <chdir@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"web_root\00"
@.str.1 = [14 x i8] c"DOCUMENT_ROOT\00"
define void @change_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @setenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3, i32 1)
%5 = load i8*, i8** %2
%6 = call i32 @setenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 1)
%7 = load i8*, i8** %2
%8 = call i32 @chdir(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"web_root\00"
@.str.1 = [14 x i8] c"DOCUMENT_ROOT\00"
define void @change_root(i8* %0) {
%2 = tail call i32 @setenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%3 = tail call i32 @setenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 1)
%4 = tail call i32 @chdir(i8* %0)
ret void
}
void Fun_s2_Found_TITLE(void) {}


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

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

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

LLVM IR (-O2):
define void @Fun_s2_Found_TITLE() {
ret void
}
/* Variables and functions */
int strlen(char *);
void wo_redundant_call() {
  int i, z, len;
  char s[] = "Some meaningless chars array to call strlen.";
  len = strlen(s);
  for (i = 0, z = 0; i < len; i++)
    z++;
  return;
}


x86 assembly (clang, -O0):
<wo_redundant_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2d,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117a <wo_redundant_call+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <wo_redundant_call+0x37>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wo_redundant_call>:
sub    $0x38,%rsp
movups 0xf02(%rip),%xmm0
movups %xmm0,0x1d(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@__const.wo_redundant_call.s = [45 x i8] c"Some meaningless chars array to call strlen.\00"
define void @wo_redundant_call() {
%1 = alloca [45 x i8]
%2 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
ret void
}
/* Type definitions */
struct st_root {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
void __st_foreach_data(struct st_root *, void (*)(void *, char const *, void *),
                       void *, char *, int /*<<< orphan*/, int);
void st_foreach_data(struct st_root *root,
                     void (*func)(void *data, const char *string, void *hints),
                     void *hints) {
  char buf[64];
  return __st_foreach_data(root, func, hints, buf, 0,
                           (sizeof(buf) / sizeof(buf[0])));
}


x86 assembly (clang, -O0):
<st_foreach_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x60(%rbp),%rcx
xor    %r8d,%r8d
mov    $0x40,%r9d
call   1030 <__st_foreach_data@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_foreach_data>:
sub    $0x48,%rsp
mov    %rsp,%rcx
xor    %r8d,%r8d
mov    $0x40,%r9d
call   1030 <__st_foreach_data@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.st_root = type { i32 }
define void @st_foreach_data(%struct.st_root* %0, void (i8*, i8*, i8*)* %1, i8* %2) {
%4 = alloca %struct.st_root*
%5 = alloca void (i8*, i8*, i8*)*
%6 = alloca i8*
%7 = alloca [64 x i8]
store %struct.st_root* %0, %struct.st_root** %4
store void (i8*, i8*, i8*)* %1, void (i8*, i8*, i8*)** %5
store i8* %2, i8** %6
%8 = load %struct.st_root*, %struct.st_root** %4
%9 = load void (i8*, i8*, i8*)*, void (i8*, i8*, i8*)** %5
%10 = load i8*, i8** %6
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
ret void
}

LLVM IR (-O2):
%struct.st_root = type { i32 }
define void @st_foreach_data(%struct.st_root* %0, void (i8*, i8*, i8*)* %1, i8* %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello lyl\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"hello lyl\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int yyselect();
conditional() {
  switch (yyselect()) {
  case 57: {
    get_lexval();
  } break;
  case 58: {
    get_lexval();
  } break;
  case 59: {
    get_lexval();
  } break;
  case 60: {
    get_lexval();
  } break;
  case 61: {
    get_lexval();
  } break;
  case 62: {
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<conditional>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
add    $0xffffffc7,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1198 <conditional+0x78>
mov    -0x10(%rbp),%rax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    1198 <conditional+0x78>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    1198 <conditional+0x78>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    1198 <conditional+0x78>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    1198 <conditional+0x78>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    1198 <conditional+0x78>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
add    $0xffffffc7,%eax
cmp    $0x5,%eax
ja     1137 <conditional+0x17>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @conditional() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %15 [
i32 57, label %3
i32 58, label %5
i32 59, label %7
i32 60, label %9
i32 61, label %11
i32 62, label %13
]
3: ; preds = %0
%4 = call i32 (...) @get_lexval()
br label %15
5: ; preds = %0
%6 = call i32 (...) @get_lexval()
br label %15
7: ; preds = %0
%8 = call i32 (...) @get_lexval()
br label %15
9: ; preds = %0
%10 = call i32 (...) @get_lexval()
br label %15
11: ; preds = %0
%12 = call i32 (...) @get_lexval()
br label %15
13: ; preds = %0
%14 = call i32 (...) @get_lexval()
br label %15
15: ; preds = %0, %13, %11, %9, %7, %5, %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @conditional() {
%1 = tail call i32 (...) @yyselect()
%2 = add i32 %1, -57
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void htmlHorizontalLine() { printf("<HR ALIGN=\"CENTER\">"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"<HR ALIGN=\22CENTER\22>\00"
define void @htmlHorizontalLine() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"<HR ALIGN=\22CENTER\22>\00"
define void @htmlHorizontalLine() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void Delay() {
  unsigned int i = 999999999;
  while (i-- > 0) {
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3b9ac9ff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1124 <Delay+0x24>
jmp    110b <Delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay() {
%1 = alloca i32
store i32 999999999, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add i32 %3, -1
store i32 %4, i32* %1
%5 = icmp ugt i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @Delay() {
ret void
}
/* Variables and functions */
char *dstrndup(char *, size_t);
char *dstrpos(char const *, size_t);
char *dstrsub(const char *str, size_t pos, size_t n) {
  char *start = dstrpos(str, pos);
  if (start == NULL)
    return NULL;
  return dstrndup(start, n);
}


x86 assembly (clang, -O0):
<dstrsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <dstrpos@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115d <dstrsub+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    116e <dstrsub+0x4e>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <dstrndup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstrsub>:
push   %rbx
mov    %rdx,%rbx
call   1030 <dstrpos@plt>
test   %rax,%rax
je     113a <dstrsub+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <dstrndup@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @dstrsub(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @dstrpos(i8* %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @dstrndup(i8* %4, i64 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ null, %3 ]
ret i8* %9
}
double foo3(double b, double c) { return b / c; }


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

x86 assembly (clang, -O2):
<foo3>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @foo3(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
int /*<<< orphan*/ printf(char *, double);
double get_time(clock_t start, clock_t end) {
  double timeUsed;
  timeUsed = (double)(end - start) / CLOCKS_PER_SEC;
  printf("use time %f sec.\n", timeUsed);
  return timeUsed;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2eb4(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ec8(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [18 x i8] c"use time %f sec.\0A\00"
define double @get_time(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = sitofp i64 %8 to double
%10 = load double, double* @CLOCKS_PER_SEC
%11 = fdiv double %9, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [18 x i8] c"use time %f sec.\0A\00"
define double @get_time(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %6)
ret double %6
}
void lcd_port_init() {
  (*(volatile unsigned long *)0x56000020) = 0xaaaaaaaa;
  (*(volatile unsigned long *)0x56000030) = 0xaaaaaaaa;
}


x86 assembly (clang, -O0):
<lcd_port_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000020,%eax
mov    $0xaaaaaaaa,%ecx
mov    %rcx,(%rax)
mov    $0x56000030,%eax
mov    $0xaaaaaaaa,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_port_init>:
mov    $0xaaaaaaaa,%eax
mov    %rax,0x56000020
56
mov    %rax,0x56000030
56
ret

LLVM IR (-O0):
define void @lcd_port_init() {
store volatile i64 2863311530, i64* inttoptr (i64 1442840608 to i64*)
store volatile i64 2863311530, i64* inttoptr (i64 1442840624 to i64*)
ret void
}

LLVM IR (-O2):
define void @lcd_port_init() {
store volatile i64 2863311530, i64* inttoptr (i64 1442840608 to i64*)
store volatile i64 2863311530, i64* inttoptr (i64 1442840624 to i64*)
ret void
}
/* Variables and functions */
double log10(float);
int mbLogB(float x) {
  int t;
  if (x <= 1.18e-38f)
    return -37928;
  t = (int)(1000.0 * log10(x) + 0.5);
  return t;
}


x86 assembly (clang, -O0):
<mbLogB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113b <mbLogB+0x2b>
movl   $0xffff6bd8,-0x4(%rbp)
jmp    116a <mbLogB+0x5a>
movss  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbLogB>:
push   %rax
mov    $0xffff6bd8,%eax
movss  0xee2(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113c <mbLogB+0x2c>
call   1030 <log10@plt>
mulsd  0xed8(%rip),%xmm0
addsd  0xed8(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mbLogB(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp ole float %5, 0x38100FB320000000
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -37928, i32* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = call double @log10(float %9)
%11 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %10, double 5.000000e-01)
%12 = fptosi double %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @mbLogB(float %0) {
%2 = fcmp ugt float %0, 0x38100FB320000000
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call double @log10(float %0)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+03, double 5.000000e-01)
%6 = fptosi double %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -37928, %1 ]
ret i32 %8
}
/* Type definitions */
struct statvfs {
  int dummy;
};
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __internal_statvfs(char const *, struct statvfs *,
                                      struct statfs *, int);
scalar_t__ __statfs(char const *, struct statfs *);
int statvfs(const char *file, struct statvfs *buf) {
  struct statfs fsbuf;
  if (__statfs(file, &fsbuf) < 0)
    return -1;
  __internal_statvfs(file, buf, &fsbuf, -1);
  return 0;
}


x86 assembly (clang, -O0):
<statvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <__statfs@plt>
cmp    $0x0,%rax
jge    1153 <statvfs+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <statvfs+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0xffffffff,%ecx
call   1040 <__internal_statvfs@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statvfs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <__statfs@plt>
test   %rax,%rax
js     114e <statvfs+0x2e>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%ecx
call   1040 <__internal_statvfs@plt>
xor    %eax,%eax
jmp    1153 <statvfs+0x33>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.statvfs*
%6 = alloca %struct.statfs
store i8* %0, i8** %4
store %struct.statvfs* %1, %struct.statvfs** %5
%7 = load i8*, i8** %4
%8 = call i64 @__statfs(i8* %7, %struct.statfs* %6)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load %struct.statvfs*, %struct.statvfs** %5
%14 = call i32 @__internal_statvfs(i8* %12, %struct.statvfs* %13, %struct.statfs* %6, i32 -1)
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca %struct.statfs
%4 = bitcast %struct.statfs* %3 to i8*
%5 = call i64 @__statfs(i8* %0, %struct.statfs* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @__internal_statvfs(i8* %0, %struct.statvfs* %1, %struct.statfs* %3, i32 -1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ atomic_thread_fence(int /*<<< orphan*/);
int /*<<< orphan*/ memory_order_acquire;
void aeron_acquire() { atomic_thread_fence(memory_order_acquire); }


x86 assembly (clang, -O0):
<aeron_acquire>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <atomic_thread_fence@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_acquire>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <atomic_thread_fence@plt>

LLVM IR (-O0):
@memory_order_acquire = global i32 0
define void @aeron_acquire() {
%1 = load i32, i32* @memory_order_acquire
%2 = call i32 @atomic_thread_fence(i32 %1)
ret void
}

LLVM IR (-O2):
@memory_order_acquire = global i32 0
define void @aeron_acquire() {
%1 = load i32, i32* @memory_order_acquire
%2 = tail call i32 @atomic_thread_fence(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printer(char *);
int main() {
  char s[] = "Just one small mint wafer...!";
  printer(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <printer@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <printer@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [30 x i8] c"Just one small mint wafer...!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = bitcast [30 x i8]* %2 to i8*
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @printer(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [30 x i8] c"Just one small mint wafer...!\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @printer(i8* %2)
ret i32 0
}