xunge/DecIR huggingface dataset:
/* Type definitions */
struct usershell {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sdump_usershell(struct usershell *, char *, int);
void dump_usershell(struct usershell *us) {
  if (us != NULL) {
    char buffer[2048];
    sdump_usershell(us, buffer, sizeof(buffer));
    printf("%s\n", buffer);
  } else
    printf("(null)\n");
}


x86 assembly (clang, -O0):
<dump_usershell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <dump_usershell+0x49>
mov    -0x8(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    $0x800,%edx
call   1030 <sdump_usershell@plt>
lea    -0x810(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1177 <dump_usershell+0x57>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_usershell>:
test   %rdi,%rdi
je     114e <dump_usershell+0x2e>
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x800,%edx
call   1040 <sdump_usershell@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x800,%rsp
pop    %rbx
ret
lea    0xeab(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.usershell = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [8 x i8] c"(null)\0A\00"
define void @dump_usershell(%struct.usershell* %0) {
%2 = alloca %struct.usershell*
%3 = alloca [2048 x i8]
store %struct.usershell* %0, %struct.usershell** %2
%4 = load %struct.usershell*, %struct.usershell** %2
%5 = icmp ne %struct.usershell* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load %struct.usershell*, %struct.usershell** %2
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @sdump_usershell(%struct.usershell* %7, i8* %8, i32 2048)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
ret void
}

LLVM IR (-O2):
%struct.usershell = type { i32 }
@str = [7 x i8] c"(null)\00"
define void @dump_usershell(%struct.usershell* %0) {
%2 = alloca [2048 x i8]
%3 = icmp eq %struct.usershell* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%6 = call i32 @sdump_usershell(%struct.usershell* %0, i8* %5, i32 2048)
%7 = call i32 @puts(i8* %5)
br label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret void
}
/* Variables and functions */
int _talloc_free(void *);
int errno;
int /*<<< orphan*/ lock();
int /*<<< orphan*/ unlock();
int talloc_free(void *ptr) {
  int saved_errno = errno, ret;
  lock();
  ret = _talloc_free(ptr);
  unlock();
  if (ret == 0)
    errno = saved_errno;
  return ret;
}


x86 assembly (clang, -O0):
<talloc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <lock@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_talloc_free@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <unlock@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1178 <talloc_free+0x48>
mov    -0xc(%rbp),%ecx
mov    0x2e6a(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_free>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%ebp
xor    %eax,%eax
call   1040 <lock@plt>
mov    %rbx,%rdi
call   1050 <_talloc_free@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <unlock@plt>
test   %ebx,%ebx
jne    1160 <talloc_free+0x30>
mov    %ebp,(%r14)
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @talloc_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i32, i32* @errno
store i32 %5, i32* %3
%6 = call i32 (...) @lock()
%7 = load i8*, i8** %2
%8 = call i32 @_talloc_free(i8* %7)
store i32 %8, i32* %4
%9 = call i32 (...) @unlock()
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* @errno
br label %14
14: ; preds = %12, %1
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @talloc_free(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 (...) @lock()
%4 = tail call i32 @_talloc_free(i8* %0)
%5 = tail call i32 (...) @unlock()
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 %2, i32* @errno
br label %8
8: ; preds = %7, %1
ret i32 %4
}
int kiShuffleVector(int *list, int number) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @kiShuffleVector(i32* nocapture readnone %0, i32 %1) {
ret i32 1
}
int vzevent_send(int msg, const char *attrs_fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vzevent_send(i32 %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initpieces();
int /*<<< orphan*/ measureobjects();
int /*<<< orphan*/ measurepieces();
int /*<<< orphan*/ outputelf();
int /*<<< orphan*/ outputheader();
int /*<<< orphan*/ pickfilenames();
int /*<<< orphan*/ readcmdline(int, char **);
int main(int argc, char *argv[]) {
  readcmdline(argc, argv);
  measureobjects();
  initpieces();
  measurepieces();
  pickfilenames();
  outputelf();
  outputheader();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <readcmdline@plt>
mov    $0x0,%al
call   1090 <measureobjects@plt>
mov    $0x0,%al
call   1040 <initpieces@plt>
mov    $0x0,%al
call   1030 <measurepieces@plt>
mov    $0x0,%al
call   1070 <pickfilenames@plt>
mov    $0x0,%al
call   1050 <outputelf@plt>
mov    $0x0,%al
call   1060 <outputheader@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1080 <readcmdline@plt>
xor    %eax,%eax
call   1090 <measureobjects@plt>
xor    %eax,%eax
call   1040 <initpieces@plt>
xor    %eax,%eax
call   1030 <measurepieces@plt>
xor    %eax,%eax
call   1070 <pickfilenames@plt>
xor    %eax,%eax
call   1050 <outputelf@plt>
xor    %eax,%eax
call   1060 <outputheader@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @readcmdline(i32 %6, i8** %7)
%9 = call i32 (...) @measureobjects()
%10 = call i32 (...) @initpieces()
%11 = call i32 (...) @measurepieces()
%12 = call i32 (...) @pickfilenames()
%13 = call i32 (...) @outputelf()
%14 = call i32 (...) @outputheader()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @readcmdline(i32 %0, i8** %1)
%4 = tail call i32 (...) @measureobjects()
%5 = tail call i32 (...) @initpieces()
%6 = tail call i32 (...) @measurepieces()
%7 = tail call i32 (...) @pickfilenames()
%8 = tail call i32 (...) @outputelf()
%9 = tail call i32 (...) @outputheader()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ get_ticks();
void tsc_spinticks(uint64_t ticks) {
  uint64_t t0;
  t0 = get_ticks();
  for (;;) {
    if (get_ticks() - t0 >= ticks)
      break;
  }
}


x86 assembly (clang, -O0):
<tsc_spinticks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_ticks@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_ticks@plt>
sub    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jl     1141 <tsc_spinticks+0x31>
jmp    1146 <tsc_spinticks+0x36>
jmp    1127 <tsc_spinticks+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsc_spinticks>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <get_ticks@plt>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_ticks@plt>
sub    %rbx,%rax
cmp    %r14,%rax
jl     1130 <tsc_spinticks+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @tsc_spinticks(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @get_ticks()
store i64 %4, i64* %3
br label %5
5: ; preds = %12, %1
%6 = call i64 (...) @get_ticks()
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = load i64, i64* %2
%10 = icmp sge i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
br label %13
12: ; preds = %5
br label %5
13: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @tsc_spinticks(i64 %0) {
%2 = tail call i64 (...) @get_ticks()
br label %3
3: ; preds = %3, %1
%4 = tail call i64 (...) @get_ticks()
%5 = sub nsw i64 %4, %2
%6 = icmp slt i64 %5, %0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Name: ");
  printf("ChenSmallX\n");
  printf("Address: ");
  printf("WHUT Wuhan China\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Name: \00"
@.str.1 = [12 x i8] c"ChenSmallX\0A\00"
@.str.2 = [10 x i8] c"Address: \00"
@.str.3 = [18 x i8] c"WHUT Wuhan China\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Name: \00"
@.str.2 = [10 x i8] c"Address: \00"
@str = [11 x i8] c"ChenSmallX\00"
@str.4 = [17 x i8] c"WHUT Wuhan China\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
void asctoe(s, y) char *s;
unsigned short *y;
{ asctoeg(s, y, (((6 + 3) - 4) * 16)); }


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

x86 assembly (clang, -O2):
<asctoe>:
mov    $0x50,%edx
xor    %eax,%eax
jmp    1030 <asctoeg@plt>

LLVM IR (-O0):
define void @asctoe(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i16*, i16** %4
%7 = call i32 (i8*, i16*, i32, ...) bitcast (i32 (...)* @asctoeg to i32 (i8*, i16*, i32, ...)*)(i8* %5, i16* %6, i32 80)
ret void
}

LLVM IR (-O2):
define void @asctoe(i8* %0, i16* %1) {
%3 = tail call i32 (i8*, i16*, i32, ...) bitcast (i32 (...)* @asctoeg to i32 (i8*, i16*, i32, ...)*)(i8* %0, i16* %1, i32 80)
ret void
}
char *xstrdup(const char *s) {
  void *ptr = strdup(s);
  if (!ptr)
    oom_killer();
  return ptr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <oom_killer@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @oom_killer()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @oom_killer()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int __futex(void volatile *, int /*<<< orphan*/, int, struct timespec const *);
int __futex_wait(volatile void *ftx, int value,
                 const struct timespec *timeout) {
  return __futex(ftx, 0, value, timeout);
}


x86 assembly (clang, -O0):
<__futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <__futex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wait>:
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <__futex@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @__futex_wait(i8* %0, i32 %1, %struct.timespec* %2) {
%4 = tail call i32 @__futex(i8* %0, i32 0, i32 %1, %struct.timespec* %2)
ret i32 %4
}
void foo584(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo584(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_handler(char *);
char *nc_strerror(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
void handle_netcdf_error(const char *msg, int status) {
  char errmsg[512];
  sprintf(errmsg, "%s: %s", msg, nc_strerror(status));
  error_handler(errmsg);
}


x86 assembly (clang, -O0):
<handle_netcdf_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x220(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <nc_strerror@plt>
mov    -0x220(%rbp),%rdi
mov    -0x218(%rbp),%rdx
mov    %rax,%rcx
lea    0xe85(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <error_handler@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_netcdf_error>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <nc_strerror@plt>
lea    0xeb5(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <error_handler@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
define void @handle_netcdf_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @nc_strerror(i32 %8)
%10 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @error_handler(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
define void @handle_netcdf_error(i8* %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = tail call i8* @nc_strerror(i32 %1)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%7 = call i32 @error_handler(i8* %4)
ret void
}
void init_board(int board[3][3]) {
  int x, y;
  for (x = 0; x < 3; x++)
    for (y = 0; y < 3; y++)
      board[x][y] = 0;
}


x86 assembly (clang, -O0):
<init_board>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1165 <init_board+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1152 <init_board+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <init_board+0x20>
jmp    1157 <init_board+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_board+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_board>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @init_board([3 x i32]* nocapture writeonly %0) {
%2 = bitcast [3 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bputc(char *, int *, int);
void bputd(char *msg, int *len, int d) {
  if (d < 10)
    bputc(msg, len, d + '0');
  else
    bputc(msg, len, d - 10 + 'a');
}


x86 assembly (clang, -O0):
<bputd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1145 <bputd+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x30,%edx
call   1030 <bputc@plt>
jmp    115b <bputd+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0xa,%edx
add    $0x61,%edx
call   1030 <bputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bputd>:
lea    0x57(%rdx),%ecx
lea    0x30(%rdx),%eax
cmp    $0xa,%edx
cmovge %ecx,%eax
mov    %eax,%edx
jmp    1030 <bputc@plt>

LLVM IR (-O0):
define void @bputd(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 48
%14 = call i32 @bputc(i8* %10, i32* %11, i32 %13)
br label %22
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 10
%20 = add nsw i32 %19, 97
%21 = call i32 @bputc(i8* %16, i32* %17, i32 %20)
br label %22
22: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
define void @bputd(i8* %0, i32* %1, i32 %2) {
%4 = icmp slt i32 %2, 10
%5 = select i1 %4, i32 48, i32 87
%6 = add nsw i32 %5, %2
%7 = tail call i32 @bputc(i8* %0, i32* %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void mem_copy(void *dst, void *src, size_t s) { memcpy(dst, src, s); }


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

x86 assembly (clang, -O2):
<mem_copy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @mem_copy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ putw(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  FILE *fp;
  scanf("%d", &n);
  fp = fopen("abc.txt", "wb");
  putw(n, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea4(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <putw@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xea6(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    %rax,%rsi
call   1040 <putw@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [3 x i8] c"wb\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @putw(i32 %5, i32* %4)
%7 = call i32 @fclose(i32* %4)
ret void
}
int int_floordivpow2(int a, int b) { return a >> b; }


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

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

LLVM IR (-O0):
define i32 @int_floordivpow2(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 = ashr i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_floordivpow2(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PWM1_0_DriverIRQHandler();
__attribute__((weak)) void PWM1_0_IRQHandler(void) {
  PWM1_0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM1_0_IRQHandler() {
%1 = call i32 (...) @PWM1_0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM1_0_IRQHandler() {
%1 = tail call i32 (...) @PWM1_0_DriverIRQHandler()
ret void
}
int clickplc_exe_Connect2Upper_enc(void *obj, unsigned char *stream) {
  int encsize = 4;
  stream[0] = 0x00;
  stream[1] = 0x03;
  stream[2] = 0xff;
  stream[3] = 0xff;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_Connect2Upper_enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,0x3(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_exe_Connect2Upper_enc>:
movl   $0xffff0300,(%rsi)
mov    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @clickplc_exe_Connect2Upper_enc(i8* nocapture readnone %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 3, i8* %3
%4 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -1, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 3
store i8 -1, i8* %5
ret i32 4
}
int toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return c - ('a' - 'A');
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *appname) {
  fprintf(stdout,
          "Usage: %s [options] sourcefiles dest\n"
          "Options:\n"
          "  -h, --help                Display this help message.\n"
          "\n"
          "Arguments:\n"
          "  sourcefiles               Six input images.\n"
          "  dest                      Output file name.\n",
          appname);
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [206 x i8] c"Usage: %s [options] sourcefiles dest\0AOptions:\0A -h, --help Display this help message.\0A\0AArguments:\0A sourcefiles Six input images.\0A dest Output file name.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [206 x i8] c"Usage: %s [options] sourcefiles dest\0AOptions:\0A -h, --help Display this help message.\0A\0AArguments:\0A sourcefiles Six input images.\0A dest Output file name.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float random();
float ran1() {
  float norm;
  norm = 2147483647.f;
  return random() / norm;
}


x86 assembly (clang, -O0):
<ran1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
divss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ran1>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mulss  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ran1() {
%1 = alloca float
store float 0x41E0000000000000, float* %1
%2 = call float (...) @random()
%3 = load float, float* %1
%4 = fdiv float %2, %3
ret float %4
}

LLVM IR (-O2):
define float @ran1() {
%1 = tail call float (...) @random()
%2 = fmul float %1, 0x3E00000000000000
ret float %2
}
/* Variables and functions */
int main(void) {
  double *ptr = NULL, a;
  a = *(ptr + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double
store i32 0, i32* %1
store double* null, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 1
%6 = load double, double* %5
store double %6, double* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset(int /*<<< orphan*/);
void arch_reset(char mode, const char *cmd) { cpu_reset(0); }


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <cpu_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_reset>:
xor    %edi,%edi
jmp    1030 <cpu_reset@plt>

LLVM IR (-O0):
define void @arch_reset(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = call i32 @cpu_reset(i32 0)
ret void
}

LLVM IR (-O2):
define void @arch_reset(i8 signext %0, i8* nocapture readnone %1) {
%3 = tail call i32 @cpu_reset(i32 0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __xstat(int, char const *, struct stat *);
int __lxstat(int ver, const char *path, struct stat *buf) {
  return __xstat(ver, path, buf);
}


x86 assembly (clang, -O0):
<__lxstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__xstat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lxstat>:
jmp    1030 <__xstat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__lxstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = tail call i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void do_show() {
  char current_dir[64];
  getcwd(current_dir, 64);
  printf("%s \n", current_dir);
}


x86 assembly (clang, -O0):
<do_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1040 <getcwd@plt>
lea    -0x40(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_show>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <getcwd@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define void @do_show() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 64)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ wait(int *);
void handle(int s) {
  int status;
  wait(&status);
  destroy();
  exit(-1);
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <wait@plt>
mov    $0x0,%al
call   1030 <destroy@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
xor    %eax,%eax
call   1030 <destroy@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @handle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait(i32* %3)
%5 = call i32 (...) @destroy()
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @handle(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = call i32 (...) @destroy()
%6 = call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
double __nv_asin(double);
double asin(double __a) { return __nv_asin(__a); }


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

x86 assembly (clang, -O2):
<asin>:
jmp    1030 <__nv_asin@plt>

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

LLVM IR (-O2):
define double @asin(double %0) {
%2 = tail call double @__nv_asin(double %0)
ret double %2
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzWhile_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQUP(int);
int /*<<< orphan*/ TRACE_FOLLOW_THREAD(int, int /*<<< orphan*/);
void BrzWhile_requp(struct comp *comp, int port) {
  struct BrzWhile_ *c = (struct BrzWhile_ *)comp;
  TRACE_FOLLOW_THREAD(1, 0);
  TRACE_FOLLOW_THREAD(2, 0);
  SEND_REQUP(1);
}


x86 assembly (clang, -O0):
<BrzWhile_requp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
mov    $0x1,%edi
call   1040 <SEND_REQUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzWhile_requp>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SEND_REQUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzWhile_ = type { i32 }
define void @BrzWhile_requp(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzWhile_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzWhile_*
store %struct.BrzWhile_* %7, %struct.BrzWhile_** %5
%8 = call i32 @TRACE_FOLLOW_THREAD(i32 1, i32 0)
%9 = call i32 @TRACE_FOLLOW_THREAD(i32 2, i32 0)
%10 = call i32 @SEND_REQUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzWhile_requp(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @TRACE_FOLLOW_THREAD(i32 1, i32 0)
%4 = tail call i32 @TRACE_FOLLOW_THREAD(i32 2, i32 0)
%5 = tail call i32 @SEND_REQUP(i32 1)
ret void
}
int ds_cmp_val(void *a, void *b) {
  if ((long)a < (long)b)
    return -1;
  else if ((long)a == (long)b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<ds_cmp_val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jge    1129 <ds_cmp_val+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <ds_cmp_val+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jne    1146 <ds_cmp_val+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <ds_cmp_val+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_cmp_val>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ds_cmp_val(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_rwlock_init(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
int main() {
  pthread_rwlock_t mutex;
  pthread_rwlock_init(&mutex, NULL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <pthread_rwlock_init@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_rwlock_init(i32* %1, i32* null)
ret i32 0
}
void X509_reject_clear(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_reject_clear() {
ret void
}
double add_floats(double a, double b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_floats>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @add_floats(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
BOOST_AUTO_TEST_CASE(ceiling) {
  TESTCASE1(ceiling, 0, 0);
  TESTCASE1(ceiling, 1, 1);
  TESTCASE1(ceiling, 1.5, 2);
  TESTCASE1(ceiling, -0.8, 0);
  TESTCASE1(ceiling, -1, -1);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
movsd  0xec3(%rip),%xmm0
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
movsd  0xea4(%rip),%xmm0
xor    %esi,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <TESTCASE1@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <TESTCASE1@plt>
movsd  0xec7(%rip),%xmm0
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
movsd  0xeb9(%rip),%xmm0
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %6, i32 1, i32 1)
%8 = load i32, i32* %3
%9 = call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %8, double 1.500000e+00, i32 2)
%10 = load i32, i32* %3
%11 = call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %10, double -8.000000e-01, i32 0)
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %12, i32 -1, i32 -1)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 1, i32 1)
%4 = tail call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %0, double 1.500000e+00, i32 2)
%5 = tail call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %0, double -8.000000e-01, i32 0)
%6 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 -1, i32 -1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
int main() {
  char ch;
  for (ch = 32; ch <= 126; ++ch)
    printf("%X %d %c\n", ch, ch, ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x20,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     1159 <main+0x49>
mov    -0x5(%rbp),%cl
mov    -0x5(%rbp),%al
lea    0xec3(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x5(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x20,%bl
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
add    $0x1,%bl
cmp    $0x7f,%bl
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%X %d %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 32, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %2, i8 signext %2)
%4 = add nuw nsw i8 %2, 1
%5 = icmp eq i8 %4, 127
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}