xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fcloseall();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ unlink(char *);
void closing_server() {
  printf(" K:'%d' ", getpid());
  fcloseall();
  unlink("tmp/fifo.server_to_log");
  exit(2);
}


x86 assembly (clang, -O0):
<closing_server>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <fcloseall@plt>
lea    0xe92(%rip),%rdi
call   1030 <unlink@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<closing_server>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <fcloseall@plt>
lea    0xe95(%rip),%rdi
call   1030 <unlink@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" K:'%d' \00"
@.str.1 = [23 x i8] c"tmp/fifo.server_to_log\00"
define void @closing_server() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @fcloseall()
%4 = call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c" K:'%d' \00"
@.str.1 = [23 x i8] c"tmp/fifo.server_to_log\00"
define void @closing_server() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fcloseall()
%4 = tail call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helpmsg(void) {
  printf("Syntax: agt2agx <options> <game name>\n");
  printf("Options:\n");
  printf("(all of these can be turned off by putting a - after the option)\n");
  printf("-h  Print this help message.\n");
  printf("-o <filename>  Specify output file root.\n");
}


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

x86 assembly (clang, -O2):
<helpmsg>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
call   1030 <puts@plt>
lea    0xf45(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Syntax: agt2agx <options> <game name>\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [66 x i8] c"(all of these can be turned off by putting a - after the option)\0A\00"
@.str.3 = [30 x i8] c"-h Print this help message.\0A\00"
@.str.4 = [42 x i8] c"-o <filename> Specify output file root.\0A\00"
define void @helpmsg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Syntax: agt2agx <options> <game name>\00"
@str.5 = [9 x i8] c"Options:\00"
@str.6 = [65 x i8] c"(all of these can be turned off by putting a - after the option)\00"
@str.7 = [29 x i8] c"-h Print this help message.\00"
@str.8 = [41 x i8] c"-o <filename> Specify output file root.\00"
define void @helpmsg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cos(double);
int /*<<< orphan*/ printf(char *, ...);
main(const int argc, const char *argv[]) {
  int i;
  printf("hello C-world\n");
  printf("cosine(3.14) = %0.5f\n", cos(3.14));
  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    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xeb4(%rip),%xmm0
call   1040 <cos@plt>
lea    0xebf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hello C-world\0A\00"
@.str.1 = [22 x i8] c"cosine(3.14) = %0.5f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call double @cos(double 3.140000e+00)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"cosine(3.14) = %0.5f\0A\00"
@str = [14 x i8] c"hello C-world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double 0xBFEFFFFD5719F5D7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int input_1, input_2, input_3;
  scanf("%d %d %d", &input_1, &input_2, &input_3);
  printf("%8d %8d %8d", input_1, input_2, input_3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [12 x i8] c"%8d %8d %8d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int lseek(int, int, int);
int Hlseek(int fd, int off, int wh) { return lseek(fd, off, wh); }


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

x86 assembly (clang, -O2):
<Hlseek>:
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @Hlseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getText(int);
int /*<<< orphan*/ send_http_header(int, int);
int /*<<< orphan*/ write_st(int, char *);
void write_overviewpage(int fd) {
  send_http_header(fd, 200);
  char *txt = getText(60);
  write_st(fd, txt);
  free(txt);
}


x86 assembly (clang, -O0):
<write_overviewpage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xc8,%esi
call   1040 <send_http_header@plt>
mov    $0x3c,%edi
call   1050 <getText@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <write_st@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_overviewpage>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xc8,%esi
call   1040 <send_http_header@plt>
mov    $0x3c,%edi
call   1050 <getText@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1060 <write_st@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @write_overviewpage(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @send_http_header(i32 %4, i32 200)
%6 = call i8* @getText(i32 60)
store i8* %6, i8** %3
%7 = load i32, i32* %2
%8 = load i8*, i8** %3
%9 = call i32 @write_st(i32 %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_overviewpage(i32 %0) {
%2 = tail call i32 @send_http_header(i32 %0, i32 200)
%3 = tail call i8* @getText(i32 60)
%4 = tail call i32 @write_st(i32 %0, i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
void virtio_wmb(void) {}


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

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

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

LLVM IR (-O2):
define void @virtio_wmb() {
ret void
}
unsigned long load_dword(unsigned char *ptr) {
  unsigned long *p = (unsigned long *)ptr;
  return *p;
}


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

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

LLVM IR (-O0):
define i64 @load_dword(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @load_dword(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int main() {
  int a = 0;
  goto end;
  a++;
end:
  a++;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_sliba_version(void) {
  setvar(cintern("*sliba-version*"),
         cintern("$Id: sliba.c,v 1.1.1.1 2003/01/15 23:55:10 ulric Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_sliba_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed2(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_sliba_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*sliba-version*\00"
@.str.1 = [55 x i8] c"$Id: sliba.c,v 1.1.1.1 2003/01/15 23:55:10 ulric Exp $\00"
define void @init_sliba_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*sliba-version*\00"
@.str.1 = [55 x i8] c"$Id: sliba.c,v 1.1.1.1 2003/01/15 23:55:10 ulric Exp $\00"
define void @init_sliba_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CC2420ControlP__InterruptCCA__fired();
void HplCC2420InterruptsP__CCA__fired(void) {
  CC2420ControlP__InterruptCCA__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplCC2420InterruptsP__CCA__fired() {
%1 = tail call i32 (...) @CC2420ControlP__InterruptCCA__fired()
ret void
}
/* Variables and functions */
float cos(float);
float futhark_cos32(float x) { return cos(x); }


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

x86 assembly (clang, -O2):
<futhark_cos32>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define float @futhark_cos32(float %0) {
%2 = tail call float @cos(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double right(double lhs, double rhs) {
  assert(lhs < rhs);
  return rhs;
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
push   %rax
movsd  %xmm1,(%rsp)
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @right(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 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load double, double* %4
ret double %10
}

LLVM IR (-O2):
define double @right(double %0, double returned %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void showNonValidSubtractionResultMessage() {
  fprintf(stderr, "Error. Subtraction results are not a valid Roman numeral "
                  "(negative or zero).\n");
}


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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"Error. Subtraction results are not a valid Roman numeral (negative or zero).\0A\00"
define void @showNonValidSubtractionResultMessage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"Error. Subtraction results are not a valid Roman numeral (negative or zero).\0A\00"
define void @showNonValidSubtractionResultMessage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void someFunction(const int b[], int startIndex, int size) {
  if (startIndex < size) {
    someFunction(b, startIndex + 1, size);
    printf("%d  ", b[startIndex]);
  }
}


x86 assembly (clang, -O0):
<someFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1167 <someFunction+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <someFunction@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<someFunction>:
cmp    %edx,%esi
jge    114f <someFunction+0x2f>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rbx),%esi
call   1040 <someFunction@plt>
movslq %ebx,%rax
mov    (%r14,%rax,4),%esi
lea    0xebd(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d \00"
define void @someFunction(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %6
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define void @someFunction(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %1, 1
tail call void @someFunction(i32* %0, i32 %7, i32 %2)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
}
/* Variables and functions */
char const *makeiso(int, int);
const char *tc2text(int tc, int format) {
  return makeiso(tc - 1, (format == 0));
}


x86 assembly (clang, -O0):
<tc2text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
call   1030 <makeiso@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tc2text>:
add    $0xffffffff,%edi
xor    %eax,%eax
test   %esi,%esi
sete   %al
mov    %eax,%esi
jmp    1030 <makeiso@plt>

LLVM IR (-O0):
define i8* @tc2text(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i8* @makeiso(i32 %6, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @tc2text(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call i8* @makeiso(i32 %3, i32 %5)
ret i8* %6
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int close_output_file(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(192, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<close_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc0,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_output_file>:
mov    $0xc0,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @close_output_file() {
%1 = tail call i32 @_ada_use_c2phc(i32 192, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y_root;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmotion_y_root(void *_p) {
  return (int)((XEvent *)_p)->xmotion.y_root;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xmotion_y_root>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmotion_y_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmotion_y_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *realloc(void *, size_t);
void *crealloc_(void **ArrPtr, int *NBytes) {
  void *NewPtr;
  if (*NBytes > 0) {
    NewPtr = realloc(*ArrPtr, (size_t)(*NBytes));
  } else {
    NewPtr = NULL;
  }
  return (NewPtr);
}


x86 assembly (clang, -O0):
<crealloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1149 <crealloc_+0x39>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1151 <crealloc_+0x41>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crealloc_>:
mov    (%rsi),%esi
test   %esi,%esi
jle    111e <crealloc_+0xe>
mov    (%rdi),%rdi
jmp    1030 <realloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @crealloc_(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8*, i8** %0
%7 = zext i32 %3 to i64
%8 = tail call i8* @realloc(i8* %6, i64 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ xnomem();
void *xrealloc(void *ptr, size_t size) {
  if (!(ptr = realloc(ptr, size)))
    xnomem();
  return (ptr);
}


x86 assembly (clang, -O0):
<xrealloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1152 <xrealloc+0x32>
mov    $0x0,%al
call   1040 <xnomem@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1040 <xnomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(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 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 (...) @xnomem()
br label %11
11: ; preds = %9, %2
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xnomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ rename_dot();
int /*<<< orphan*/ rename_dotdot();
int /*<<< orphan*/ rename_empty1();
int /*<<< orphan*/ rename_empty2();
int /*<<< orphan*/ test_rename_paths();
void test_rename(void) {
  test_rename_paths();
  rename_dot();
  rename_dotdot();
  rename_empty1();
  rename_empty2();
}


x86 assembly (clang, -O0):
<test_rename>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_rename_paths@plt>
mov    $0x0,%al
call   1060 <rename_dot@plt>
mov    $0x0,%al
call   1070 <rename_dotdot@plt>
mov    $0x0,%al
call   1030 <rename_empty1@plt>
mov    $0x0,%al
call   1040 <rename_empty2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rename>:
push   %rax
xor    %eax,%eax
call   1050 <test_rename_paths@plt>
xor    %eax,%eax
call   1060 <rename_dot@plt>
xor    %eax,%eax
call   1070 <rename_dotdot@plt>
xor    %eax,%eax
call   1030 <rename_empty1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <rename_empty2@plt>

LLVM IR (-O0):
define void @test_rename() {
%1 = call i32 (...) @test_rename_paths()
%2 = call i32 (...) @rename_dot()
%3 = call i32 (...) @rename_dotdot()
%4 = call i32 (...) @rename_empty1()
%5 = call i32 (...) @rename_empty2()
ret void
}

LLVM IR (-O2):
define void @test_rename() {
%1 = tail call i32 (...) @test_rename_paths()
%2 = tail call i32 (...) @rename_dot()
%3 = tail call i32 (...) @rename_dotdot()
%4 = tail call i32 (...) @rename_empty1()
%5 = tail call i32 (...) @rename_empty2()
ret void
}
/* Type definitions */
struct meteo_list {
  int dummy;
};

/* Variables and functions */
struct meteo_list *meteo_list_next(struct meteo_list *);
unsigned meteo_list_get_count(struct meteo_list *mlist) {
  unsigned cnt = 0;
  for (struct meteo_list *l = mlist; l != NULL; l = meteo_list_next(l))
    cnt++;
  return cnt;
}


x86 assembly (clang, -O0):
<meteo_list_get_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <meteo_list_get_count+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <meteo_list_next@plt>
mov    %rax,-0x18(%rbp)
jmp    112b <meteo_list_get_count+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meteo_list_get_count>:
push   %rbx
test   %rdi,%rdi
je     1132 <meteo_list_get_count+0x22>
mov    %rdi,%rax
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %rax,%rdi
call   1030 <meteo_list_next@plt>
test   %rax,%rax
jne    1120 <meteo_list_get_count+0x10>
jmp    1134 <meteo_list_get_count+0x24>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.meteo_list = type { i32 }
define i32 @meteo_list_get_count(%struct.meteo_list* %0) {
%2 = alloca %struct.meteo_list*
%3 = alloca i32
%4 = alloca %struct.meteo_list*
store %struct.meteo_list* %0, %struct.meteo_list** %2
store i32 0, i32* %3
%5 = load %struct.meteo_list*, %struct.meteo_list** %2
store %struct.meteo_list* %5, %struct.meteo_list** %4
br label %6
6: ; preds = %12, %1
%7 = load %struct.meteo_list*, %struct.meteo_list** %4
%8 = icmp ne %struct.meteo_list* %7, null
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add i32 %10, 1
store i32 %11, i32* %3
br label %12
12: ; preds = %9
%13 = load %struct.meteo_list*, %struct.meteo_list** %4
%14 = call %struct.meteo_list* @meteo_list_next(%struct.meteo_list* %13)
store %struct.meteo_list* %14, %struct.meteo_list** %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.meteo_list = type { i32 }
define i32 @meteo_list_get_count(%struct.meteo_list* %0) {
%2 = icmp eq %struct.meteo_list* %0, null
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi %struct.meteo_list* [ %9, %5 ], [ %0, %1 ]
%7 = phi i32 [ %8, %5 ], [ 0, %1 ]
%8 = add i32 %7, 1
%9 = tail call %struct.meteo_list* @meteo_list_next(%struct.meteo_list* %6)
%10 = icmp eq %struct.meteo_list* %9, null
br i1 %10, label %3, label %5
}
int open(const char *pathname, int flags) {
  int result;
  __asm__ __volatile__("syscall"
                       : "=a"(result)
                       : "a"(2), "d"(pathname), "c"(flags));
  return result;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x2,%eax
syscall
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    %esi,%ecx
mov    $0x2,%eax
mov    %rdi,%rdx
syscall
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 asm sideeffect "syscall", "={ax},{ax},{dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 2, i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "syscall", "={ax},{ax},{dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 2, i8* %0, i32 %1)
ret i32 %3
}
void foo_2_1_1_1_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_1_1_1_2_1() {
ret void
}
int findlast(int *a, int n, int val) {
  int i;
  for (i = n - 1; i >= 0; i--) {
    if (a[i] == val)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<findlast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1153 <findlast+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <findlast+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <findlast+0x5a>
jmp    1145 <findlast+0x45>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <findlast+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findlast>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1120 <findlast+0x20>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmp    %edx,(%rdi,%rcx,4)
jne    1110 <findlast+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @findlast(i32* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
br label %5
5: ; preds = %10, %3
%6 = phi i64 [ %7, %10 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = and i64 %7, 4294967295
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %10
%16 = trunc i64 %7 to i32
br label %17
17: ; preds = %5, %15
%18 = phi i32 [ %16, %15 ], [ -1, %5 ]
ret i32 %18
}
int MPI_Init(int *argc, char ***argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MPI_Init(i32* nocapture readnone %0, i8*** nocapture readnone %1) {
ret i32 0
}
int get_int(const void *p) {
  int w;
  __builtin_memcpy(&w, p, sizeof(int));
  return w;
}


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

x86 assembly (clang, -O2):
<get_int>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = bitcast i32* %3 to i8*
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void fc108(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    goto a;
  a:
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

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

LLVM IR (-O2):
define void @fc108(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/, int /*<<< orphan*/);
void sig_child(int signum) {
  while (waitpid(-1, 0, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sig_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    113f <sig_child+0x2f>
jmp    111b <sig_child+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sig_child+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sig_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32 0, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sig_child(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32 0, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < atoi(argv[1]); i++) {
    printf("Hello,world!!\n");
  }
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1177 <main+0x57>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %eax,%eax
jle    1158 <main+0x38>
xor    %ebp,%ebp
lea    0xec3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
cmp    %eax,%ebp
jl     1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello,world!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = icmp slt i32 %8, %12
br i1 %13, label %14, label %19
14: ; preds = %7
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello,world!!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%10 = add nuw nsw i32 %8, 1
%11 = load i8*, i8** %3
%12 = tail call i32 @atoi(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %7, label %14
14: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _uitoa(int, char *, unsigned char);
void _itoa(int value, char *string, unsigned char radix) {
  if (value < 0 && radix == 10) {
    *string++ = '-';
    value = -value;
  }
  _uitoa(value, string, radix);
}


x86 assembly (clang, -O0):
<_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1155 <_itoa+0x45>
movzbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1155 <_itoa+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <_uitoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_itoa>:
test   %edi,%edi
jns    1122 <_itoa+0x12>
cmp    $0xa,%dl
jne    1122 <_itoa+0x12>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %edi
movzbl %dl,%edx
jmp    1030 <_uitoa@plt>

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

LLVM IR (-O2):
define void @_itoa(i32 %0, i8* %1, i8 zeroext %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp eq i8 %2, 10
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%9 = sub nsw i32 0, %0
br label %10
10: ; preds = %7, %3
%11 = phi i8* [ %8, %7 ], [ %1, %3 ]
%12 = phi i32 [ %9, %7 ], [ %0, %3 ]
%13 = tail call i32 @_uitoa(i32 %12, i8* %11, i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generateFooter(int /*<<< orphan*/);
int /*<<< orphan*/ generateHeader(int /*<<< orphan*/);
int /*<<< orphan*/ processInput(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  generateHeader(stdout);
  processInput(stdin, stdout);
  generateFooter(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <generateHeader@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1050 <processInput@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1040 <generateFooter@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
call   1030 <generateHeader@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1050 <processInput@plt>
mov    (%rbx),%edi
call   1040 <generateFooter@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
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 = load i32, i32* @stdout
%7 = call i32 @generateHeader(i32 %6)
%8 = load i32, i32* @stdin
%9 = load i32, i32* @stdout
%10 = call i32 @processInput(i32 %8, i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @generateFooter(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @generateHeader(i32 %3)
%5 = load i32, i32* @stdin
%6 = load i32, i32* @stdout
%7 = tail call i32 @processInput(i32 %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @generateFooter(i32 %8)
ret i32 0
}
void free_double(double *ret) {}


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

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

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

LLVM IR (-O2):
define void @free_double(double* nocapture %0) {
ret void
}
void flash_writesize_set(int bits) { (void)bits; }


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

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

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

LLVM IR (-O2):
define void @flash_writesize_set(i32 %0) {
ret void
}
double abs2(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<abs2>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @abs2(double %0) {
%2 = fmul double %0, %0
ret double %2
}