xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ time_t;
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t time(time_t *t) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  if (t)
    *t = (time_t)tv.tv_sec;
  return (time_t)tv.tv_sec;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmpq   $0x0,-0x8(%rbp)
je     113f <time+0x2f>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
test   %rbx,%rbx
je     1131 <time+0x21>
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @time(i64* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = icmp eq i64* %0, null
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load i64, i64* %6
br i1 %5, label %9, label %8
8: ; preds = %1
store i64 %7, i64* %0
br label %9
9: ; preds = %1, %8
ret i64 %7
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
main() {
  pid_t mypid;
  void letsfork(void);
  int a;
  a = 10;
  mypid = getpid();
  printf("I am the parent: pid=%d  a=%d\n", mypid, a);
  letsfork();
  mypid = getpid();
  a++;
  printf("who am I: pid=%d  a=%d\n", mypid, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
call   1050 <letsfork@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <printf@plt>
call   1050 <letsfork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
mov    $0xb,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"I am the parent: pid=%d a=%d\0A\00"
@.str.1 = [24 x i8] c"who am I: pid=%d a=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %2
%3 = call i32 (...) @getpid()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 (...) @getpid()
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"I am the parent: pid=%d a=%d\0A\00"
@.str.1 = [24 x i8] c"who am I: pid=%d a=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i32 10)
tail call void @letsfork()
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 11)
ret i32 0
}
int XGrabPointer() { return 0; }


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

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

LLVM IR (-O0):
define i32 @XGrabPointer() {
ret i32 0
}

LLVM IR (-O2):
define i32 @XGrabPointer() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgstorgb(char *s) { sgen("%s\t%%al,%s", "movb", s); }


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

x86 assembly (clang, -O2):
<cgstorgb>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeea(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09%%al,%s\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorgb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09%%al,%s\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorgb(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ dt_char_is_lower(unsigned char);
unsigned char dt_char_to_upper(unsigned char c) {
  if (dt_char_is_lower(c))
    c &= 0xDF;
  return c;
}


x86 assembly (clang, -O0):
<dt_char_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <dt_char_is_lower@plt>
cmp    $0x0,%rax
je     113d <dt_char_to_upper+0x2d>
movzbl -0x1(%rbp),%eax
and    $0xdf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_char_to_upper>:
push   %rbx
mov    %edi,%ebx
call   1030 <dt_char_is_lower@plt>
mov    %ebx,%ecx
and    $0xdf,%cl
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @dt_char_to_upper(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @dt_char_is_lower(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 223
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @dt_char_to_upper(i8 zeroext %0) {
%2 = tail call i64 @dt_char_is_lower(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = and i8 %0, -33
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
int rand();
int random_register(int definition[3][5]) {
  int relative_index;
  int index;
  relative_index = rand() % *definition[1];
  index = definition[0][relative_index];
  return index;
}


x86 assembly (clang, -O0):
<random_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%rcx
cltd
idivl  0x14(%rcx)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_register>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idivl  0x14(%rbx)
movslq %edx,%rax
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_register([5 x i32]* %0) {
%2 = alloca [5 x i32]*
%3 = alloca i32
%4 = alloca i32
store [5 x i32]* %0, [5 x i32]** %2
%5 = call i32 (...) @rand()
%6 = load [5 x i32]*, [5 x i32]** %2
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 1
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %8
%10 = srem i32 %5, %9
store i32 %10, i32* %3
%11 = load [5 x i32]*, [5 x i32]** %2
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @random_register([5 x i32]* nocapture %0) {
%2 = tail call i32 (...) @rand()
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 1, i64 0
%4 = load i32, i32* %3
%5 = srem i32 %2, %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ dbgprintf(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int unlink(char const *);
void delete_file(const char *filename) {
  if (unlink(filename) == -1)
    dbgprintf("%s: %s\n", filename, strerror(errno));
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1176 <delete_file+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe8f(%rip),%rdi
call   1040 <dbgprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     1140 <delete_file+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <dbgprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @delete_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @dbgprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @delete_file(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @dbgprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_get_index() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_get_index"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_stream_get_index\00"
define i32 @pa_stream_get_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void *nla_reserve(void **, int, int);
void nla_put_u8(void **ctx, int t, __u8 var) {
  void *data = nla_reserve(ctx, t, sizeof(__u8));
  *(__u8 *)data = var;
}


x86 assembly (clang, -O0):
<nla_put_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nla_put_u8(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 i8**, i8*** %4
%9 = load i32, i32* %5
%10 = call i8* @nla_reserve(i8** %8, i32 %9, i32 4)
store i8* %10, i8** %7
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to i32*
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @nla_put_u8(i8** %0, i32 %1, i32 %2) {
%4 = tail call i8* @nla_reserve(i8** %0, i32 %1, i32 4)
%5 = bitcast i8* %4 to i32*
store i32 %2, i32* %5
ret void
}
int do_440() { return 440; }


x86 assembly (clang, -O0):
<do_440>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_440() {
ret i32 440
}

LLVM IR (-O2):
define i32 @do_440() {
ret i32 440
}
/* Variables and functions */
scalar_t__ rte_eal_pci_probe();
int init_drivers(void) {
  if (rte_eal_pci_probe() < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<init_drivers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rte_eal_pci_probe@plt>
cmp    $0x0,%rax
jge    1135 <init_drivers+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <init_drivers+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_drivers>:
push   %rax
xor    %eax,%eax
call   1030 <rte_eal_pci_probe@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @init_drivers() {
%1 = alloca i32
%2 = call i64 (...) @rte_eal_pci_probe()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @init_drivers() {
%1 = tail call i64 (...) @rte_eal_pci_probe()
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
int pare_konp(const void *a, const void *b) {
  int var;
  char *pare1, *pare2;
  pare1 = (char *)a;
  pare2 = (char *)b;
  var = (*pare1 - *pare2);
  if (!var)
    return (*(pare1 + 1) - *(pare2 + 1));
  else
    return (var);
}


x86 assembly (clang, -O0):
<pare_konp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
mov    -0x30(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1153 <pare_konp+0x53>
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x30(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <pare_konp+0x59>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pare_konp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
je     110b <pare_konp+0xb>
ret
movsbl 0x1(%rdi),%eax
movsbl 0x1(%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pare_konp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = getelementptr inbounds i8, i8* %1, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %12, %15
br label %17
17: ; preds = %2, %9
%18 = phi i32 [ %16, %9 ], [ %7, %2 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int readInput(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("USAGE: ./a.out <INPUT.txt>\n");
    return 0;
  }
  int eCheck = readInput(argv[1]);
  if (eCheck == 1)
    return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <readInput@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1179 <main+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    113b <main+0x1b>
mov    0x8(%rsi),%rdi
call   1040 <readInput@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"USAGE: ./a.out <INPUT.txt>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @readInput(i8* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 1, i32* %3
br label %19
19: ; preds = %9, %18, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [27 x i8] c"USAGE: ./a.out <INPUT.txt>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @readInput(i8* %8)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ 0, %4 ], [ %11, %6 ]
ret i32 %13
}
void ff_hevc_put_hevc_uni_epel_hv32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv32_12_sse4() {
ret void
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_log_acc_on(struct sip_msg *);
int is_acc_on(struct sip_msg *rq) {
  if (is_log_acc_on(rq))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_acc_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_log_acc_on@plt>
cmp    $0x0,%rax
je     113b <is_acc_on+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_acc_on+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_acc_on>:
push   %rax
call   1030 <is_log_acc_on@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
define i32 @is_acc_on(%struct.sip_msg* %0) {
%2 = alloca i32
%3 = alloca %struct.sip_msg*
store %struct.sip_msg* %0, %struct.sip_msg** %3
%4 = load %struct.sip_msg*, %struct.sip_msg** %3
%5 = call i64 @is_log_acc_on(%struct.sip_msg* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @is_acc_on(%struct.sip_msg* %0) {
%2 = tail call i64 @is_log_acc_on(%struct.sip_msg* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test2_func();
int main() { printf("%d\n", test2_func()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test2_func@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test2_func()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void cause_segfault() {
  int *p = (int *)0x12345678;
  *p = 0;
}


x86 assembly (clang, -O0):
<cause_segfault>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cause_segfault>:
movl   $0x0,0x12345678
ret

LLVM IR (-O0):
define void @cause_segfault() {
%1 = alloca i32*
store i32* inttoptr (i64 305419896 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @cause_segfault() {
store i32 0, i32* inttoptr (i64 305419896 to i32*)
ret void
}
/* Variables and functions */
int M_PI;
double cos(int);
int log(double);
double sqrt(int);
double uni();
double norm() {
  double u;
  double v;
  u = uni();
  v = uni();
  return (sqrt(-2 * log(u)) * cos(2 * M_PI * v));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <uni@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <uni@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <uni@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <uni@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1060 <sqrt@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  0x10(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @norm() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @uni()
store double %3, double* %1
%4 = call double (...) @uni()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @log(double %5)
%7 = mul nsw i32 -2, %6
%8 = call double @sqrt(i32 %7)
%9 = load i32, i32* @M_PI
%10 = mul nsw i32 2, %9
%11 = sitofp i32 %10 to double
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = fptosi double %13 to i32
%15 = call double @cos(i32 %14)
%16 = fmul double %8, %15
ret double %16
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @norm() {
%1 = tail call double (...) @uni()
%2 = tail call double (...) @uni()
%3 = tail call i32 @log(double %1)
%4 = mul nsw i32 %3, -2
%5 = tail call double @sqrt(i32 %4)
%6 = load i32, i32* @M_PI
%7 = shl nsw i32 %6, 1
%8 = sitofp i32 %7 to double
%9 = fmul double %2, %8
%10 = fptosi double %9 to i32
%11 = tail call double @cos(i32 %10)
%12 = fmul double %5, %11
ret double %12
}
int sign(float x) { return (x >= 0.f ? 1.f : -1.f); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm0,%xmm0
cmpless %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sign(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float 1.000000e+00, float -1.000000e+00
%7 = fptosi float %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @sign(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
%4 = fptosi float %3 to i32
ret i32 %4
}
/* Variables and functions */
double vector_magnitude_3d(double *);
void vector_normalize_3d(double v[3]) {
  double mag = vector_magnitude_3d(v);
  v[0] /= mag;
  v[1] /= mag;
  v[2] /= mag;
}


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

x86 assembly (clang, -O2):
<vector_normalize_3d>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vector_magnitude_3d@plt>
movupd (%rbx),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%rbx)
movsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @vector_normalize_3d(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call double @vector_magnitude_3d(double* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = fdiv double %9, %6
store double %10, double* %8
%11 = load double, double* %3
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fdiv double %14, %11
store double %15, double* %13
%16 = load double, double* %3
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fdiv double %19, %16
store double %20, double* %18
ret void
}

LLVM IR (-O2):
define void @vector_normalize_3d(double* %0) {
%2 = tail call double @vector_magnitude_3d(double* %0)
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %2, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fdiv double %10, %2
store double %11, double* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initializeCodysTestBase();
void initialize() { initializeCodysTestBase(); }


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

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

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

LLVM IR (-O2):
define void @initialize() {
%1 = tail call i32 (...) @initializeCodysTestBase()
ret void
}
void recolor_parent(int p, int *left, int *right, int *parent, int *color) {
  color[left[p]] = 0;
  color[right[p]] = 0;
  color[p] = 1;
}


x86 assembly (clang, -O0):
<recolor_parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x4(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x4(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<recolor_parent>:
movslq %edi,%rax
movslq (%rsi,%rax,4),%rcx
movl   $0x0,(%r8,%rcx,4)
movslq (%rdx,%rax,4),%rcx
movl   $0x0,(%r8,%rcx,4)
movl   $0x1,(%r8,%rax,4)
ret

LLVM IR (-O0):
define void @recolor_parent(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %10
%12 = load i32*, i32** %7
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %11, i64 %17
store i32 0, i32* %18
%19 = load i32*, i32** %10
%20 = load i32*, i32** %8
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %19, i64 %25
store i32 0, i32* %26
%27 = load i32*, i32** %10
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 1, i32* %30
ret void
}

LLVM IR (-O2):
define void @recolor_parent(i32 %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture readnone %3, i32* nocapture writeonly %4) {
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %4, i64 %9
store i32 0, i32* %10
%11 = getelementptr inbounds i32, i32* %2, i64 %6
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %4, i64 %13
store i32 0, i32* %14
%15 = getelementptr inbounds i32, i32* %4, i64 %6
store i32 1, i32* %15
ret void
}
void PCCloseDir(void *handle) {}


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

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

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

LLVM IR (-O2):
define void @PCCloseDir(i8* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ byte1;
};
typedef TYPE_1__ XChar2b;

/* Variables and functions */
unsigned char get_XChar2b_byte1(void *_p) {
  return (unsigned char)((XChar2b *)_p)->byte1;
}


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

x86 assembly (clang, -O2):
<get_XChar2b_byte1>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @get_XChar2b_byte1(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int secp256k1_selftest_sha256();
int secp256k1_selftest(void) { return secp256k1_selftest_sha256(); }


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

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

LLVM IR (-O0):
define i32 @secp256k1_selftest() {
%1 = call i32 (...) @secp256k1_selftest_sha256()
ret i32 %1
}

LLVM IR (-O2):
define i32 @secp256k1_selftest() {
%1 = tail call i32 (...) @secp256k1_selftest_sha256()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroyArray(void *v) {
  free(v);
  v = NULL;
}


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

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

LLVM IR (-O0):
define void @destroyArray(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @destroyArray(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail_file();
int /*<<< orphan*/ perror(char *);
size_t write(int const, void const *const, size_t const);
size_t uwrite(int const fd, void const *const buf, size_t const count) {
  size_t const n = write(fd, buf, count);
  if (n != count) {
    perror("write");
    fail_file();
  }
  return n;
}


x86 assembly (clang, -O0):
<uwrite>:
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   1040 <write@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1178 <uwrite+0x48>
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <fail_file@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwrite>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <write@plt>
mov    %rax,%r14
cmp    %rbx,%rax
jne    114f <uwrite+0x1f>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeaa(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <fail_file@plt>
jmp    1144 <uwrite+0x14>

LLVM IR (-O0):
@.str = [6 x i8] c"write\00"
define i64 @uwrite(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @write(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (...) @fail_file()
br label %18
18: ; preds = %15, %3
%19 = load i64, i64* %7
ret i64 %19
}

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define i64 @uwrite(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @fail_file()
br label %9
9: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int anetSetBlock(char *, int, int);
int catAnetNonBlock(char *err, int fd) { return anetSetBlock(err, fd, 1); }


x86 assembly (clang, -O0):
<catAnetNonBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <anetSetBlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catAnetNonBlock>:
mov    $0x1,%edx
jmp    1030 <anetSetBlock@plt>

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

LLVM IR (-O2):
define i32 @catAnetNonBlock(i8* %0, i32 %1) {
%3 = tail call i32 @anetSetBlock(i8* %0, i32 %1, i32 1)
ret i32 %3
}
void HAL_MspInit(void) {}


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

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

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

LLVM IR (-O2):
define void @HAL_MspInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_group_header();
void fgmvwrite_group_header_() { gmvwrite_group_header(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_group_header_() {
%1 = tail call i32 (...) @gmvwrite_group_header()
ret void
}
/* Variables and functions */
int LittleLong(int l) { return l; }


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

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

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

LLVM IR (-O2):
define i32 @LittleLong(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ssc_freedata(void *data) {
  free(data);
  return;
}


x86 assembly (clang, -O0):
<ssc_freedata>:
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):
<ssc_freedata>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ssc_freedata(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ i2c_wr(int, int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void i2c_wr16(int fd, uint16_t reg, uint16_t val) {
  i2c_wr(fd, reg, (uint8_t *)&val, 2);
}


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

x86 assembly (clang, -O2):
<i2c_wr16>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <i2c_wr@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @i2c_wr16(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @i2c_wr(i32 %0, i32 %1, i32* %4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("beckham.in", "r", stdin);
  freopen("beckham.out", "w+", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xed0(%rip),%rdi
lea    0xed5(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"beckham.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [12 x i8] c"beckham.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"beckham.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [12 x i8] c"beckham.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
int ds(int n) {
  int ds1(int n, int m);
  ds1(n, 9);
  return 0;
}


x86 assembly (clang, -O0):
<ds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9,%esi
call   1030 <ds1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds>:
push   %rax
mov    $0x9,%esi
call   1030 <ds1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ds(i32 %0) {
%2 = tail call i32 @ds1(i32 %0, i32 9)
ret i32 0
}
unsigned int extract_n_lower_bits(unsigned int num, unsigned int n) {
  unsigned int shift_amount = 8 * sizeof(unsigned int) - n;
  return ((num << shift_amount) >> shift_amount);
}


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

x86 assembly (clang, -O2):
<extract_n_lower_bits>:
mov    %esi,%ecx
mov    %edi,%eax
neg    %cl
shl    %cl,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @extract_n_lower_bits(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* %4
%7 = zext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = load i32, i32* %5
%14 = lshr i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @extract_n_lower_bits(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = lshr i32 -1, %3
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_words(char *);
int main() {
  char a[100];
  gets(a);
  reverse_words(a);
  printf("%s\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <reverse_words@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @reverse_words(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R_PurgeBackupImages(int);
int /*<<< orphan*/ R_PurgeModels(int);
int /*<<< orphan*/ R_PurgeShaders(int);
void R_PurgeCache(void) {
  R_PurgeShaders(9999999);
  R_PurgeBackupImages(9999999);
  R_PurgeModels(9999999);
}


x86 assembly (clang, -O0):
<R_PurgeCache>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98967f,%edi
call   1030 <R_PurgeShaders@plt>
mov    $0x98967f,%edi
call   1050 <R_PurgeBackupImages@plt>
mov    $0x98967f,%edi
call   1040 <R_PurgeModels@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_PurgeCache>:
push   %rax
mov    $0x98967f,%edi
call   1030 <R_PurgeShaders@plt>
mov    $0x98967f,%edi
call   1050 <R_PurgeBackupImages@plt>
mov    $0x98967f,%edi
pop    %rax
jmp    1040 <R_PurgeModels@plt>

LLVM IR (-O0):
define void @R_PurgeCache() {
%1 = call i32 @R_PurgeShaders(i32 9999999)
%2 = call i32 @R_PurgeBackupImages(i32 9999999)
%3 = call i32 @R_PurgeModels(i32 9999999)
ret void
}

LLVM IR (-O2):
define void @R_PurgeCache() {
%1 = tail call i32 @R_PurgeShaders(i32 9999999)
%2 = tail call i32 @R_PurgeBackupImages(i32 9999999)
%3 = tail call i32 @R_PurgeModels(i32 9999999)
ret void
}