xunge/DecIR huggingface dataset:
/* Type definitions */
struct Dict {
  int dummy;
};

/* Variables and functions */
void *dict_dell(struct Dict *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void *dict_del(struct Dict *dict, const char *key) {
  return dict_dell(dict, key, strlen(key));
}


x86 assembly (clang, -O0):
<dict_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <dict_dell@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_del>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dict_dell@plt>

LLVM IR (-O0):
%struct.Dict = type { i32 }
define i8* @dict_del(%struct.Dict* %0, i8* %1) {
%3 = alloca %struct.Dict*
%4 = alloca i8*
store %struct.Dict* %0, %struct.Dict** %3
store i8* %1, i8** %4
%5 = load %struct.Dict*, %struct.Dict** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @dict_dell(%struct.Dict* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.Dict = type { i32 }
define i8* @dict_del(%struct.Dict* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @dict_dell(%struct.Dict* %0, i8* %1, i32 %3)
ret i8* %4
}
void shift_x(int x[4], int mu, int steps) {
  x[mu] = (x[mu] + steps + 16) % 16;
  return;
}


x86 assembly (clang, -O0):
<shift_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
add    $0x10,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_x>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
lea    (%rdx,%rcx,1),%esi
add    $0x10,%esi
add    %edx,%ecx
add    $0x1f,%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%esi
mov    %esi,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @shift_x(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 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = add nsw i32 %13, 16
%15 = srem i32 %14, 16
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
ret void
}

LLVM IR (-O2):
define void @shift_x(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = add i32 %2, 16
%8 = add i32 %7, %6
%9 = srem i32 %8, 16
store i32 %9, i32* %5
ret void
}
void main(void) {
  unsigned long a, b, c, d;
  volatile unsigned long *val = (volatile unsigned long *)0x1234;
  a = val[0];
  b = val[1];
  c = a * b;
  val[2] = c;
  d = val[3];
  a = c / d;
  b = c % d;
  val[4] = a;
  val[5] = b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x28(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x1234,%rax
imul   0x123c,%rax
mov    %rax,0x1244
mov    0x124c,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1134 <main+0x34>
xor    %edx,%edx
div    %rcx
jmp    1138 <main+0x38>
xor    %edx,%edx
div    %ecx
mov    %rax,0x1254
mov    %rdx,0x125c
ret

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

LLVM IR (-O2):
define void @main() {
%1 = load volatile i64, i64* inttoptr (i64 4660 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 4668 to i64*)
%3 = mul i64 %2, %1
store volatile i64 %3, i64* inttoptr (i64 4676 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 4684 to i64*)
%5 = udiv i64 %3, %4
%6 = urem i64 %3, %4
store volatile i64 %5, i64* inttoptr (i64 4692 to i64*)
store volatile i64 %6, i64* inttoptr (i64 4700 to i64*)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void smpte_hbrmt_set_fmt_reserve(uint8_t *p_hbrmt) { p_hbrmt[7] = 0; }


x86 assembly (clang, -O0):
<smpte_hbrmt_set_fmt_reserve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_set_fmt_reserve>:
movq   $0x0,0x38(%rdi)
ret

LLVM IR (-O0):
define void @smpte_hbrmt_set_fmt_reserve(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 7
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @smpte_hbrmt_set_fmt_reserve(i64* nocapture writeonly %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 7
store i64 0, i64* %2
ret void
}
/* Variables and functions */
char *strrchr(char *, int);
void last_char_pos(int *index, char *haystack, int needle) {
  char *match;
  match = strrchr(haystack, needle);
  if (match != NULL) {
    *index = (int)(match - haystack);
  }
}


x86 assembly (clang, -O0):
<last_char_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1151 <last_char_pos+0x41>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_char_pos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     112e <last_char_pos+0x1e>
sub    %ebx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @last_char_pos(i32* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %1 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %0
br label %11
11: ; preds = %6, %3
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int);
void BF(char *x, int m, char *y, int n) {
  char *yb;
  long int trobats = 0;
  for (yb = y; *y != '\0'; ++y)
    if (memcmp(x, y, m) == 0)
      trobats++;
}


x86 assembly (clang, -O0):
<BF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1182 <BF+0x72>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    116c <BF+0x5c>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1171 <BF+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <BF+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BF>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x0,(%rdx)
je     1148 <BF+0x38>
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <memcmp@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <BF+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @BF(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %10, %7 ], [ %2, %4 ]
%9 = tail call i64 @memcmp(i8* %0, i8* %8, i32 %1)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %4
ret void
}
int func1(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @func1() {
ret i32 4
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 4
}
/* Variables and functions */
int startMonitoringLeds();
int /*<<< orphan*/ stopMonitoringLeds();
int setLedMonitoring(int on) {
  if (on)
    return startMonitoringLeds();
  stopMonitoringLeds();
  return 1;
}


x86 assembly (clang, -O0):
<setLedMonitoring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <setLedMonitoring+0x24>
mov    $0x0,%al
call   1030 <startMonitoringLeds@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <setLedMonitoring+0x32>
mov    $0x0,%al
call   1040 <stopMonitoringLeds@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLedMonitoring>:
test   %edi,%edi
je     112b <setLedMonitoring+0xb>
xor    %eax,%eax
jmp    1030 <startMonitoringLeds@plt>
push   %rax
xor    %eax,%eax
call   1040 <stopMonitoringLeds@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @setLedMonitoring(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @startMonitoringLeds()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @stopMonitoringLeds()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ 1, %5 ]
ret i32 %8
}
struct s3c2410_nand *s3c2410_get_base_nand(void) {
  return (struct s3c2410_nand *)0x4E000000;
}


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

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

LLVM IR (-O0):
%struct.s3c2410_nand = type opaque
define %struct.s3c2410_nand* @s3c2410_get_base_nand() {
ret %struct.s3c2410_nand* inttoptr (i64 1308622848 to %struct.s3c2410_nand*)
}

LLVM IR (-O2):
%struct.s3c2410_nand = type opaque
define %struct.s3c2410_nand* @s3c2410_get_base_nand() {
ret %struct.s3c2410_nand* inttoptr (i64 1308622848 to %struct.s3c2410_nand*)
}
/* Type definitions */
typedef int uint16_t;
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
typedef int canid_t;

/* Variables and functions */
int can_send_frame(int, struct can_frame *);
int can_send_set_zpointer(int fd, canid_t addr, uint16_t pointer) {
  struct can_frame msg;
  msg.can_id = addr | 1 << 31;
  msg.can_dlc = 8;
  msg.data[0] = 0x01;
  msg.data[1] = pointer >> 8;
  msg.data[2] = pointer & 0xFF;
  return can_send_frame(fd, &msg);
}


x86 assembly (clang, -O0):
<can_send_set_zpointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x20(%rbp)
movl   $0x8,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <can_send_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.can_frame = type { i32, i32, i32* }
define i32 @can_send_set_zpointer(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.can_frame
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = or i32 %8, -2147483648
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %7, i32 0, i32 0
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %7, i32 0, i32 1
store i32 8, i32* %11
%12 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %7, i32 0, i32 2
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 1, i32* %14
%15 = load i32, i32* %6
%16 = ashr i32 %15, 8
%17 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %7, i32 0, i32 2
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %16, i32* %19
%20 = load i32, i32* %6
%21 = and i32 %20, 255
%22 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %7, i32 0, i32 2
%23 = load i32*, i32** %22
%24 = getelementptr inbounds i32, i32* %23, i64 2
store i32 %21, i32* %24
%25 = load i32, i32* %4
%26 = call i32 @can_send_frame(i32 %25, %struct.can_frame* %7)
ret i32 %26
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-Db25678e]\n", prog);
  puts("  -D --device   device to use (default /dev/ttyAMA0)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s [-Db25678e]\0A\00"
@.str.1 = [54 x i8] c" -D --device device to use (default /dev/ttyAMA0)\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s [-Db25678e]\0A\00"
@.str.1 = [54 x i8] c" -D --device device to use (default /dev/ttyAMA0)\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct server_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ wait_children(struct server_ctx *, int /*<<< orphan*/);
void wait_terminated(struct server_ctx *ctx) { wait_children(ctx, WNOHANG); }


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

x86 assembly (clang, -O2):
<wait_terminated>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <wait_children@plt>

LLVM IR (-O0):
%struct.server_ctx = type { i32 }
@WNOHANG = global i32 0
define void @wait_terminated(%struct.server_ctx* %0) {
%2 = alloca %struct.server_ctx*
store %struct.server_ctx* %0, %struct.server_ctx** %2
%3 = load %struct.server_ctx*, %struct.server_ctx** %2
%4 = load i32, i32* @WNOHANG
%5 = call i32 @wait_children(%struct.server_ctx* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.server_ctx = type { i32 }
@WNOHANG = global i32 0
define void @wait_terminated(%struct.server_ctx* %0) {
%2 = load i32, i32* @WNOHANG
%3 = tail call i32 @wait_children(%struct.server_ctx* %0, i32 %2)
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int result;
  printf("%d", exact_square(result));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @exact_square(i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned char *, int);
int /*<<< orphan*/ write(int, unsigned char *, int);
int programmer_erase_chip(int port) {
  unsigned char command;
  unsigned char buffer;
  command = 14;
  write(port, &command, 1);
  read(port, &buffer, 1);
  if (buffer != 'Y') {
    ;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<programmer_erase_chip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0xe,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
movzbl -0xa(%rbp),%eax
cmp    $0x59,%eax
je     116a <programmer_erase_chip+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <programmer_erase_chip+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<programmer_erase_chip>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0xe,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0xe(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1040 <read@plt>
xor    %eax,%eax
cmpb   $0x59,0xe(%rsp)
setne  %al
neg    %eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @programmer_erase_chip(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
store i8 14, i8* %4
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i8* %4, i32 1)
%8 = load i32, i32* %3
%9 = call i32 @read(i32 %8, i8* %5, i32 1)
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 89
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @programmer_erase_chip(i32 %0) {
%2 = alloca i8
%3 = alloca i8
store i8 14, i8* %2
%4 = call i32 @write(i32 %0, i8* %2, i32 1)
%5 = call i32 @read(i32 %0, i8* %3, i32 1)
%6 = load i8, i8* %3
%7 = icmp ne i8 %6, 89
%8 = sext i1 %7 to i32
ret i32 %8
}
unsigned int char2int(unsigned char *foo) {
  return foo[3] * 16777216 + foo[2] * 65536 + foo[1] * 256 + foo[0];
}


x86 assembly (clang, -O0):
<char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @char2int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 16777216
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 65536
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = mul nsw i32 %17, 256
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @char2int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
struct Header *seccore_nextheader(struct Header *pHeader, int size) {
  char *p = (char *)pHeader;
  p += size;
  pHeader = (struct Header *)p;
  return pHeader;
}


x86 assembly (clang, -O0):
<seccore_nextheader>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seccore_nextheader>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.Header = type opaque
define %struct.Header* @seccore_nextheader(%struct.Header* %0, i32 %1) {
%3 = alloca %struct.Header*
%4 = alloca i32
%5 = alloca i8*
store %struct.Header* %0, %struct.Header** %3
store i32 %1, i32* %4
%6 = load %struct.Header*, %struct.Header** %3
%7 = bitcast %struct.Header* %6 to i8*
store i8* %7, i8** %5
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to %struct.Header*
store %struct.Header* %13, %struct.Header** %3
%14 = load %struct.Header*, %struct.Header** %3
ret %struct.Header* %14
}

LLVM IR (-O2):
%struct.Header = type opaque
define %struct.Header* @seccore_nextheader(%struct.Header* readnone %0, i32 %1) {
%3 = bitcast %struct.Header* %0 to i8*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %3, i64 %4
%6 = bitcast i8* %5 to %struct.Header*
ret %struct.Header* %6
}
/* Variables and functions */
int /*<<< orphan*/ display();
void insert() { display(); }


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

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

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

LLVM IR (-O2):
define void @insert() {
%1 = tail call i32 (...) @display()
ret void
}
void Init_ESRI(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_ESRI() {
ret void
}
/* Variables and functions */
void *alloc2(int volatile);
void *alloc1(volatile int one) { return alloc2(one); }


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

x86 assembly (clang, -O2):
<alloc1>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%edi
jmp    1030 <alloc2@plt>

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

LLVM IR (-O2):
define i8* @alloc1(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = tail call i8* @alloc2(i32 %3)
ret i8* %4
}
/* Variables and functions */
int pigpio_command(int, int, int, int /*<<< orphan*/, int);
int wave_get_high_pulses(int pi) { return pigpio_command(pi, 35, 1, 0, 1); }


x86 assembly (clang, -O0):
<wave_get_high_pulses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x23,%esi
mov    $0x1,%r8d
xor    %ecx,%ecx
mov    %r8d,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_get_high_pulses>:
mov    $0x23,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_get_high_pulses(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 35, i32 1, i32 0, i32 1)
ret i32 %2
}
int dlpi_attach(int fd, int ppa) { return -1; }


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

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

LLVM IR (-O0):
define i32 @dlpi_attach(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 @dlpi_attach(i32 %0, i32 %1) {
ret i32 -1
}
fgeu(x, y) unsigned long long int x;
unsigned long long int y;
{
  if (x >= y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fgeu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1126 <fgeu+0x26>
movl   $0xd,-0x4(%rbp)
jmp    112d <fgeu+0x2d>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgeu>:
cmp    %rsi,%rdi
mov    $0x8c,%ecx
mov    $0xd,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fgeu(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp uge i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 13, i32* %3
br label %11
10: ; preds = %2
store i32 140, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @fgeu(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i32 140, i32 13
ret i32 %4
}
float rad_to_deg(float rad) { return (rad / 3.14159265359) * 180; }


x86 assembly (clang, -O0):
<rad_to_deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_to_deg>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @rad_to_deg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x400921FB54442EEA
%6 = fmul double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @rad_to_deg(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 0x400921FB54442EEA
%4 = fmul double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int strlen(char *);
char *strstr(char const *, char *);
const char *pretty_print_FILE(const char *file) {
  const char *base = strstr(file, "bmpanel2");
  return ((base) ? base + strlen("bmpanel2") + 1 : file);
}


x86 assembly (clang, -O0):
<pretty_print_FILE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1178 <pretty_print_FILE+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xea6(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1180 <pretty_print_FILE+0x60>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_print_FILE>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1151 <pretty_print_FILE+0x31>
mov    %rax,%r14
lea    0xebe(%rip),%rdi
call   1030 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rbx
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"bmpanel2\00"
define i8* @pretty_print_FILE(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %2, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
br label %9
9: ; preds = %1, %4
%10 = phi i8* [ %8, %4 ], [ %0, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int get_nn() {
  int nn_get;
  printf("\nNeutron Count?\n\n");
  scanf("%d", &nn_get);
  return (nn_get);
}


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

x86 assembly (clang, -O2):
<get_nn>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ANeutron Count?\0A\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_nn() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [17 x i8] c"\0ANeutron Count?\0A\00"
define i32 @get_nn() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int _get_squareroot(int);
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int i = 0;
  for (i = 0; i < 10000; i++) {
    printf("\nsquare root of %d:=%d", i, _get_squareroot(i));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    1170 <main+0x50>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_get_squareroot@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <_get_squareroot@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x2710,%ebx
jne    1130 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0Asquare root of %d:=%d\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10000
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @_get_squareroot(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0Asquare root of %d:=%d\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @_get_squareroot(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 10000
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
bool test_file(char *f) {
  struct stat sb;
  if (stat(f, &sb) == -1)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <test_file+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <test_file+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @test_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
void bip_parallel_init() {}


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

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

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

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

/* Variables and functions */
int stat(char *, struct stat *);
int file_exists(char *path) {
  struct stat buf;
  return stat(path, &buf);
}


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

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ g(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int z;
  scanf("%i", &z);
  g(&z);
  printf("%d", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <g@plt>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <g@plt>
mov    0xc(%rsp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @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 @g(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int security_unix_may_send(struct socket *sock, struct socket *other) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.socket = type opaque
define i32 @security_unix_may_send(%struct.socket* nocapture readnone %0, %struct.socket* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread_short(void *ptr, size_t size, size_t nitems, FILE *stream) {
  return fread(ptr, size, nitems, stream);
}


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

x86 assembly (clang, -O2):
<fread_short>:
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @fread_short(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
void foo784(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo784(i32 %0) {
ret void
}
int int_min(register int x, register int y) {
  if (x < y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <int_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <int_min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @int_min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @int_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
double mod2pi(double x) {
  double quotient;
  long iq;
  quotient = x / (2. * 3.1415926535897932384626433);
  iq = (long)quotient;
  if (quotient < 0.)
    iq -= 1;
  return (x - (double)iq * 2. * 3.1415926535897932384626433);
}


x86 assembly (clang, -O0):
<mod2pi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1143 <mod2pi+0x43>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe8f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi>:
movapd %xmm0,%xmm1
divsd  0xef4(%rip),%xmm1
cvttsd2si %xmm1,%rax
xorpd  %xmm2,%xmm2
xor    %ecx,%ecx
ucomisd %xmm1,%xmm2
seta   %cl
sub    %rcx,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mulsd  0xed7(%rip),%xmm1
mulsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mod2pi(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i64
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 0x401921FB54442D18
store double %6, double* %3
%7 = load double, double* %3
%8 = fptosi double %7 to i64
store i64 %8, i64* %4
%9 = load double, double* %3
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i64, i64* %4
%13 = sub nsw i64 %12, 1
store i64 %13, i64* %4
br label %14
14: ; preds = %11, %1
%15 = load double, double* %2
%16 = load i64, i64* %4
%17 = sitofp i64 %16 to double
%18 = fmul double %17, 2.000000e+00
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double %19, double 0x400921FB54442D18, double %15)
ret double %20
}

LLVM IR (-O2):
define double @mod2pi(double %0) {
%2 = fdiv double %0, 0x401921FB54442D18
%3 = fptosi double %2 to i64
%4 = fcmp olt double %2, 0.000000e+00
%5 = sext i1 %4 to i64
%6 = add nsw i64 %5, %3
%7 = sitofp i64 %6 to double
%8 = fmul double %7, -2.000000e+00
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x400921FB54442D18, double %0)
ret double %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_standard_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(760, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @write_standard_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 760, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}