xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test1(int, int);
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3(int, char, char, char);
int main(void) {
  test1(4, 3);
  test2();
  test3(3, 'w', 'a', 't');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x3,%esi
call   1040 <test1@plt>
mov    $0x0,%al
call   1050 <test2@plt>
mov    $0x3,%edi
mov    $0x77,%esi
mov    $0x61,%edx
mov    $0x74,%ecx
call   1030 <test3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x3,%esi
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <test2@plt>
mov    $0x3,%edi
mov    $0x77,%esi
mov    $0x61,%edx
mov    $0x74,%ecx
call   1030 <test3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test1(i32 4, i32 3)
%3 = call i32 (...) @test2()
%4 = call i32 @test3(i32 3, i8 signext 119, i8 signext 97, i8 signext 116)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test1(i32 4, i32 3)
%2 = tail call i32 (...) @test2()
%3 = tail call i32 @test3(i32 3, i8 signext 119, i8 signext 97, i8 signext 116)
ret i32 0
}
void *int_create(int val) {
  int *ptr = (int *)malloc(sizeof(int));
  *ptr = val;
  return ptr;
}


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

x86 assembly (clang, -O2):
<int_create>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @int_create(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
store i32 %0, i32* %3
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  printf("%d and ", sizeof(x++));
  printf("%d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec7(%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
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d and \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage:  dis [addr]\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: dis [addr]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Usage: dis [addr]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_read_shadow_stack_metadata_store(char **,
                                                                   int);
long strtol(char const *, char **, int);
__attribute__((__weak__, __always___)) long
softboundmpx_strtol(const char *nptr, char **endptr, int base) {
  long temp = strtol(nptr, endptr, base);
  if (endptr != NULL) {
    __softboundmpx_read_shadow_stack_metadata_store(endptr, 1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<softboundmpx_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <softboundmpx_strtol+0x40>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <__softboundmpx_read_shadow_stack_metadata_store@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_strtol>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strtol@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1141 <softboundmpx_strtol+0x21>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <__softboundmpx_read_shadow_stack_metadata_store@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define weak i64 @softboundmpx_strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
%5 = icmp eq i8** %1, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @__softboundmpx_read_shadow_stack_metadata_store(i8** %1, i32 1)
br label %8
8: ; preds = %6, %3
ret i64 %4
}
int video_height(struct host *base) { return 0; }


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

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

LLVM IR (-O0):
%struct.host = type opaque
define i32 @video_height(%struct.host* %0) {
%2 = alloca %struct.host*
store %struct.host* %0, %struct.host** %2
ret i32 0
}

LLVM IR (-O2):
%struct.host = type opaque
define i32 @video_height(%struct.host* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *CAENHVLibSwRel();
int /*<<< orphan*/ con_getch();
int /*<<< orphan*/ con_printf(char *, char *);
void HVLibSwRel() {
  char *SoftRel;
  SoftRel = CAENHVLibSwRel();
  con_printf("\nCAEN HV Wrapper Library Release: %s", SoftRel);
  con_getch();
}


x86 assembly (clang, -O0):
<HVLibSwRel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <CAENHVLibSwRel@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1050 <con_printf@plt>
mov    $0x0,%al
call   1040 <con_getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HVLibSwRel>:
push   %rax
xor    %eax,%eax
call   1030 <CAENHVLibSwRel@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1050 <con_printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <con_getch@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0ACAEN HV Wrapper Library Release: %s\00"
define void @HVLibSwRel() {
%1 = alloca i8*
%2 = call i8* (...) @CAENHVLibSwRel()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @con_printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @con_getch()
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0ACAEN HV Wrapper Library Release: %s\00"
define void @HVLibSwRel() {
%1 = tail call i8* (...) @CAENHVLibSwRel()
%2 = tail call i32 @con_printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 (...) @con_getch()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int u_char;

/* Variables and functions */
u_int32_t htonl(u_int32_t x) {
  u_char *s = (u_char *)&x;
  return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
}


x86 assembly (clang, -O0):
<htonl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @htonl(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = or i32 %7, %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = or i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @htonl(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int binsearch(int, int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int v[8];
  int i, x;
  for (i = 0; i < 8; i++)
    v[i] = i;
  x = binsearch(4, v, 8);
  printf("The index that holds number: %d is: %d", 4, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    1159 <main+0x39>
mov    -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <main+0x16>
lea    -0x30(%rbp),%rsi
mov    $0x4,%edi
mov    $0x8,%edx
call   1030 <binsearch@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edx
lea    0xe87(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x8,%edx
call   1030 <binsearch@plt>
lea    0xecc(%rip),%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [39 x i8] c"The index that holds number: %d is: %d\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = bitcast [8 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %4
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 4
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %6
%7 = call i32 @binsearch(i32 4, i32* %3, i32 8)
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 4, i32 %7)
ret i32 0
}
void setenv(name, value) char *name, *value;
{}


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

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

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

LLVM IR (-O2):
define void @setenv(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookinteger8array_(void *x, unsigned int *n) {
  lookNarray((char *)x, (*n * 8));
}


x86 assembly (clang, -O0):
<lookinteger8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookinteger8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookinteger8array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 8
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookinteger8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int RubyCompare(const struct dirent **a, const struct dirent **b) {
  return (strcmp((*a)->d_name, (*b)->d_name));
}


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

x86 assembly (clang, -O2):
<RubyCompare>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @RubyCompare(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @RubyCompare(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcmp(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
__attribute__((noreturn)) void sys_abort() {
  puts("Bedrock program terminated.");
  exit(0);
}


x86 assembly (clang, -O0):
<sys_abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sys_abort>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Bedrock program terminated.\00"
define void @sys_abort() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"Bedrock program terminated.\00"
define void @sys_abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
char *despace(char *p) {
  while (*p && (*p <= ' '))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<despace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <despace+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <despace+0x3d>
jmp    114e <despace+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <despace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<despace>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <despace+0x21>
cmp    $0x21,%cl
jl     1110 <despace+0x10>
ret

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

LLVM IR (-O2):
define i8* @despace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = icmp slt i8 %4, 33
%7 = and i1 %5, %6
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i8* %3
}
__attribute__((always_)) int
constant_test_bit(int nr, const volatile unsigned long *addr) {
  return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
}


x86 assembly (clang, -O0):
<constant_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
sar    $0x5,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_test_bit>:
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%rcx
xor    %eax,%eax
bt     %edi,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @constant_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 31
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load volatile i64, i64* %13
%15 = and i64 %8, %14
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @constant_test_bit(i32 %0, i64* %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
void gtk_viewport_get_vadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_viewport_get_vadjustment() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipwhitespace(char *str) {
  while (isspace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skipwhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipwhitespace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipwhitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipwhitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipwhitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skipwhitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int klog(char);
int /*<<< orphan*/ strcat(char, char *);
int loginfo(char *info) {
  char *info_tag = "Info : ";
  strcat(*info_tag, info);
  int ret = klog(*info_tag);
  return (ret);
}


x86 assembly (clang, -O0):
<loginfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <klog@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loginfo>:
push   %rax
mov    %rdi,%rsi
mov    $0x49,%edi
call   1040 <strcat@plt>
mov    $0x49,%edi
pop    %rax
jmp    1030 <klog@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Info : \00"
define i32 @loginfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8 signext %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @klog(i8 signext %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @loginfo(i8* %0) {
%2 = tail call i32 @strcat(i8 signext 73, i8* %0)
%3 = tail call i32 @klog(i8 signext 73)
ret i32 %3
}
void __glut2Warning(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @__glut2Warning(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errno;
scalar_t__ rmdir(char *);
int /*<<< orphan*/ send_errno(int /*<<< orphan*/);
int /*<<< orphan*/ send_success();
void do_rmdir(int argc, char **argv) {
  assert(argc == 1);
  if (rmdir(argv[0]) == 0)
    send_success();
  else
    send_errno(errno);
}


x86 assembly (clang, -O0):
<do_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <rmdir@plt>
cmp    $0x0,%rax
jne    1182 <do_rmdir+0x42>
mov    $0x0,%al
call   1050 <send_success@plt>
jmp    1190 <do_rmdir+0x50>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <send_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rmdir>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    (%rbx),%rdi
call   1030 <rmdir@plt>
test   %rax,%rax
je     116f <do_rmdir+0x2f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1060 <send_errno@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <send_success@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @do_rmdir(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i64 @rmdir(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (...) @send_success()
br label %19
16: ; preds = %2
%17 = load i32, i32* @errno
%18 = call i32 @send_errno(i32 %17)
br label %19
19: ; preds = %16, %14
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_rmdir(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8*, i8** %1
%7 = tail call i64 @rmdir(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (...) @send_success()
br label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = tail call i32 @send_errno(i32 %12)
br label %14
14: ; preds = %11, %9
ret void
}
int calculateParity(char buffer[]) {
  int i = 1;
  int result = 0;
  for (i; i <= 8; i++) {
    if (buffer[i] == '1')
      result++;
  }
  if ((result % 2) == 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<calculateParity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x14(%rbp)
jg     1151 <calculateParity+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    113e <calculateParity+0x3e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1143 <calculateParity+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <calculateParity+0x16>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1171 <calculateParity+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1178 <calculateParity+0x78>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateParity>:
movq   0x1(%rdi),%xmm0
pcmpeqb 0xef3(%rip),%xmm0
pmovmskb %xmm0,%ecx
xor    %eax,%eax
test   %cl,%cl
setnp  %al
ret

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

LLVM IR (-O2):
define i32 @calculateParity(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = bitcast i8* %2 to <8 x i8>*
%4 = load <8 x i8>, <8 x i8>* %3
%5 = icmp eq <8 x i8> %4, <i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49>
%6 = bitcast <8 x i1> %5 to i8
%7 = call i8 @llvm.ctpop.i8(i8 %6)
%8 = and i8 %7, 1
%9 = zext i8 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern int shmem_n_pes(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i32 @shmem_n_pes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ read(int, char *, int);
void pipeutils_handle_signal(int read_fd) {
  char data;
  read(read_fd, &data, 1);
}


x86 assembly (clang, -O0):
<pipeutils_handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipeutils_handle_signal>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pipeutils_handle_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @read(i32 %4, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @pipeutils_handle_signal(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int syscall(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int exec() {
  int r;
  char filename[32];
  printf("enter exec filename : ");
  gets(filename);
  r = syscall(8, filename, 0, 0);
  printf("exec failed\n");
}


x86 assembly (clang, -O0):
<exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x30(%rbp),%rsi
mov    $0x8,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <syscall@plt>
mov    %eax,-0x8(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <syscall@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"enter exec filename : \00"
@.str.1 = [13 x i8] c"exec failed\0A\00"
define i32 @exec() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [32 x i8]
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 8, i8* %7, i32 0, i32 0)
store i32 %8, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"enter exec filename : \00"
@str = [12 x i8] c"exec failed\00"
define i32 @exec() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @syscall(i32 8, i8* %2, i32 0, i32 0)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *foo1(void) {
  static char buf[1000];
  strcpy(buf, "hello");
  return buf;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2f12(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@foo1.buf = internal global [1000 x i8] zeroinitializer
@.str = [6 x i8] c"hello\00"
define i8* @foo1() {
%1 = call i32 @strcpy(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo1.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo1.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@foo1.buf = internal global [1000 x i8] zeroinitializer
@.str = [6 x i8] c"hello\00"
define i8* @foo1() {
%1 = tail call i32 @strcpy(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo1.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo1.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(const char *name) {
  printf("\n%s\n\n"
         "  -f <filename of the config block image>\n"
         "  -v <valid: 0 (yes), 1 (no)>\n"
         "  -k <kernel image start address>\n"
         "  -i <initrd image start address>\n"
         "  -s <size of the initrd image>\n"
         "  -c <kernel command line>\n"
         "  -h\n\n"
         " Copyright (c) 2001 telos EDV Systementwicklung GmbH, Hamburg\n\n",
         name);
}


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

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

LLVM IR (-O0):
@.str = [274 x i8] c"\0A%s\0A\0A -f <filename of the config block image>\0A -v <valid: 0 (yes), 1 (no)>\0A -k <kernel image start address>\0A -i <initrd image start address>\0A -s <size of the initrd image>\0A -c <kernel command line>\0A -h\0A\0A Copyright (c) 2001 telos EDV Systementwicklung GmbH, Hamburg\0A\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([274 x i8], [274 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [274 x i8] c"\0A%s\0A\0A -f <filename of the config block image>\0A -v <valid: 0 (yes), 1 (no)>\0A -k <kernel image start address>\0A -i <initrd image start address>\0A -s <size of the initrd image>\0A -c <kernel command line>\0A -h\0A\0A Copyright (c) 2001 telos EDV Systementwicklung GmbH, Hamburg\0A\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([274 x i8], [274 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double R_edgeBlendTet(int index[2], double *L) {
  return -2.0 * L[index[0]] * L[index[1]];
}


x86 assembly (clang, -O0):
<R_edgeBlendTet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movsd  0xee1(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x4(%rcx),%rcx
mulsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_edgeBlendTet>:
movslq (%rdi),%rax
movsd  (%rsi,%rax,8),%xmm0
mulsd  0xef0(%rip),%xmm0
movslq 0x4(%rdi),%rax
mulsd  (%rsi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @R_edgeBlendTet(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
store i32* %0, i32** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %5, i64 %9
%11 = load double, double* %10
%12 = fmul double -2.000000e+00, %11
%13 = load double*, double** %4
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %13, i64 %17
%19 = load double, double* %18
%20 = fmul double %12, %19
ret double %20
}

LLVM IR (-O2):
define double @R_edgeBlendTet(i32* nocapture %0, double* nocapture %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %1, i64 %4
%6 = load double, double* %5
%7 = fmul double %6, -2.000000e+00
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = fmul double %7, %12
ret double %13
}
int foo(int a, int b) { return (a * b) + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
imul   %esi,%edi
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
void *memalign(int /*<<< orphan*/, size_t);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
void *valloc(size_t size) { return memalign(sysconf(_SC_PAGESIZE), size); }


x86 assembly (clang, -O0):
<valloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <memalign@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i8* @valloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @_SC_PAGESIZE
%4 = call i32 @sysconf(i32 %3)
%5 = load i64, i64* %2
%6 = call i8* @memalign(i32 %4, i64 %5)
ret i8* %6
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define noalias i8* @valloc(i64 %0) {
%2 = load i32, i32* @_SC_PAGESIZE
%3 = tail call i32 @sysconf(i32 %2)
%4 = tail call i8* @memalign(i32 %3, i64 %0)
ret i8* %4
}
int roundInt(float a) {
  if (a >= 0)
    return (int)(a + 0.5f);
  else
    return (int)(a - 0.5f);
}


x86 assembly (clang, -O0):
<roundInt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1133 <roundInt+0x33>
movss  0xede(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <roundInt+0x4b>
movss  -0x8(%rbp),%xmm0
movss  0xec0(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundInt>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @roundInt(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %3
%8 = fadd float %7, 5.000000e-01
%9 = fptosi float %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load float, float* %3
%12 = fsub float %11, 5.000000e-01
%13 = fptosi float %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @roundInt(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = select i1 %2, float -5.000000e-01, float 5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
void tb_server_view_terminal(struct toobit_space *in_u, int socket) { return; }


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

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

LLVM IR (-O0):
%struct.toobit_space = type opaque
define void @tb_server_view_terminal(%struct.toobit_space* %0, i32 %1) {
%3 = alloca %struct.toobit_space*
%4 = alloca i32
store %struct.toobit_space* %0, %struct.toobit_space** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.toobit_space = type opaque
define void @tb_server_view_terminal(%struct.toobit_space* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testNextTokenWithFile();
int /*<<< orphan*/ testNextTokenWithString();
int /*<<< orphan*/ testSkipToken();
int main(void) {
  testNextTokenWithString();
  testNextTokenWithFile();
  testSkipToken();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testNextTokenWithString@plt>
mov    $0x0,%al
call   1050 <testNextTokenWithFile@plt>
mov    $0x0,%al
call   1040 <testSkipToken@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testNextTokenWithString@plt>
xor    %eax,%eax
call   1050 <testNextTokenWithFile@plt>
xor    %eax,%eax
call   1040 <testSkipToken@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testNextTokenWithString()
%3 = call i32 (...) @testNextTokenWithFile()
%4 = call i32 (...) @testSkipToken()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testNextTokenWithString()
%2 = tail call i32 (...) @testNextTokenWithFile()
%3 = tail call i32 (...) @testSkipToken()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free1DArr(double **array) { free((void *)(*array)); }


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

x86 assembly (clang, -O2):
<free1DArr>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free1DArr(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int MIMEH_get_doubleCR_save();
int /*<<< orphan*/ MIMEH_set_doubleCR_save(int);
int MIME_set_decode_doubleCR(int level) {
  MIMEH_set_doubleCR_save(level);
  return MIMEH_get_doubleCR_save();
}


x86 assembly (clang, -O0):
<MIME_set_decode_doubleCR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <MIMEH_set_doubleCR_save@plt>
mov    $0x0,%al
call   1040 <MIMEH_get_doubleCR_save@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MIME_set_decode_doubleCR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @MIMEH_set_doubleCR_save(i32 %3)
%5 = call i32 (...) @MIMEH_get_doubleCR_save()
ret i32 %5
}

LLVM IR (-O2):
define i32 @MIME_set_decode_doubleCR(i32 %0) {
%2 = tail call i32 @MIMEH_set_doubleCR_save(i32 %0)
%3 = tail call i32 (...) @MIMEH_get_doubleCR_save()
ret i32 %3
}
int compareCost(float oldValue, float newValue, int maximize_flag) {
  if (maximize_flag) {
    if (oldValue < newValue)
      return 1;
    else
      return 0;
  } else {
    if (oldValue >= newValue)
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<compareCost>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1146 <compareCost+0x46>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <compareCost+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1168 <compareCost+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1168 <compareCost+0x68>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1161 <compareCost+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <compareCost+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareCost>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
setae  %cl
test   %edi,%edi
cmove  %ecx,%eax
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @compareCost(float %0, float %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = fcmp olt float %0, %1
%6 = fcmp oge float %0, %1
%7 = select i1 %4, i1 %6, i1 %5
%8 = zext i1 %7 to i32
ret i32 %8
}