xunge/DecIR huggingface dataset:
double C_Utils_max_double(const double item1, const double item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <C_Utils_max_double+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <C_Utils_max_double+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_double>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @C_Utils_max_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Write(int, char *, int);
int read(int, char *, int);
void send_file(int sockfd, int filefd) {
  char buf[4096];
  int cnt = 0;
  while ((cnt = read(filefd, buf, 4096)) > 0) {
    Write(sockfd, buf, cnt);
  }
}


x86 assembly (clang, -O0):
<send_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x1014(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    %eax,-0x1014(%rbp)
cmp    $0x0,%eax
jle    1178 <send_file+0x58>
mov    -0x4(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    -0x1014(%rbp),%edx
call   1030 <Write@plt>
jmp    113b <send_file+0x1b>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_file>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %esi,%ebx
mov    %edi,%r14d
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0x1000,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <send_file+0x50>
mov    %rsp,%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1030 <Write@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <send_file+0x30>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @send_file(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4096 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %4
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 4096)
store i32 %10, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %3
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @Write(i32 %13, i8* %14, i32 %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @send_file(i32 %0, i32 %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %1, i8* %4, i32 4096)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = call i32 @Write(i32 %0, i8* %4, i32 %8)
%10 = call i32 @read(i32 %1, i8* %4, i32 4096)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}
unsigned long f(unsigned long x, int a) { return ((x * x) + a); }


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

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

LLVM IR (-O0):
define i64 @f(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = mul i64 %5, %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @f(i64 %0, i32 %1) {
%3 = mul i64 %0, %0
%4 = sext i32 %1 to i64
%5 = add i64 %3, %4
ret i64 %5
}
int Func2(x) {
  x = x * 2;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @Func2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ __gid_t;

/* Variables and functions */
struct group *getgrgid(__gid_t gid) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.group = type { i32 }
define %struct.group* @getgrgid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type { i32 }
define noalias %struct.group* @getgrgid(i32 %0) {
ret %struct.group* null
}
/* Variables and functions */
int execvp(char *, char **);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int run_lupkg(char *lupkg_dir, char *argv[]) {
  int status;
  char cmd[25] = {0};
  sprintf(cmd, "%s/app_run", lupkg_dir);
  return execvp(cmd, argv);
}


x86 assembly (clang, -O0):
<run_lupkg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x19,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execvp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_lupkg>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%rdx
xorps  %xmm0,%xmm0
movups %xmm0,0x9(%rsp)
movaps %xmm0,(%rsp)
lea    0xec0(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <execvp@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s/app_run\00"
define i32 @run_lupkg(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [25 x i8]
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = bitcast [25 x i8]* %6 to i8*
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%12 = load i8**, i8*** %4
%13 = call i32 @execvp(i8* %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s/app_run\00"
define i32 @run_lupkg(i8* %0, i8** %1) {
%3 = alloca [25 x i8]
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @execvp(i8* %4, i8** %1)
ret i32 %6
}
char *my_stpcpy(char *dst, const char *src) {
  while (*dst = *src++)
    dst++;
  return dst;
}


x86 assembly (clang, -O0):
<my_stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     113c <my_stpcpy+0x3c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <my_stpcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_stpcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     1122 <my_stpcpy+0x22>
add    $0x1,%rsi
nop
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <my_stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_stpcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %13
}
/* Variables and functions */
char const *dlerror();
const char *dll_error() { return dlerror(); }


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

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

LLVM IR (-O0):
define i8* @dll_error() {
%1 = call i8* (...) @dlerror()
ret i8* %1
}

LLVM IR (-O2):
define i8* @dll_error() {
%1 = tail call i8* (...) @dlerror()
ret i8* %1
}
/* Variables and functions */
void ack();
int /*<<< orphan*/ intr();
void jsr(void) {
  intr();
  return ack();
}


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

x86 assembly (clang, -O2):
<jsr>:
push   %rax
xor    %eax,%eax
call   1030 <intr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ack@plt>

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

LLVM IR (-O2):
define void @jsr() {
%1 = tail call i32 (...) @intr()
tail call void (...) @ack()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fsend(char *);
int /*<<< orphan*/ get();
char *parseHTCBlock();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ ruustart();
scalar_t__ strlen(char *);
void authBL() {
  char *res;
  ruustart();
  fsend("password BsaD5SeoA");
  get();
  res = parseHTCBlock();
  if (strlen(res) != 0)
    printf("[] SPL auth result (T=True, F=False): %s\n", res);
}


x86 assembly (clang, -O0):
<authBL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <ruustart@plt>
lea    0xe8a(%rip),%rdi
call   1060 <fsend@plt>
mov    $0x0,%al
call   1070 <get@plt>
mov    $0x0,%al
call   1050 <parseHTCBlock@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     11b0 <authBL+0x50>
mov    -0x8(%rbp),%rsi
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<authBL>:
push   %rax
xor    %eax,%eax
call   1070 <ruustart@plt>
lea    0xea1(%rip),%rdi
call   1050 <fsend@plt>
xor    %eax,%eax
call   1060 <get@plt>
xor    %eax,%eax
call   1040 <parseHTCBlock@plt>
cmpb   $0x0,(%rax)
je     1187 <authBL+0x37>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"password BsaD5SeoA\00"
@.str.1 = [42 x i8] c"[] SPL auth result (T=True, F=False): %s\0A\00"
define void @authBL() {
%1 = alloca i8*
%2 = call i32 (...) @ruustart()
%3 = call i32 @fsend(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @get()
%5 = call i8* (...) @parseHTCBlock()
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i64 @strlen(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i8*, i8** %1
%11 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"password BsaD5SeoA\00"
@.str.1 = [42 x i8] c"[] SPL auth result (T=True, F=False): %s\0A\00"
define void @authBL() {
%1 = tail call i32 (...) @ruustart()
%2 = tail call i32 @fsend(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @get()
%4 = tail call i8* (...) @parseHTCBlock()
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %9
9: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar() {
  printf("In bar()\n");
  bar();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <bar+0x10>

LLVM IR (-O0):
@.str = [10 x i8] c"In bar()\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"In bar()\00"
define void @bar() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %1
}
int gl_fx_dummy_function_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl_fx_dummy_function_setup() {
ret i32 0
}
void _Jv_IsInstanceOf() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __ptr_ring_discard_one(struct ptr_ring *);
void *__ptr_ring_peek(struct ptr_ring *);
int /*<<< orphan*/ smp_read_barrier_depends();
void *__ptr_ring_consume(struct ptr_ring *r) {
  void *ptr;
  ptr = __ptr_ring_peek(r);
  if (ptr)
    __ptr_ring_discard_one(r);
  smp_read_barrier_depends();
  return ptr;
}


x86 assembly (clang, -O0):
<__ptr_ring_consume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ptr_ring_peek@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <__ptr_ring_consume+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <__ptr_ring_discard_one@plt>
mov    $0x0,%al
call   1050 <smp_read_barrier_depends@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ptr_ring_consume>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <__ptr_ring_peek@plt>
mov    %rax,%r14
test   %rax,%rax
je     114c <__ptr_ring_consume+0x1c>
mov    %rbx,%rdi
call   1040 <__ptr_ring_discard_one@plt>
xor    %eax,%eax
call   1050 <smp_read_barrier_depends@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ptr_ring = type { i32 }
define i8* @__ptr_ring_consume(%struct.ptr_ring* %0) {
%2 = alloca %struct.ptr_ring*
%3 = alloca i8*
store %struct.ptr_ring* %0, %struct.ptr_ring** %2
%4 = load %struct.ptr_ring*, %struct.ptr_ring** %2
%5 = call i8* @__ptr_ring_peek(%struct.ptr_ring* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.ptr_ring*, %struct.ptr_ring** %2
%10 = call i32 @__ptr_ring_discard_one(%struct.ptr_ring* %9)
br label %11
11: ; preds = %8, %1
%12 = call i32 (...) @smp_read_barrier_depends()
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
%struct.ptr_ring = type { i32 }
define i8* @__ptr_ring_consume(%struct.ptr_ring* %0) {
%2 = tail call i8* @__ptr_ring_peek(%struct.ptr_ring* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__ptr_ring_discard_one(%struct.ptr_ring* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (...) @smp_read_barrier_depends()
ret i8* %2
}
int comp2(const int *e1, const int *e2) { return *e1 - *e2; }


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

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

LLVM IR (-O0):
define i32 @comp2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @comp2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ yylex();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  while (yylex() != 0) {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <yylex@plt>
cmp    $0x0,%rax
je     113c <main+0x2c>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yylex@plt>
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 (...) @yylex()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 0
}
unsigned int ror(unsigned int value, int shift) {
  shift &= 31;
  return (value >> shift) | (value << (32 - shift));
}


x86 assembly (clang, -O0):
<ror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ror(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 31
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = lshr i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 32, %11
%13 = shl i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ror(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshr.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __inc_remove_counter();
int __unlink(char const *);
int unlink(const char *path) {
  int res = __unlink(path);
  if (res == 0) {
    __inc_remove_counter();
  }
  return res;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__unlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <unlink+0x29>
mov    $0x0,%al
call   1040 <__inc_remove_counter@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rbx
call   1030 <__unlink@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1133 <unlink+0x13>
xor    %eax,%eax
call   1040 <__inc_remove_counter@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = tail call i32 @__unlink(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @__inc_remove_counter()
br label %6
6: ; preds = %4, %1
ret i32 %2
}
int getCommand() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getCommand() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ interrupt_sys_handler(int /*<<< orphan*/);
void _syscall() { interrupt_sys_handler(0); }


x86 assembly (clang, -O0):
<_syscall>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <interrupt_sys_handler@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_syscall() {
%1 = call i32 @interrupt_sys_handler(i32 0)
ret void
}

LLVM IR (-O2):
define void @_syscall() {
%1 = tail call i32 @interrupt_sys_handler(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, unsigned int);
void program_TIC(long data) {
  unsigned int high, low;
  high = ((int)(data >> 16));
  low = ((int)(data & 0xffff));
  to_gps(0x6d, high);
  to_gps(0x6f, low);
}


x86 assembly (clang, -O0):
<program_TIC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x6d,%edi
call   1030 <to_gps@plt>
mov    -0x10(%rbp),%esi
mov    $0x6f,%edi
call   1030 <to_gps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_TIC>:
push   %rbx
movzwl %di,%ebx
mov    %rdi,%rsi
shr    $0x10,%rsi
mov    $0x6d,%edi
call   1030 <to_gps@plt>
mov    $0x6f,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <to_gps@plt>

LLVM IR (-O0):
define void @program_TIC(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = ashr i64 %5, 16
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i64, i64* %2
%9 = and i64 %8, 65535
%10 = trunc i64 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @to_gps(i32 109, i32 %11)
%13 = load i32, i32* %4
%14 = call i32 @to_gps(i32 111, i32 %13)
ret void
}

LLVM IR (-O2):
define void @program_TIC(i64 %0) {
%2 = lshr i64 %0, 16
%3 = trunc i64 %2 to i32
%4 = trunc i64 %0 to i32
%5 = and i32 %4, 65535
%6 = tail call i32 @to_gps(i32 109, i32 %3)
%7 = tail call i32 @to_gps(i32 111, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strmlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void outplainerr(char *tmp) { write(2, tmp, strmlen(tmp)); }


x86 assembly (clang, -O0):
<outplainerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strmlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outplainerr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strmlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @outplainerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strmlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @outplainerr(i8* %0) {
%2 = tail call i32 @strmlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
bool isStandalone(int c) {
  if (c >= 0xD0 && c <= 0xD9)
    return true;
  else if (c == 0x01)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<isStandalone>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xd0,-0x8(%rbp)
jl     112d <isStandalone+0x2d>
cmpl   $0xd9,-0x8(%rbp)
jg     112d <isStandalone+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    114a <isStandalone+0x4a>
cmpl   $0x1,-0x8(%rbp)
jne    1143 <isStandalone+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <isStandalone+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isStandalone>:
lea    -0xd0(%rdi),%eax
cmp    $0xa,%eax
setb   %al
cmp    $0x1,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isStandalone(i32 %0) {
%2 = add i32 %0, -208
%3 = icmp ult i32 %2, 10
%4 = icmp eq i32 %0, 1
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int zkp_disconnect(int sockfd) {
  close(sockfd);
  return 0;
}


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

x86 assembly (clang, -O2):
<zkp_disconnect>:
push   %rax
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @zkp_disconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
float __ulong2fs(long);
float __slong2fs(signed long sl) {
  if (sl < 0)
    return -__ulong2fs(-sl);
  else
    return __ulong2fs(sl);
}


x86 assembly (clang, -O0):
<__slong2fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    114b <__slong2fs+0x3b>
xor    %eax,%eax
mov    %eax,%edi
sub    -0x10(%rbp),%rdi
call   1030 <__ulong2fs@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1159 <__slong2fs+0x49>
mov    -0x10(%rbp),%rdi
call   1030 <__ulong2fs@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__slong2fs>:
test   %rdi,%rdi
js     111a <__slong2fs+0xa>
jmp    1030 <__ulong2fs@plt>
push   %rax
neg    %rdi
call   1030 <__ulong2fs@plt>
xorps  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__slong2fs(i64 %0) {
%2 = alloca float
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i64, i64* %3
%8 = sub nsw i64 0, %7
%9 = call float @__ulong2fs(i64 %8)
%10 = fneg float %9
store float %10, float* %2
br label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call float @__ulong2fs(i64 %12)
store float %13, float* %2
br label %14
14: ; preds = %11, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @__slong2fs(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sub nsw i64 0, %0
%5 = tail call float @__ulong2fs(i64 %4)
%6 = fneg float %5
br label %9
7: ; preds = %1
%8 = tail call float @__ulong2fs(i64 %0)
br label %9
9: ; preds = %7, %3
%10 = phi float [ %6, %3 ], [ %8, %7 ]
ret float %10
}
long grib_op_not(long a) { return !a; }


x86 assembly (clang, -O0):
<grib_op_not>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_not>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @grib_op_not(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @grib_op_not(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
void *dlsym(void *handle, const char *symbol) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Sigma0(uint64_t x) {
  return (x >> 28 | x << 36) ^ (x >> 34 | x << 30) ^ (x >> 39 | x << 25);
}


x86 assembly (clang, -O0):
<Sigma0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1c,%eax
mov    -0x4(%rbp),%edx
mov    $0x24,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x22,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x1e,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x19,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Sigma0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 28
%5 = load i32, i32* %2
%6 = shl i32 %5, 36
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 34
%10 = load i32, i32* %2
%11 = shl i32 %10, 30
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 39
%16 = load i32, i32* %2
%17 = shl i32 %16, 25
%18 = or i32 %15, %17
%19 = xor i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @Sigma0(i32 %0) {
ret i32 poison
}
unsigned int cpu_stepping(unsigned int eax) { return (eax & 0xf); }


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

x86 assembly (clang, -O2):
<cpu_stepping>:
mov    %edi,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @cpu_stepping(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
/* Variables and functions */
int bwputc(char);
char c2x(char);
int bwputx(char c) {
  char chh, chl;
  chh = c2x(c / 16);
  chl = c2x(c % 16);
  bwputc(chh);
  return bwputc(chl);
}


x86 assembly (clang, -O0):
<bwputx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
movsbl %al,%edi
call   1040 <c2x@plt>
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%edi
call   1040 <c2x@plt>
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <bwputc@plt>
movsbl -0x3(%rbp),%edi
call   1030 <bwputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwputx>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    %ebp,%ebx
sar    $0x7,%bl
shr    $0x4,%bl
add    %bpl,%bl
mov    %ebx,%eax
sar    $0x4,%al
movsbl %al,%edi
call   1040 <c2x@plt>
mov    %eax,%r14d
and    $0xf0,%bl
sub    %bl,%bpl
movsbl %bpl,%edi
call   1040 <c2x@plt>
mov    %eax,%ebx
movsbl %r14b,%edi
call   1030 <bwputc@plt>
movsbl %bl,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <bwputc@plt>

LLVM IR (-O0):
define i32 @bwputx(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sdiv i32 %6, 16
%8 = trunc i32 %7 to i8
%9 = call signext i8 @c2x(i8 signext %8)
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = srem i32 %11, 16
%13 = trunc i32 %12 to i8
%14 = call signext i8 @c2x(i8 signext %13)
store i8 %14, i8* %4
%15 = load i8, i8* %3
%16 = call i32 @bwputc(i8 signext %15)
%17 = load i8, i8* %4
%18 = call i32 @bwputc(i8 signext %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @bwputx(i8 signext %0) {
%2 = sdiv i8 %0, 16
%3 = tail call signext i8 @c2x(i8 signext %2)
%4 = srem i8 %0, 16
%5 = tail call signext i8 @c2x(i8 signext %4)
%6 = tail call i32 @bwputc(i8 signext %3)
%7 = tail call i32 @bwputc(i8 signext %5)
ret i32 %7
}
/* Variables and functions */
scalar_t__ malloc(int);
size_t strlen(char *);
void strlen_malloc_Bad() {
  int a[5];
  char *s = (char *)malloc(sizeof(char) * 6);
  s[0] = 'h';
  s[1] = 'e';
  s[2] = 'l';
  s[3] = 'l';
  s[4] = 'o';
  s[5] = '\0';
  a[strlen(s)] = 0;
}


x86 assembly (clang, -O0):
<strlen_malloc_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x68,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x65,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x6c,0x2(%rax)
mov    -0x28(%rbp),%rax
movb   $0x6c,0x3(%rax)
mov    -0x28(%rbp),%rax
movb   $0x6f,0x4(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x5(%rax)
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
movl   $0x0,-0x20(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_malloc_Bad>:
push   %rax
mov    $0x6,%edi
call   1030 <malloc@plt>
movl   $0x6c6c6568,(%rax)
movw   $0x6f,0x4(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @strlen_malloc_Bad() {
%1 = alloca [5 x i32]
%2 = alloca i8*
%3 = call i64 @malloc(i32 6)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 104, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 101, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 108, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 108, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 4
store i8 111, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 5
store i8 0, i8* %16
%17 = load i8*, i8** %2
%18 = call i64 @strlen(i8* %17)
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %18
store i32 0, i32* %19
ret void
}

LLVM IR (-O2):
define void @strlen_malloc_Bad() {
%1 = tail call i64 @malloc(i32 6)
%2 = inttoptr i64 %1 to i8*
store i8 104, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 101, i8* %3
%4 = getelementptr inbounds i8, i8* %2, i64 2
store i8 108, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 3
store i8 108, i8* %5
%6 = getelementptr inbounds i8, i8* %2, i64 4
store i8 111, i8* %6
%7 = getelementptr inbounds i8, i8* %2, i64 5
store i8 0, i8* %7
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ INT64_MAX;
scalar_t__ unknown_int();
void plus_one_Bad() {
  int64_t x = unknown_int();
  if (x <= INT64_MAX) {
    int64_t y = x + 1;
  }
}


x86 assembly (clang, -O0):
<plus_one_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
jg     1143 <plus_one_Bad+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MAX = global i64 0
define void @plus_one_Bad() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @unknown_int()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = load i64, i64* @INT64_MAX
%6 = icmp sle i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i64, i64* %1
%9 = add nsw i64 %8, 1
store i64 %9, i64* %2
br label %10
10: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@INT64_MAX = global i64 0
define void @plus_one_Bad() {
%1 = tail call i64 (...) @unknown_int()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned short, int /*<<< orphan*/ *);
unsigned short unicode_to_cp866(unsigned short);
void cp866_putc(unsigned short ch, FILE *fout) {
  ch = unicode_to_cp866(ch);
  if (!ch)
    ch = '?';
  putc(ch, fout);
}


x86 assembly (clang, -O0):
<cp866_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <unicode_to_cp866@plt>
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1151 <cp866_putc+0x31>
movw   $0x3f,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp866_putc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <unicode_to_cp866@plt>
test   %ax,%ax
mov    $0x3f,%ecx
cmovne %eax,%ecx
movzwl %cx,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @cp866_putc(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = call zeroext i16 @unicode_to_cp866(i16 zeroext %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
%8 = icmp ne i16 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i16 63, i16* %3
br label %10
10: ; preds = %9, %2
%11 = load i16, i16* %3
%12 = load i32*, i32** %4
%13 = call i32 @putc(i16 zeroext %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @cp866_putc(i16 zeroext %0, i32* nocapture %1) {
%3 = tail call zeroext i16 @unicode_to_cp866(i16 zeroext %0)
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i16 63, i16 %3
%6 = tail call i32 @putc(i16 zeroext %5, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ egcd(int, int, long *, long *, long *);
void egcd_test(void) {
  long g = 0;
  long x = 0;
  long y = 0;
  egcd(240, 46, &g, &x, &y);
  assert(g == 2);
  assert(x == -9);
  assert(y == 47);
}


x86 assembly (clang, -O0):
<egcd_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0xf0,%edi
mov    $0x2e,%esi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1040 <egcd@plt>
cmpq   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0xfffffffffffffff7,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x2f,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<egcd_test>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
mov    $0xf0,%edi
mov    $0x2e,%esi
call   1040 <egcd@plt>
xor    %edi,%edi
cmpq   $0x2,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0xfffffffffffffff7,0x8(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0x2f,(%rsp)
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @egcd_test() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
store i64 0, i64* %3
%4 = call i32 @egcd(i32 240, i32 46, i64* %1, i64* %2, i64* %3)
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, -9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i64, i64* %3
%14 = icmp eq i64 %13, 47
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @egcd_test() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%7 = call i32 @egcd(i32 240, i32 46, i64* %1, i64* %2, i64* %3)
%8 = load i64, i64* %1
%9 = icmp eq i64 %8, 2
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, -9
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i64, i64* %3
%17 = icmp eq i64 %16, 47
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}
/* Variables and functions */
scalar_t__ errno;
void syscall_prepare(void) { errno = 0; }


x86 assembly (clang, -O0):
<syscall_prepare>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_prepare>:
mov    0x2ed9(%rip),%rax
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
@errno = global i64 0
define void @syscall_prepare() {
store i64 0, i64* @errno
ret void
}

LLVM IR (-O2):
@errno = global i64 0
define void @syscall_prepare() {
store i64 0, i64* @errno
ret void
}
void remove_special(char *p) {
  char c;
  char *dst = p;
  for (;;) {
    c = *p;
    p++;
    switch (c) {
    case '\n':
    case '<':
    case '>':
      continue;
    }
    *dst++ = c;
    if (!c)
      break;
  }
}


x86 assembly (clang, -O0):
<remove_special>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xa,%eax
je     115c <remove_special+0x5c>
jmp    113a <remove_special+0x3a>
mov    -0x1c(%rbp),%eax
sub    $0x3c,%eax
je     115c <remove_special+0x5c>
jmp    114b <remove_special+0x4b>
mov    -0x1c(%rbp),%eax
sub    $0x3e,%eax
jne    1161 <remove_special+0x61>
jmp    115c <remove_special+0x5c>
jmp    1110 <remove_special+0x10>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
cmpb   $0x0,-0x9(%rbp)
jne    1184 <remove_special+0x84>
jmp    1189 <remove_special+0x89>
jmp    1110 <remove_special+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_special>:
movabs $0x5000000000000400,%rax
mov    %rdi,%rcx
jmp    1120 <remove_special+0x20>
mov    %dl,(%rcx)
add    $0x1,%rcx
test   %dl,%dl
je     1135 <remove_special+0x35>
nopl   0x0(%rax)
add    $0x1,%rdi
movsbl -0x1(%rdi),%edx
cmp    $0x3e,%edx
ja     110f <remove_special+0xf>
bt     %rdx,%rax
jb     1120 <remove_special+0x20>
jmp    110f <remove_special+0xf>
ret

LLVM IR (-O0):
define void @remove_special(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %21, %13, %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
store i8 %8, i8* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
switch i32 %12, label %14 [
i32 10, label %13
i32 60, label %13
i32 62, label %13
]
13: ; preds = %6, %6, %6
br label %6
14: ; preds = %6
%15 = load i8, i8* %3
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
store i8 %15, i8* %16
%18 = load i8, i8* %3
%19 = icmp ne i8 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %14
br label %22
21: ; preds = %14
br label %6
22: ; preds = %20
ret void
}

LLVM IR (-O2):
define void @remove_special(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %8, %11 ], [ %0, %1 ]
%4 = phi i8* [ %12, %11 ], [ %0, %1 ]
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %3, %2 ], [ %8, %10 ]
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %7 to i32
switch i32 %9, label %11 [
i32 10, label %10
i32 60, label %10
i32 62, label %10
]
10: ; preds = %5, %5, %5
br label %5
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%13 = icmp eq i8 %7, 0
br i1 %13, label %14, label %2
14: ; preds = %11
ret void
}
signed short int signedshortint_ignoring_longlongint(signed short int x,
                                                     long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_longlongint(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_longlongint(i16 returned signext %0, i64 %1) {
ret i16 %0
}
long long test_func_07(long long a) { return __builtin_bswap64(a) >> 32; }


x86 assembly (clang, -O0):
<test_func_07>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bswap  %rax
shr    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_07>:
mov    %rdi,%rax
bswap  %rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i64 @test_func_07(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
%5 = lshr i64 %4, 32
ret i64 %5
}

LLVM IR (-O2):
define i64 @test_func_07(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
%3 = lshr i64 %2, 32
ret i64 %3
}