xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char const *, int);
int /*<<< orphan*/ perror(char *);
int safe_open(const char *path, int oflag) {
  int fh = open(path, oflag);
  if (fh == -1) {
    perror("safe_open - Failed to open file.");
    exit(EXIT_FAILURE);
  }
  return fh;
}


x86 assembly (clang, -O0):
<safe_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1172 <safe_open+0x42>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_open>:
push   %rax
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     113d <safe_open+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"safe_open - Failed to open file.\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [33 x i8] c"safe_open - Failed to open file.\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ EAGAIN;
scalar_t__ errno;
int /*<<< orphan*/ perror(char *);
int write(int, void *, int);
void send_tap(int fd, void *packet, int len, void *unused) {
  int n;
  n = write(fd, packet, len);
  if (n != len) {
    if (errno != EAGAIN)
      perror("send_tap");
  }
}


x86 assembly (clang, -O0):
<send_tap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     117f <send_tap+0x5f>
mov    0x2e85(%rip),%rax
mov    (%rax),%rax
mov    0x2e6b(%rip),%rcx
cmp    (%rcx),%rax
je     117a <send_tap+0x5a>
lea    0xe8b(%rip),%rdi
call   1040 <perror@plt>
jmp    117f <send_tap+0x5f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_tap>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
je     1142 <send_tap+0x22>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%rax
jne    1144 <send_tap+0x24>
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
pop    %rbx
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@errno = global i64 0
@EAGAIN = global i64 0
@.str = [9 x i8] c"send_tap\00"
define void @send_tap(i32 %0, i8* nocapture %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, %2
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EAGAIN
%10 = icmp eq i64 %8, %9
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %7, %11, %4
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int toupper(int c) {
  if (isupper(c))
    return c ^= 0x20;
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x8(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void op0xD3(void) {}


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

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

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

LLVM IR (-O2):
define void @op0xD3() {
ret void
}
void fault_isr_handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<fault_isr_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fault_isr_handler+0x9>
jmp    1109 <fault_isr_handler+0x9>

x86 assembly (clang, -O2):
<fault_isr_handler>:
jmp    1100 <fault_isr_handler>

LLVM IR (-O0):
define void @fault_isr_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @fault_isr_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
long heap_left(long index) { return index * 2; }


x86 assembly (clang, -O0):
<heap_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_left>:
lea    (%rdi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @heap_left(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 2
ret i64 %4
}

LLVM IR (-O2):
define i64 @heap_left(i64 %0) {
%2 = shl nsw i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void logmsg(const char *msg, void *data) { printf("%s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @logmsg(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clock_freeze();
void game_leave(void) { clock_freeze(); }


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

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

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

LLVM IR (-O2):
define void @game_leave() {
%1 = tail call i32 (...) @clock_freeze()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int main() {
  int x;
  int p = 1;
  for (x = 10; x > 0; x--) {
    if (p != 1)
      __VERIFIER_error();
    if (x == 1)
      p = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    116c <main+0x5c>
cmpl   $0x1,-0xc(%rbp)
je     1148 <main+0x38>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1159 <main+0x49>
movl   $0x0,-0xc(%rbp)
jmp    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store i32 10, i32* %2
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @__VERIFIER_error()
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %3
br label %16
16: ; preds = %15, %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
br label %4
20: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int strcmp(void const *, void const *);
int comparestrings(const void *arg1, const void *arg2) {
  return (strcmp(arg1, arg2));
}


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

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

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

LLVM IR (-O2):
define i32 @comparestrings(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mask;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int errno;
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int setaffinity(int thread_id) {
  cpu_set_t mask;
  CPU_ZERO(&mask);
  CPU_SET(thread_id, &mask);
  if (0 != sched_setaffinity(0, sizeof(mask), &mask))
    return errno;
  else
    return 0;
}


x86 assembly (clang, -O0):
<setaffinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     117f <setaffinity+0x4f>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <setaffinity+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setaffinity>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <CPU_SET@plt>
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <sched_setaffinity@plt>
test   %rax,%rax
je     116c <setaffinity+0x3c>
mov    0x2e76(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @setaffinity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @CPU_ZERO(i32* %4)
%6 = load i32, i32* %3
%7 = call i32 @CPU_SET(i32 %6, i32* %4)
%8 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %4)
%9 = icmp ne i64 0, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @errno
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @setaffinity(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %2)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* @errno
%9 = select i1 %7, i32 0, i32 %8
ret i32 %9
}
int strcmp(char *s1, char *s2) {
  while (*s1 == *s2++)
    if (*s1++ == 0)
      return (0);
  return (*s1 - *--s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strcmp+0x78>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %6 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
void container_free(char ***map, unsigned *mac, unsigned *max) {
  unsigned i;
  for (i = 0; i < *mac; ++i)
    free((*map)[i]);
  free(*map);
}


x86 assembly (clang, -O0):
<container_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jae    115b <container_free+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <container_free+0x1b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<container_free>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmpl   $0x0,(%rsi)
je     1148 <container_free+0x38>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
mov    (%r15),%eax
cmp    %rax,%rbx
jb     1130 <container_free+0x20>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @container_free(i8*** nocapture %0, i32* nocapture %1, i32* nocapture readnone %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = load i8**, i8*** %0
%9 = getelementptr inbounds i8*, i8** %8, i64 %7
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = load i32, i32* %1
%13 = zext i32 %12 to i64
%14 = icmp ult i64 %11, %13
br i1 %14, label %6, label %15
15: ; preds = %6, %3
%16 = bitcast i8*** %0 to i8**
%17 = load i8*, i8** %16
tail call void @free(i8* %17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outw(unsigned short, unsigned short *);
void lcd_hpi_write_word(unsigned short chip_addr, unsigned short value) {
  outw(chip_addr, (unsigned short *)((0x0002 << 1) + 0xfff24000));
  outw(value, (unsigned short *)((0x0000 << 1) + 0xfff24000));
}


x86 assembly (clang, -O0):
<lcd_hpi_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0xfff24004,%esi
movzwl -0x2(%rbp),%edi
call   1030 <outw@plt>
mov    $0xfff24000,%esi
movzwl -0x4(%rbp),%edi
call   1030 <outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_hpi_write_word>:
push   %rbx
mov    %esi,%ebx
mov    $0xfff24000,%eax
lea    0x4(%rax),%rsi
call   1030 <outw@plt>
mov    $0xfff24000,%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @lcd_hpi_write_word(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @outw(i16 zeroext %5, i16* inttoptr (i64 4294066180 to i16*))
%7 = load i16, i16* %4
%8 = call i32 @outw(i16 zeroext %7, i16* inttoptr (i64 4294066176 to i16*))
ret void
}

LLVM IR (-O2):
define void @lcd_hpi_write_word(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @outw(i16 zeroext %0, i16* inttoptr (i64 4294066180 to i16*))
%4 = tail call i32 @outw(i16 zeroext %1, i16* inttoptr (i64 4294066176 to i16*))
ret void
}
ret_() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ret_() {
ret i32 0
}
char *BN_GetCopyright(void) {
  return "Botnet version "
         "1.6.3"
         " (c) Christophe CALMEJANE (Ze KiLleR / SkyTech) 1999'01";
}


x86 assembly (clang, -O0):
<BN_GetCopyright>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_GetCopyright>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Botnet version 1.6.3 (c) Christophe CALMEJANE (Ze KiLleR / SkyTech) 1999'01\00"
define i8* @BN_GetCopyright() {
ret i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [76 x i8] c"Botnet version 1.6.3 (c) Christophe CALMEJANE (Ze KiLleR / SkyTech) 1999'01\00"
define i8* @BN_GetCopyright() {
ret i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int read_after_free() {
  volatile int *x = malloc(sizeof(int));
  *x = 1;
  free((int *)x);
  return *x;
}


x86 assembly (clang, -O0):
<read_after_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_after_free>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x1,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_after_free() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store volatile i32 1, i32* %3
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
%6 = load i32*, i32** %1
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @read_after_free() {
%1 = tail call i32* @malloc(i32 4)
store volatile i32 1, i32* %1
%2 = tail call i32 @free(i32* %1)
%3 = load volatile i32, i32* %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ geoXyz2Rae(double *, double *);
double geoXyz2E(double x, double y, double z) {
  double rae[3], xyz[3];
  xyz[0] = x;
  xyz[1] = y;
  xyz[2] = z;
  geoXyz2Rae(xyz, rae);
  return (rae[2] * (180.0 / 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<geoXyz2E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <geoXyz2Rae@plt>
movsd  0xea6(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoXyz2E>:
sub    $0x38,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <geoXyz2Rae@plt>
movsd  0x30(%rsp),%xmm0
mulsd  0xec0(%rip),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @geoXyz2E(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [3 x double]
%8 = alloca [3 x double]
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
store double %9, double* %10
%11 = load double, double* %5
%12 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 1
store double %11, double* %12
%13 = load double, double* %6
%14 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 2
store double %13, double* %14
%15 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%16 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%17 = call i32 @geoXyz2Rae(double* %15, double* %16)
%18 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%19 = load double, double* %18
%20 = fmul double %19, 0x404CA5DC1A63C1F8
ret double %20
}

LLVM IR (-O2):
define double @geoXyz2E(double %0, double %1, double %2) {
%4 = alloca [3 x double]
%5 = alloca [3 x double]
%6 = bitcast [3 x double]* %4 to i8*
%7 = bitcast [3 x double]* %5 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
store double %0, double* %8
%9 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
store double %1, double* %9
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
store double %2, double* %10
%11 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%12 = call i32 @geoXyz2Rae(double* %8, double* %11)
%13 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%14 = load double, double* %13
%15 = fmul double %14, 0x404CA5DC1A63C1F8
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int /*<<< orphan*/);
void my_putzero(int nb) {
  int i;
  i = -1;
  if (nb < 0)
    return;
  while (++i < nb)
    my_putchar('0');
}


x86 assembly (clang, -O0):
<my_putzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1131 <my_putzero+0x21>
jmp    1157 <my_putzero+0x47>
jmp    1136 <my_putzero+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
jge    1157 <my_putzero+0x47>
mov    $0x30,%edi
call   1030 <my_putchar@plt>
jmp    1136 <my_putzero+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putzero>:
push   %rbx
test   %edi,%edi
jle    112f <my_putzero+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x30,%edi
call   1030 <my_putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <my_putzero+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_putzero(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @my_putchar(i32 48)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int biosig_set_recording_additional(int handle,
                                    const char *recording_additional) {
  return (-1);
}


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

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

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

LLVM IR (-O2):
define i32 @biosig_set_recording_additional(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
void INT_Excep_PERIB_INTB189(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB189() {
ret void
}
/* Variables and functions */
scalar_t__ scroll_line();
int /*<<< orphan*/ set_scroll(scalar_t__);
void adjust_scroll(int delta) { set_scroll(scroll_line() + delta); }


x86 assembly (clang, -O0):
<adjust_scroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <scroll_line@plt>
mov    %rax,%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
call   1040 <set_scroll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_scroll>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <scroll_line@plt>
movslq %ebx,%rdi
add    %rax,%rdi
pop    %rbx
jmp    1040 <set_scroll@plt>

LLVM IR (-O0):
define void @adjust_scroll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @scroll_line()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = call i32 @set_scroll(i64 %6)
ret void
}

LLVM IR (-O2):
define void @adjust_scroll(i32 %0) {
%2 = tail call i64 (...) @scroll_line()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
%5 = tail call i32 @set_scroll(i64 %4)
ret void
}
int twist_l_on_sliceedge(sliceedge)
int sliceedge;
{
  int temp_arr[12];
  sliceedge_unpack(sliceedge, temp_arr);
  four_cycle(temp_arr, 11, 7, 9, 3);
  return sliceedge_pack(temp_arr);
}


x86 assembly (clang, -O0):
<twist_l_on_sliceedge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1050 <sliceedge_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0xb,%esi
mov    $0x7,%edx
mov    $0x9,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <sliceedge_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twist_l_on_sliceedge>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <sliceedge_unpack@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x7,%edx
mov    $0x9,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sliceedge_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twist_l_on_sliceedge(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 11, i32 7, i32 9, i32 3)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @twist_l_on_sliceedge(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 11, i32 7, i32 9, i32 3)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
void caller_without_value_site2() {}


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

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

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

LLVM IR (-O2):
define void @caller_without_value_site2() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int a = 5;
  int b = 17;
  printf("main: a = %d, b = %d, argc = %d\n", a, b, argc);
  return EXIT_SUCCESS;
}


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)
movl   $0x5,-0x14(%rbp)
movl   $0x11,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%ecx
lea    0xee6(%rip),%rdi
mov    $0x5,%esi
mov    $0x11,%edx
call   1030 <printf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"main: a = %d, b = %d, argc = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 17, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [33 x i8] c"main: a = %d, b = %d, argc = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 5, i32 17, i32 %0)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void ignoreleak(void) {
  char *p = (char *)malloc(10);
  memset(&(p[0]), 0, 10);
}


x86 assembly (clang, -O0):
<ignoreleak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreleak>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rax
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @ignoreleak() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 10)
ret void
}

LLVM IR (-O2):
define void @ignoreleak() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @memset(i8* %2, i32 0, i32 10)
ret void
}
/* Variables and functions */
int Rand(int);
float Choose(float a, float b, float c, float d) {
  int r = Rand(4);
  if (r == 0)
    return a;
  else if (r == 1)
    return b;
  else if (r == 2)
    return c;
  else
    return d;
}


x86 assembly (clang, -O0):
<Choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
mov    $0x4,%edi
call   1030 <Rand@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1152 <Choose+0x42>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118e <Choose+0x7e>
cmpl   $0x1,-0x18(%rbp)
jne    116b <Choose+0x5b>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118e <Choose+0x7e>
cmpl   $0x2,-0x18(%rbp)
jne    1184 <Choose+0x74>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118e <Choose+0x7e>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Choose>:
sub    $0x18,%rsp
movss  %xmm3,0x8(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x14(%rsp)
mov    $0x4,%edi
call   1030 <Rand@plt>
movss  0x14(%rsp),%xmm0
test   %eax,%eax
je     115c <Choose+0x4c>
movss  0x10(%rsp),%xmm0
cmp    $0x2,%eax
je     115c <Choose+0x4c>
movss  0xc(%rsp),%xmm0
cmp    $0x1,%eax
je     115c <Choose+0x4c>
movss  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @Choose(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
%11 = call i32 @Rand(i32 4)
store i32 %11, i32* %10
%12 = load i32, i32* %10
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load float, float* %6
store float %15, float* %5
br label %28
16: ; preds = %4
%17 = load i32, i32* %10
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load float, float* %7
store float %20, float* %5
br label %28
21: ; preds = %16
%22 = load i32, i32* %10
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load float, float* %8
store float %25, float* %5
br label %28
26: ; preds = %21
%27 = load float, float* %9
store float %27, float* %5
br label %28
28: ; preds = %26, %24, %19, %14
%29 = load float, float* %5
ret float %29
}

LLVM IR (-O2):
define float @Choose(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @Rand(i32 4)
switch i32 %5, label %8 [
i32 0, label %9
i32 1, label %6
i32 2, label %7
]
6: ; preds = %4
br label %9
7: ; preds = %4
br label %9
8: ; preds = %4
br label %9
9: ; preds = %4, %8, %7, %6
%10 = phi float [ %1, %6 ], [ %2, %7 ], [ %3, %8 ], [ %0, %4 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ irc_redirect_pattern_free_all();
void irc_redirect_end() { irc_redirect_pattern_free_all(); }


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

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

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

LLVM IR (-O2):
define void @irc_redirect_end() {
%1 = tail call i32 (...) @irc_redirect_pattern_free_all()
ret void
}
void marker4(d) long d;
{}


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

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

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

LLVM IR (-O2):
define void @marker4(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void done() {
  clear();
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %eax,%eax
call   1060 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @done() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @done() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float fmax(float a, float b) { return ((a > b) ? a : b); }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <fmax+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <fmax+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmax(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ add_turff_node(char *, char *, char *, char *);
int find_node_callback(void *dummy, int argc, char **argv, char **col_name) {
  int i;
  if (argc == 0)
    return 1;
  add_turff_node(argv[0], argv[1], argv[2], argv[3]);
  return 0;
}


x86 assembly (clang, -O0):
<find_node_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113d <find_node_callback+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1168 <find_node_callback+0x58>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rcx
call   1030 <add_turff_node@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_node_callback>:
test   %esi,%esi
je     1133 <find_node_callback+0x23>
push   %rax
mov    (%rdx),%rdi
mov    0x8(%rdx),%rsi
mov    0x10(%rdx),%rax
mov    0x18(%rdx),%rcx
mov    %rax,%rdx
call   1030 <add_turff_node@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @find_node_callback(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8*, i8** %2, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %2, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %2, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 @add_turff_node(i8* %7, i8* %9, i8* %11, i8* %13)
br label %15
15: ; preds = %4, %6
%16 = phi i32 [ 0, %6 ], [ 1, %4 ]
ret i32 %16
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void run_kermit(char *slave_tty) {
  execl("/usr/local/bin/kermit", "kermit", "-l", slave_tty, (char *)0);
  fprintf(stderr, "ERROR: exec failed, errno: %d\n", errno);
  exit(1);
}


x86 assembly (clang, -O0):
<run_kermit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xeb9(%rip),%rdi
lea    0xec1(%rip),%rsi
lea    0xec1(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <execl@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    0x2e69(%rip),%rax
mov    (%rax),%edx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<run_kermit>:
push   %rax
mov    %rdi,%rcx
lea    0xec5(%rip),%rdi
lea    0xecd(%rip),%rsi
lea    0xecd(%rip),%rdx
xor    %r8d,%r8d
call   1050 <execl@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/usr/local/bin/kermit\00"
@.str.1 = [7 x i8] c"kermit\00"
@.str.2 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.3 = [31 x i8] c"ERROR: exec failed, errno: %d\0A\00"
@errno = global i32 0
define void @run_kermit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @execl(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* null)
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"/usr/local/bin/kermit\00"
@.str.1 = [7 x i8] c"kermit\00"
@.str.2 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.3 = [31 x i8] c"ERROR: exec failed, errno: %d\0A\00"
@errno = global i32 0
define void @run_kermit(i8* %0) {
%2 = tail call i32 @execl(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* null)
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}