xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ped2lfmm(char *, char *, int *, int *);
int /*<<< orphan*/ print_convert(int, int);
void R_ped2lfmm(char **R_input_file, char **R_output_file, int *N, int *M) {
  ped2lfmm(*R_input_file, *R_output_file, N, M);
  print_convert(*N, *M);
}


x86 assembly (clang, -O0):
<R_ped2lfmm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ped2lfmm@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1040 <print_convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @R_ped2lfmm(i8** %0, i8** %1, i32* %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i32*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %6
%12 = load i8*, i8** %11
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 @ped2lfmm(i8* %10, i8* %12, i32* %13, i32* %14)
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = call i32 @print_convert(i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @R_ped2lfmm(i8** nocapture %0, i8** nocapture %1, i32* %2, i32* %3) {
%5 = load i8*, i8** %0
%6 = load i8*, i8** %1
%7 = tail call i32 @ped2lfmm(i8* %5, i8* %6, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = tail call i32 @print_convert(i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *slice(char *array, int first, int last) {
  char *retarray = (char *)malloc(last - first);
  strncpy(retarray, array + first, last);
  return retarray;
  free(retarray);
  retarray = NULL;
}


x86 assembly (clang, -O0):
<slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
sub    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movslq %ebp,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %r15d,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @slice(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %6
%19 = call i32 @strncpy(i8* %13, i8* %17, i32 %18)
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
define i8* @slice(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @strncpy(i8* %6, i8* %8, i32 %2)
ret i8* %6
}
/* Type definitions */
struct group {
  int /*<<< orphan*/ gr_gid;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct group *getgrnam(char *);
gid_t gid_by_name(char *name) {
  struct group *info;
  info = getgrnam(name);
  if (!info)
    return 0;
  return info->gr_gid;
}


x86 assembly (clang, -O0):
<gid_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <gid_by_name+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1149 <gid_by_name+0x39>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gid_by_name>:
push   %rax
call   1030 <getgrnam@plt>
test   %rax,%rax
je     111f <gid_by_name+0xf>
mov    (%rax),%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @gid_by_name(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ incompleteState(int, int);
int /*<<< orphan*/ printf(char *);
void invalidState(int itemChoice, int paid) {
  printf("Please Enter Valid Coin\n");
  incompleteState(itemChoice, paid);
}


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

x86 assembly (clang, -O2):
<invalidState>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <incompleteState@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Please Enter Valid Coin\0A\00"
define void @invalidState(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @incompleteState(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Please Enter Valid Coin\00"
define void @invalidState(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @incompleteState(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int strnlen(char *, int);
int ncbitc_cleanup_str(char *str, int max) {
  int len;
  len = strnlen(str, max);
  if (len <= 2) {
    str[0] = '\0';
  } else {
    str[0] = ' ';
    str[len - 1] = '\0';
  }
  return 0;
}


x86 assembly (clang, -O0):
<ncbitc_cleanup_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strnlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jg     1144 <ncbitc_cleanup_str+0x34>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    115c <ncbitc_cleanup_str+0x4c>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncbitc_cleanup_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strnlen@plt>
cmp    $0x3,%eax
jl     1127 <ncbitc_cleanup_str+0x17>
movb   $0x20,(%rbx)
add    $0xffffffff,%eax
add    %rax,%rbx
movb   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ncbitc_cleanup_str(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 @strnlen(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 2
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 0, i8* %13
br label %22
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 32, i8* %16
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
store i8 0, i8* %21
br label %22
22: ; preds = %14, %11
ret i32 0
}

LLVM IR (-O2):
define i32 @ncbitc_cleanup_str(i8* %0, i32 %1) {
%3 = tail call i32 @strnlen(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 3
br i1 %4, label %9, label %5
5: ; preds = %2
store i8 32, i8* %0
%6 = add nsw i32 %3, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ %0, %2 ]
store i8 0, i8* %10
ret i32 0
}
/* Variables and functions */
int bi_search(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int result = bi_search(a, 3, 10);
  printf("%d", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0xa,%edx
call   1030 <bi_search@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0xa,%edx
call   1030 <bi_search@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @bi_search(i32* %3, i32 3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int rotateLeft(int x, int n) {
  unsigned y = x;
  return (y >> (32 - n)) | y << n;
}


x86 assembly (clang, -O0):
<rotateLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateLeft>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotateLeft(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 32, %8
%10 = lshr i32 %7, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = or i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rotateLeft(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = lshr i32 %0, %3
%5 = shl i32 %0, %1
%6 = or i32 %4, %5
ret i32 %6
}
void my_pause() {}


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

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

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

LLVM IR (-O2):
define void @my_pause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void vfree(char *cp) {
  if (*cp)
    free(cp);
}


x86 assembly (clang, -O0):
<vfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <vfree+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfree>:
cmpb   $0x0,(%rdi)
je     111a <vfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @vfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @vfree(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int ascend(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<ascend>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @ascend(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int fib(int x) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
ret i32 1
}
int SWAP(int *X, int *Y) {
  int T = *X;
  *X = *Y;
  *Y = T;
}


x86 assembly (clang, -O0):
<SWAP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SWAP(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
int foo(int arg) {
  int **px = &arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: HXFreplace [IN_FW] [OUT_FW] [BIN_FILE]\n\n");
  fprintf(stderr, "Example: HXFreplace VX747.HXF out.hxf ccpmp.bin\n\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf01(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: HXFreplace [IN_FW] [OUT_FW] [BIN_FILE]\0A\0A\00"
@.str.1 = [50 x i8] c"Example: HXFreplace VX747.HXF out.hxf ccpmp.bin\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: HXFreplace [IN_FW] [OUT_FW] [BIN_FILE]\0A\0A\00"
@.str.1 = [50 x i8] c"Example: HXFreplace VX747.HXF out.hxf ccpmp.bin\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
float FRand() { return (float)(rand() - RAND_MAX / 2) / (RAND_MAX / 2); }


x86 assembly (clang, -O0):
<FRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
sub    %edx,%eax
cvtsi2ss %eax,%xmm0
cvtsi2ss %edx,%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define float @FRand() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = sub nsw i32 %1, %3
%5 = sitofp i32 %4 to float
%6 = load i32, i32* @RAND_MAX
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to float
%9 = fdiv float %5, %8
ret float %9
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define float @FRand() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = sub nsw i32 %1, %3
%5 = sitofp i32 %4 to float
%6 = sitofp i32 %3 to float
%7 = fdiv float %5, %6
ret float %7
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct hashtable *);
void ht_destory(struct hashtable *table) {
  int i;
  free(table);
}


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

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

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

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define void @ht_destory(%struct.hashtable* nocapture %0) {
%2 = tail call i32 @free(%struct.hashtable* %0)
ret void
}
/* Variables and functions */
int _ds_pow(int, int);
int _ds_pow2(int exp) { return _ds_pow(2, exp); }


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

x86 assembly (clang, -O2):
<_ds_pow2>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <_ds_pow@plt>

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

LLVM IR (-O2):
define i32 @_ds_pow2(i32 %0) {
%2 = tail call i32 @_ds_pow(i32 2, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ func(int *);
int /*<<< orphan*/ funct(int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int myInt = 5;
  int myInt2 = 5;
  func(&myInt);
  funct(&myInt2);
  printf("%i\n%i\n", myInt, myInt2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <func@plt>
lea    -0xc(%rbp),%rdi
call   1050 <funct@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x5,(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <func@plt>
mov    %rsp,%rdi
call   1050 <funct@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%i\0A%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = call i32 @func(i32* %1)
%6 = call i32 @funct(i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atmel_atmega328_PB5_clear__E();
int /*<<< orphan*/ atmel_atmega328_PB5_makeOutput__E();
void test25_BlinkUno1_pollen__reset__E() {
  atmel_atmega328_PB5_clear__E();
  atmel_atmega328_PB5_makeOutput__E();
}


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

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

LLVM IR (-O0):
define void @test25_BlinkUno1_pollen__reset__E() {
%1 = call i32 (...) @atmel_atmega328_PB5_clear__E()
%2 = call i32 (...) @atmel_atmega328_PB5_makeOutput__E()
ret void
}

LLVM IR (-O2):
define void @test25_BlinkUno1_pollen__reset__E() {
%1 = tail call i32 (...) @atmel_atmega328_PB5_clear__E()
%2 = tail call i32 (...) @atmel_atmega328_PB5_makeOutput__E()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReadToken(char *);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void assert_token(char *ref) {
  char token[350];
  ReadToken(token);
  if (strcmp(ref, token) != 0) {
    sprintf(token, "\"%s\" expected", ref);
    error(token);
  }
}


x86 assembly (clang, -O0):
<assert_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x170(%rbp),%rdi
call   1060 <ReadToken@plt>
mov    -0x8(%rbp),%rdi
lea    -0x170(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1198 <assert_token+0x58>
lea    -0x170(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe79(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x170(%rbp),%rdi
call   1040 <error@plt>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_token>:
push   %r14
push   %rbx
sub    $0x168,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1060 <ReadToken@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1185 <assert_token+0x45>
lea    0xe91(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <error@plt>
add    $0x168,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\22%s\22 expected\00"
define void @assert_token(i8* %0) {
%2 = alloca i8*
%3 = alloca [350 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [350 x i8], [350 x i8]* %3, i64 0, i64 0
%5 = call i32 @ReadToken(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [350 x i8], [350 x i8]* %3, i64 0, i64 0
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = getelementptr inbounds [350 x i8], [350 x i8]* %3, i64 0, i64 0
%12 = load i8*, i8** %2
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [350 x i8], [350 x i8]* %3, i64 0, i64 0
%15 = call i32 @error(i8* %14)
br label %16
16: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\22%s\22 expected\00"
define void @assert_token(i8* %0) {
%2 = alloca [350 x i8]
%3 = getelementptr inbounds [350 x i8], [350 x i8]* %2, i64 0, i64 0
%4 = call i32 @ReadToken(i8* %3)
%5 = call i64 @strcmp(i8* %0, i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = call i32 @error(i8* %3)
br label %10
10: ; preds = %7, %1
ret void
}
char *strcpy(char *dest, const char *src) {
  int d0, d1, d2;
  asm volatile("1:\tlodsb\n\t"
               "stosb\n\t"
               "testb %%al,%%al\n\t"
               "jne 1b"
               : "=&S"(d0), "=&D"(d1), "=&a"(d2)
               : "0"(src), "1"(dest)
               : "memory");
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1114 <strcpy+0x14>
mov    %esi,%ecx
mov    %ecx,-0x14(%rbp)
mov    %edi,%ecx
mov    %ecx,-0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rcx
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1103 <strcpy+0x3>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call { i8*, i8*, i32 } asm sideeffect "1:\09lodsb\0A\09stosb\0A\09testb %al,%al\0A\09jne 1b", "=&{si},=&{di},=&{ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i8*, i8*, i32 } %10, 0
%12 = extractvalue { i8*, i8*, i32 } %10, 1
%13 = extractvalue { i8*, i8*, i32 } %10, 2
%14 = ptrtoint i8* %11 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %12 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
store i32 %13, i32* %7
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call { i8*, i8*, i32 } asm sideeffect "1:\09lodsb\0A\09stosb\0A\09testb %al,%al\0A\09jne 1b", "=&{si},=&{di},=&{ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret i8* %0
}
void V_loaderinit() {}


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

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

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

LLVM IR (-O2):
define void @V_loaderinit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32_iscsi(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
uint32_t crc32_iscsi_wrap(uint32_t seed, const uint8_t *buf, uint64_t len) {
  return crc32_iscsi((uint8_t *)buf, len, seed);
}


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

x86 assembly (clang, -O2):
<crc32_iscsi_wrap>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <crc32_iscsi@plt>

LLVM IR (-O0):
define i32 @crc32_iscsi_wrap(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 = load i32, i32* %4
%10 = call i32 @crc32_iscsi(i32* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @crc32_iscsi_wrap(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @crc32_iscsi(i32* %1, i32 %2, i32 %0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLUquadricObj;

/* Variables and functions */
GLUquadricObj *gluNewQuadric(void) { return NULL; }


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

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

LLVM IR (-O0):
define i32* @gluNewQuadric() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @gluNewQuadric() {
ret i32* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(int /*<<< orphan*/ *);
int c_fflush(void *stream) { return fflush((FILE *)stream); }


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

x86 assembly (clang, -O2):
<c_fflush>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define i32 @c_fflush(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fflush(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mktemp(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void tempname(char *filen) {
  strcpy(filen, "/tmp/tmpXXXXXXXX");
  mktemp(filen);
}


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

x86 assembly (clang, -O2):
<tempname>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mktemp@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/tmp/tmpXXXXXXXX\00"
define void @tempname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @mktemp(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tmp/tmpXXXXXXXX\00"
define void @tempname(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mktemp(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int,
                           int /*<<< orphan*/, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void dup_version() {
  fprintf(stdout,
          "DPA Duplicator version: %u.%u.%u\n"
          "DPA kernel module version: %u.%u.%u\n",
          1, 2, 0, 1, 2, 0);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<dup_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    $0x1,%r9d
mov    $0x2,%ecx
xor    %r8d,%r8d
mov    %r9d,%edx
movl   $0x2,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_version>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
push   $0x0
push   $0x2
call   1030 <fprintf@plt>
add    $0x10,%rsp
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [70 x i8] c"DPA Duplicator version: %u.%u.%u\0ADPA kernel module version: %u.%u.%u\0A\00"
define void @dup_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 0, i32 1, i32 2, i32 0)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [70 x i8] c"DPA Duplicator version: %u.%u.%u\0ADPA kernel module version: %u.%u.%u\0A\00"
define void @dup_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 0, i32 1, i32 2, i32 0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p[10];
  printf("%u \n", sizeof(p));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%u \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 80)
ret i32 0
}
/* Variables and functions */
int syscall(int, void *, size_t, int);
int __madvise(void *addr, size_t len, int advice) {
  return syscall(220, addr, len, advice);
}


x86 assembly (clang, -O0):
<__madvise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xdc,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__madvise>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xdc,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @__madvise(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 220, i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double __nv_dadd_rz(double, double);
double __dadd_rz(double __a, double __b) { return __nv_dadd_rz(__a, __b); }


x86 assembly (clang, -O0):
<__dadd_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__nv_dadd_rz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dadd_rz>:
jmp    1030 <__nv_dadd_rz@plt>

LLVM IR (-O0):
define double @__dadd_rz(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 = call double @__nv_dadd_rz(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dadd_rz(double %0, double %1) {
%3 = tail call double @__nv_dadd_rz(double %0, double %1)
ret double %3
}
unsigned short int f93(unsigned short int x, int y) {
  return (x << (8 * sizeof(unsigned short) - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f93>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x10,%ecx
sub    %rdx,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f93>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f93(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = sub i64 16, %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
%16 = add nsw i32 %11, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f93(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_inc(int *target, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_inc(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int main(void) {
  int c;
  extern const char *_ctype_;
  c = '\e';
  return (c == -1 ? 0 : ((_ctype_ + 1)[c] & 0x20));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1126 <main+0x26>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <main+0x3f>
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
movslq -0x8(%rbp),%rcx
movsbl 0x1(%rax,%rcx,1),%eax
and    $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
movzbl 0x1c(%rax),%eax
and    $0x20,%eax
ret

LLVM IR (-O0):
@_ctype_ = external global i8*
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 27, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %0
br label %15
6: ; preds = %0
%7 = load i8*, i8** @_ctype_
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = and i32 %13, 32
br label %15
15: ; preds = %6, %5
%16 = phi i32 [ 0, %5 ], [ %14, %6 ]
ret i32 %16
}

LLVM IR (-O2):
@_ctype_ = external global i8*
define i32 @main() {
%1 = load i8*, i8** @_ctype_
%2 = getelementptr inbounds i8, i8* %1, i64 28
%3 = load i8, i8* %2
%4 = and i8 %3, 32
%5 = zext i8 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t bl_uart_read_reg(uint32_t addr) {
  volatile uint8_t tmp;
  tmp = *(volatile uint8_t *)addr;
  return (uint16_t)tmp;
}


x86 assembly (clang, -O0):
<bl_uart_read_reg>:
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):
<bl_uart_read_reg>:
mov    (%rdi),%eax
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @bl_uart_read_reg(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = inttoptr i64 %0 to i32*
%5 = load volatile i32, i32* %4
store volatile i32 %5, i32* %2
%6 = load volatile i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int scan_for_intN(char const *, int, long long *, char const **);
int scan_for_int32(const char *_str, int *ret_, const char **end_) {
  long long ret;
  int b_err = scan_for_intN(_str, 32, &ret, end_);
  if (ret_) {
    *ret_ = (int)ret;
  }
  return b_err;
}


x86 assembly (clang, -O0):
<scan_for_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
lea    -0x20(%rbp),%rdx
call   1030 <scan_for_intN@plt>
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <scan_for_int32+0x44>
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_for_int32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rcx
mov    %rsi,%rbx
lea    0x8(%rsp),%rdx
mov    $0x20,%esi
call   1030 <scan_for_intN@plt>
test   %rbx,%rbx
je     1135 <scan_for_int32+0x25>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @scan_for_int32(i8* %0, i32* writeonly %1, i8** %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @scan_for_intN(i8* %0, i32 32, i64* %4, i8** %2)
%7 = icmp eq i32* %1, null
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %3
ret i32 %6
}
/* Variables and functions */
int sqrt(double);
double nu_0(double ne) { return (9e3) * sqrt(ne); }


x86 assembly (clang, -O0):
<nu_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nu_0>:
push   %rax
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nu_0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sqrt(double %3)
%5 = sitofp i32 %4 to double
%6 = fmul double 9.000000e+03, %5
ret double %6
}

LLVM IR (-O2):
define double @nu_0(double %0) {
%2 = tail call i32 @sqrt(double %0)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 9.000000e+03
ret double %4
}
/* Variables and functions */
size_t stun_padding(size_t l) { return (4 - (l & 3)) & 3; }


x86 assembly (clang, -O0):
<stun_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
mov    $0x4,%eax
sub    %rcx,%rax
and    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_padding>:
mov    %rdi,%rax
neg    %eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i64 @stun_padding(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 3
%5 = sub i64 4, %4
%6 = and i64 %5, 3
ret i64 %6
}

LLVM IR (-O2):
define i64 @stun_padding(i64 %0) {
%2 = sub i64 0, %0
%3 = and i64 %2, 3
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Hexify(unsigned char *, int, char *, int);
int /*<<< orphan*/ Sha256String(char *, unsigned char *);
void Sha256HexString(char *str, char output[65]) {
  unsigned char temp[32];
  Sha256String(str, temp);
  Hexify(temp, 32, output, 65);
}


x86 assembly (clang, -O0):
<Sha256HexString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <Sha256String@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x20,%esi
mov    $0x41,%ecx
call   1030 <Hexify@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sha256HexString>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <Sha256String@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    $0x41,%ecx
call   1030 <Hexify@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Sha256HexString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%8 = call i32 @Sha256String(i8* %6, i8* %7)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @Hexify(i8* %9, i32 32, i8* %10, i32 65)
ret void
}

LLVM IR (-O2):
define void @Sha256HexString(i8* %0, i8* %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @Sha256String(i8* %0, i8* %4)
%6 = call i32 @Hexify(i8* %4, i32 32, i8* %1, i32 65)
ret void
}