xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ enprintf(int, char *, char const *, char const *);
long long strtonum(char const *, long long, long long, char const **);
long long enstrtonum(int status, const char *numstr, long long minval,
                     long long maxval) {
  const char *errstr;
  long long ll;
  ll = strtonum(numstr, minval, maxval, &errstr);
  if (errstr)
    enprintf(status, "strtonum %s: %s\n", numstr, errstr);
  return ll;
}


x86 assembly (clang, -O0):
<enstrtonum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <strtonum@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1172 <enstrtonum+0x52>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe93(%rip),%rsi
call   1040 <enprintf@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enstrtonum>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0x8(%rsp),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
call   1030 <strtonum@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rcx
test   %rcx,%rcx
je     1163 <enstrtonum+0x43>
lea    0xea8(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
call   1040 <enprintf@plt>
mov    %rbp,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"strtonum %s: %s\0A\00"
define i64 @enstrtonum(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i64 @strtonum(i8* %1, i64 %2, i64 %3, i8** %5)
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = call i32 @enprintf(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %8)
br label %12
12: ; preds = %10, %4
ret i64 %7
}
char const *pubnub_uname(void) {
  return "ContikiOS"
         "%2F"
         "2.7";
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"ContikiOS%2F2.7\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"ContikiOS%2F2.7\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ indirect();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcIndirect8(void) { sbc8(readmem65816(indirect())); }


x86 assembly (clang, -O0):
<sbcIndirect8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirect@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirect8>:
push   %rax
xor    %eax,%eax
call   1040 <indirect@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sbc8@plt>

LLVM IR (-O0):
define void @sbcIndirect8() {
%1 = call i32 (...) @indirect()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirect8() {
%1 = tail call i32 (...) @indirect()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nothing();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Even if you do hack this elf, what are you going to do?. You should "
         "really get back to research.\n");
  nothing();
}


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

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

LLVM IR (-O0):
@.str = [98 x i8] c"Even if you do hack this elf, what are you going to do?. You should really get back to research.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @nothing()
ret i32 0
}

LLVM IR (-O2):
@str = [97 x i8] c"Even if you do hack this elf, what are you going to do?. You should really get back to research.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @nothing()
ret i32 0
}
int Operand_immt_decode(unsigned int *valp) {
  unsigned immt_0, t_0;
  t_0 = *valp & 0xf;
  immt_0 = t_0;
  *valp = immt_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_immt_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_immt_decode>:
andl   $0xf,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_immt_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_immt_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 15
store i32 %3, i32* %0
ret i32 0
}
int _gth(int x, int y, void *garb) { return x > y; }


x86 assembly (clang, -O0):
<_gth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gth>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @_gth(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_gth(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp sgt i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("usage:\n\n");
  printf("\t%s path\n", name);
  printf("\t%s -p path\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"usage:\0A\0A\00"
@.str.1 = [10 x i8] c"\09%s path\0A\00"
@.str.2 = [13 x i8] c"\09%s -p path\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"\09%s path\0A\00"
@.str.2 = [13 x i8] c"\09%s -p path\0A\00"
@str = [8 x i8] c"usage:\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ cset82(unsigned char const *, int const, int /*<<< orphan*/, int,
                  int, int *, int *, char *);
int x1__2(const unsigned char *data, const int data_len, int *p_err_no,
          int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 2 &&
         cset82(data, data_len, 0, 1, 2, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<x1__2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <x1__2+0x71>
xor    %eax,%eax
cmpl   $0x2,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <x1__2+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <cset82@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1__2>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
ja     114d <x1__2+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
push   %r11
push   %r10
call   1030 <cset82@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @x1__2(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp sle i32 %14, 2
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i32*, i32** %8
%20 = load i32*, i32** %9
%21 = load i8*, i8** %10
%22 = call i64 @cset82(i8* %17, i32 %18, i32 0, i32 1, i32 2, i32* %19, i32* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %16, %13, %5
%25 = phi i1 [ false, %13 ], [ false, %5 ], [ %23, %16 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @x1__2(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @cset82(i8* %0, i32 %1, i32 0, i32 1, i32 2, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int socket_accept(int sock) {
  int client;
  if ((client = accept(sock, NULL, NULL)) < 0) {
    perror("socket_accept() -> accept()");
    return -1;
  }
  return client;
}


x86 assembly (clang, -O0):
<socket_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <accept@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    115e <socket_accept+0x3e>
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <socket_accept+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_accept>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1040 <accept@plt>
test   %eax,%eax
js     1130 <socket_accept+0x10>
pop    %rcx
ret
lea    0xec9(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"socket_accept() -> accept()\00"
define i32 @socket_accept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @accept(i32 %5, i32* null, i32* null)
store i32 %6, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [28 x i8] c"socket_accept() -> accept()\00"
define i32 @socket_accept(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *thread(void *threadid) {
  int tid;
  tid = (int)threadid;
  printf("Hello World! It's me, thread #%d!\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Hello World! It's me, thread #%d!\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [35 x i8] c"Hello World! It's me, thread #%d!\0A\00"
define noalias i8* @thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_CC_FIFO_PIN() { set_io_bit(-4, 2); }


x86 assembly (clang, -O0):
<TOSH_SET_CC_FIFO_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
mov    $0x2,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TOSH_SET_CC_FIFO_PIN() {
%1 = call i32 @set_io_bit(i32 -4, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_CC_FIFO_PIN() {
%1 = tail call i32 @set_io_bit(i32 -4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printCollatzSequence(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int term;
  printf("Digite o primeiro termo da série de Collatz:");
  scanf("%d", &term);
  printCollatzSequence(term);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <printCollatzSequence@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Digite o primeiro termo da s\C3\A9rie de Collatz:\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 @printf(i8* getelementptr inbounds ([46 x i8], [46 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* %2)
%5 = load i32, i32* %2
%6 = call i32 @printCollatzSequence(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Digite o primeiro termo da s\C3\A9rie de Collatz:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 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
%6 = call i32 @printCollatzSequence(i32 %5)
ret i32 0
}
void rop3_82_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & *D;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_82_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_82_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_82_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
int getNextSession() {
  static int session = 0;
  session++;
  return session;
}


x86 assembly (clang, -O0):
<getNextSession>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
mov    0x2f0b(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextSession>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@getNextSession.session = internal global i32 0
define i32 @getNextSession() {
%1 = load i32, i32* @getNextSession.session
%2 = add nsw i32 %1, 1
store i32 %2, i32* @getNextSession.session
%3 = load i32, i32* @getNextSession.session
ret i32 %3
}

LLVM IR (-O2):
@getNextSession.session = internal unnamed_addr global i32 0
define i32 @getNextSession() {
%1 = load i32, i32* @getNextSession.session
%2 = add nsw i32 %1, 1
store i32 %2, i32* @getNextSession.session
ret i32 %2
}
int _pool_addr_compar(const void *x, const void *y) {
  char **xp = (char **)x, **yp = (char **)y;
  return (*xp < *yp) ? -1 : (*xp > *yp) ? +1 : 0;
}


x86 assembly (clang, -O0):
<_pool_addr_compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
jae    113d <_pool_addr_compar+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    115b <_pool_addr_compar+0x5b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pool_addr_compar>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_pool_addr_compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ult i8* %5, %6
%8 = icmp ugt i8* %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void std_logger(const char *format, va_list ap) { vprintf(format, ap); }


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

x86 assembly (clang, -O2):
<std_logger>:
jmp    1030 <vprintf@plt>

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

LLVM IR (-O2):
define void @std_logger(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret void
}
void ble_rsp_system_aes_setkey(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_system_aes_setkey(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int /*<<< orphan*/ stress_check_capability(int);
int stress_rawpkt_supported(const char *name) {
  if (!stress_check_capability((-1))) {
    pr_inf_skip("%s stressor will be skipped, "
                "need to be running with CAP_NET_RAW "
                "rights for this stressor\n",
                name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stress_rawpkt_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
cmp    $0x0,%eax
jne    115b <stress_rawpkt_supported+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <pr_inf_skip@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <stress_rawpkt_supported+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_rawpkt_supported>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1138 <stress_rawpkt_supported+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <pr_inf_skip@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"%s stressor will be skipped, need to be running with CAP_NET_RAW rights for this stressor\0A\00"
define i32 @stress_rawpkt_supported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @stress_check_capability(i32 -1)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [91 x i8] c"%s stressor will be skipped, need to be running with CAP_NET_RAW rights for this stressor\0A\00"
define i32 @stress_rawpkt_supported(i8* %0) {
%2 = tail call i32 @stress_check_capability(i32 -1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
int to_pow2(int value) {
  int i = 1;
  while (i < value)
    i <<= 1;
  return i;
}


x86 assembly (clang, -O0):
<to_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <to_pow2+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <to_pow2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_pow2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <to_pow2+0x10>
ret

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

LLVM IR (-O2):
define i32 @to_pow2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp slt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glColor3uiv(unsigned int *);
void Color3uiv(unsigned int v[3]) { glColor3uiv(v); }


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

x86 assembly (clang, -O2):
<Color3uiv>:
jmp    1030 <glColor3uiv@plt>

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

LLVM IR (-O2):
define void @Color3uiv(i32* %0) {
%2 = tail call i32 @glColor3uiv(i32* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(time_t t2, time_t t1) {
  if (t1 <= t2)
    return (double)(t2 - t1);
  else
    return -(double)(t1 - t2);
}


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1131 <difftime+0x31>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115a <difftime+0x5a>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
mov    %rsi,%rax
sub    %rdi,%rax
jle    1116 <difftime+0x16>
cvtsi2sd %rax,%xmm0
xorpd  0xeeb(%rip),%xmm0
ret
sub    %rsi,%rdi
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i64 %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* %4
%8 = icmp sle i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = sub nsw i64 %10, %11
%13 = sitofp i64 %12 to double
store double %13, double* %3
br label %20
14: ; preds = %2
%15 = load i64, i64* %5
%16 = load i64, i64* %4
%17 = sub nsw i64 %15, %16
%18 = sitofp i64 %17 to double
%19 = fneg double %18
store double %19, double* %3
br label %20
20: ; preds = %14, %9
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, %0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub nsw i64 %0, %1
%6 = sitofp i64 %5 to double
br label %11
7: ; preds = %2
%8 = sub nsw i64 %1, %0
%9 = sitofp i64 %8 to double
%10 = fneg double %9
br label %11
11: ; preds = %7, %4
%12 = phi double [ %6, %4 ], [ %10, %7 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ op_tlt();
void vm_op_tlt(void) {
  op_tlt();
  return;
}


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

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

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

LLVM IR (-O2):
define void @vm_op_tlt() {
%1 = tail call i32 (...) @op_tlt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int readlink(char *, char *, int);
int /*<<< orphan*/ stderr;
int xreadlink(char *path, char *buff, int bufsiz) {
  int count;
  if ((count = readlink(path, buff, bufsiz)) == -1)
    fprintf(stderr, "Error in function readlink.\n");
  buff[count] = '\0';
  return (count);
}


x86 assembly (clang, -O0):
<xreadlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <readlink@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1164 <xreadlink+0x44>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xreadlink>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <readlink@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1147 <xreadlink+0x27>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Error in function readlink.\0A\00"
define i32 @xreadlink(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @readlink(i8* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %3
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Error in function readlink.\0A\00"
define i32 @xreadlink(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @readlink(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %3
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8, i8* %1, i64 %10
store i8 0, i8* %11
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fileSize(int /*<<< orphan*/);
int /*<<< orphan*/ popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basLof() { pushNumber(fileSize(popNumber())); }


x86 assembly (clang, -O0):
<basLof>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <fileSize@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basLof>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <fileSize@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basLof() {
%1 = call i32 (...) @popNumber()
%2 = call i32 @fileSize(i32 %1)
%3 = call i32 @pushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @basLof() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @fileSize(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pthread_exit(void *);
void thrd_exit(int res) {
  void *pres = malloc(sizeof(int));
  if (pres != (void *)0)
    *(int *)pres = res;
  pthread_exit(pres);
}


x86 assembly (clang, -O0):
<thrd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <thrd_exit+0x2d>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrd_exit>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1134 <thrd_exit+0x14>
mov    %ebx,(%rax)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @thrd_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
%13 = call i32 @pthread_exit(i8* %12)
ret void
}

LLVM IR (-O2):
define void @thrd_exit(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast i8* %2 to i32*
store i32 %0, i32* %5
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @pthread_exit(i8* %2)
ret void
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fib(15));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
size_t base64_size_blob(size_t s_sz) { return s_sz * 3 / 4; }


x86 assembly (clang, -O0):
<base64_size_blob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_size_blob>:
lea    (%rdi,%rdi,2),%rax
shr    $0x2,%rax
ret

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

LLVM IR (-O2):
define i64 @base64_size_blob(i64 %0) {
%2 = mul i64 %0, 3
%3 = lshr i64 %2, 2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ character();
char get_char();
int /*<<< orphan*/ printf(char *);
more() {
  printf("* More =>");
  if (get_char() == 'p') {
    character();
    printf("* More =>");
    (void)get_char();
  };
}


x86 assembly (clang, -O0):
<more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <get_char@plt>
movsbl %al,%eax
cmp    $0x70,%eax
jne    1171 <more+0x41>
mov    $0x0,%al
call   1040 <character@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <get_char@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<more>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <get_char@plt>
cmp    $0x70,%al
jne    1162 <more+0x32>
xor    %eax,%eax
call   1040 <character@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <get_char@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"* More =>\00"
define i32 @more() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @get_char()
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 112
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 (...) @character()
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = call signext i8 (...) @get_char()
br label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"* More =>\00"
define i32 @more() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @get_char()
%3 = icmp eq i8 %2, 112
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i32 (...) @character()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call signext i8 (...) @get_char()
br label %8
8: ; preds = %4, %0
ret i32 undef
}
void UpdateAddName(struct SyncUpdateData *ud, struct ndn_charbuf *name) {}


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

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

LLVM IR (-O0):
%struct.SyncUpdateData = type opaque
%struct.ndn_charbuf = type opaque
define void @UpdateAddName(%struct.SyncUpdateData* %0, %struct.ndn_charbuf* %1) {
%3 = alloca %struct.SyncUpdateData*
%4 = alloca %struct.ndn_charbuf*
store %struct.SyncUpdateData* %0, %struct.SyncUpdateData** %3
store %struct.ndn_charbuf* %1, %struct.ndn_charbuf** %4
ret void
}

LLVM IR (-O2):
%struct.SyncUpdateData = type opaque
%struct.ndn_charbuf = type opaque
define void @UpdateAddName(%struct.SyncUpdateData* nocapture %0, %struct.ndn_charbuf* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0, b = 0, c = 0, d = 0;
  goto foo;
  assert(0);
  while (a != 1) {
  bar:
    b = 1;
  }
  c = 1;
  goto baz;
  assert(0);
foo:
  a = 1;
  goto bar;
  assert(0);
  switch (3) {
  case 3:
  baz:
    d = 1;
    break;
  }
  assert(a == 1);
  assert(b == 1);
  assert(c == 1);
  assert(d == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1167 <main+0x57>
cmpl   $0x1,-0x8(%rbp)
je     115b <main+0x4b>
jmp    114f <main+0x3f>
movl   $0x1,-0xc(%rbp)
jmp    1140 <main+0x30>
movl   $0x1,-0x10(%rbp)
jmp    1173 <main+0x63>
movl   $0x1,-0x8(%rbp)
jmp    114f <main+0x3f>
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
extern int fn14(int i) {
  static const char g[10] = "abcdefghij";
  return g[i];
}


x86 assembly (clang, -O0):
<fn14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn14>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@fn14.g = internal constant [10 x i8] c"abcdefghij"
define i32 @fn14(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [10 x i8], [10 x i8]* @fn14.g, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@fn14.g = internal unnamed_addr constant [10 x i8] c"abcdefghij"
define i32 @fn14(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [10 x i8], [10 x i8]* @fn14.g, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Type definitions */
struct dlist {
  int dummy;
};

/* Variables and functions */
long _lst_check_loop(struct dlist *);
long lst_check(struct dlist *lst) { return _lst_check_loop(lst); }


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

x86 assembly (clang, -O2):
<lst_check>:
jmp    1030 <_lst_check_loop@plt>

LLVM IR (-O0):
%struct.dlist = type { i32 }
define i64 @lst_check(%struct.dlist* %0) {
%2 = alloca %struct.dlist*
store %struct.dlist* %0, %struct.dlist** %2
%3 = load %struct.dlist*, %struct.dlist** %2
%4 = call i64 @_lst_check_loop(%struct.dlist* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.dlist = type { i32 }
define i64 @lst_check(%struct.dlist* %0) {
%2 = tail call i64 @_lst_check_loop(%struct.dlist* %0)
ret i64 %2
}
/* Variables and functions */
double gsw_pt_from_t(double, double, double, double);
double gsw_rho_t_exact(double, double, double);
double gsw_pot_rho_t_exact(double sa, double t, double p, double p_ref) {
  double pt = gsw_pt_from_t(sa, t, p, p_ref);
  return (gsw_rho_t_exact(sa, pt, p_ref));
}


x86 assembly (clang, -O0):
<gsw_pot_rho_t_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <gsw_pt_from_t@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <gsw_rho_t_exact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_pot_rho_t_exact>:
sub    $0x18,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <gsw_pt_from_t@plt>
movaps %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
add    $0x18,%rsp
jmp    1040 <gsw_rho_t_exact@plt>

LLVM IR (-O0):
define double @gsw_pot_rho_t_exact(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = call double @gsw_pt_from_t(double %10, double %11, double %12, double %13)
store double %14, double* %9
%15 = load double, double* %5
%16 = load double, double* %9
%17 = load double, double* %8
%18 = call double @gsw_rho_t_exact(double %15, double %16, double %17)
ret double %18
}

LLVM IR (-O2):
define double @gsw_pot_rho_t_exact(double %0, double %1, double %2, double %3) {
%5 = tail call double @gsw_pt_from_t(double %0, double %1, double %2, double %3)
%6 = tail call double @gsw_rho_t_exact(double %0, double %5, double %3)
ret double %6
}