xunge/DecIR huggingface dataset:
const char *lsdn_nullable(const char *nullable) {
  return nullable ? nullable : "*";
}


x86 assembly (clang, -O0):
<lsdn_nullable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <lsdn_nullable+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <lsdn_nullable+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <lsdn_nullable+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsdn_nullable>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define i8* @lsdn_nullable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
define i8* @lsdn_nullable(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned short *, char *, int);
unsigned short ntohs(unsigned short);
unsigned short unpack_short(char **cur) {
  unsigned short v;
  memcpy(&v, *cur, sizeof(unsigned short));
  (*cur) += sizeof(unsigned short);
  return ntohs(v);
}


x86 assembly (clang, -O0):
<unpack_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xa(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movzwl -0xa(%rbp),%edi
call   1040 <ntohs@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_short>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xe(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
addq   $0x2,(%rbx)
movzwl 0xe(%rsp),%edi
call   1040 <ntohs@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @unpack_short(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 @memcpy(i16* %3, i8* %5, i32 2)
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8* %9, i8** %7
%10 = load i16, i16* %3
%11 = call zeroext i16 @ntohs(i16 zeroext %10)
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @unpack_short(i8** nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = load i8*, i8** %0
%5 = call i32 @memcpy(i16* %2, i8* %4, i32 2)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 2
store i8* %7, i8** %0
%8 = load i16, i16* %2
%9 = call zeroext i16 @ntohs(i16 zeroext %8)
ret i16 %9
}
/* Variables and functions */
int fib(int);
int fib_wrapper(int n) {
  int x = 0;
#pragma omp target if (n > THRESHOLD) map(from : x)
  x = fib(n);
  return x;
}


x86 assembly (clang, -O0):
<fib_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fib@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_wrapper>:
jmp    1030 <fib@plt>

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

LLVM IR (-O2):
define i32 @fib_wrapper(i32 %0) {
%2 = tail call i32 @fib(i32 %0)
ret i32 %2
}
void apcie_free_irqs(unsigned int virq, unsigned int nvec) {}


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

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

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

LLVM IR (-O2):
define void @apcie_free_irqs(i32 %0, i32 %1) {
ret void
}
int pram_acl_chmod(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @pram_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lmrwak_(double *, double *, int *);
void clmrwak(double *para, double *xmom, int nmom) {
  lmrwak_(para, xmom, &nmom);
}


x86 assembly (clang, -O0):
<clmrwak>:
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
lea    -0x14(%rbp),%rdx
call   1030 <lmrwak_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clmrwak>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <lmrwak_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clmrwak(double* %0, double* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @lmrwak_(double* %0, double* %1, i32* %4)
ret void
}
void openlog(const char *path, int opt, int fac) {}


x86 assembly (clang, -O0):
<openlog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @openlog(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @openlog(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
int bigEndianBuff2Int(char *buff) {
  int val;
  char *strval = (char *)&val;
  strval[0] = buff[3];
  strval[1] = buff[2];
  strval[2] = buff[1];
  strval[3] = buff[0];
  return val;
}


x86 assembly (clang, -O0):
<bigEndianBuff2Int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bigEndianBuff2Int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %7 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %5 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %3 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ gluOrtho2D(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void setup() {
  glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
  gluOrtho2D(0, 599, 0, 599);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
movss  0xed4(%rip),%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
xor    %edx,%edx
mov    $0x257,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1040 <gluOrtho2D@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
movss  0xed7(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
movaps %xmm0,%xmm3
call   1030 <glClearColor@plt>
xor    %edi,%edi
mov    $0x257,%esi
xor    %edx,%edx
mov    $0x257,%ecx
pop    %rax
jmp    1040 <gluOrtho2D@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @glClearColor(float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00)
%2 = call i32 @gluOrtho2D(i32 0, i32 599, i32 0, i32 599)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @glClearColor(float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00)
%2 = tail call i32 @gluOrtho2D(i32 0, i32 599, i32 0, i32 599)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t increment(uint32_t code) {
  switch (code) {
  case 1:
    return -1;
  case 2:
    return 0;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     112c <increment+0x2c>
jmp    111b <increment+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1138 <increment+0x38>
jmp    1144 <increment+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <increment+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    114b <increment+0x4b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
xor    %ecx,%ecx
cmp    $0x2,%edi
setne  %cl
cmp    $0x1,%edi
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @increment(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i32 -1, i32* %2
br label %8
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = icmp ne i32 %0, 2
%3 = zext i1 %2 to i32
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
void x87FPU_fclex(void) { asm("fclex"); }


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

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

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

LLVM IR (-O2):
define void @x87FPU_fclex() {
tail call void asm sideeffect "fclex", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void bar() {
  float f;
  double d;
  long double ld;
  f = __builtin_huge_valf();
  d = __builtin_huge_val();
  ld = __builtin_huge_vall();
  f = __builtin_nanf("");
  d = __builtin_nan("");
  ld = __builtin_nanl("");
  f = __builtin_nanf("0xAE98");
  d = __builtin_nan("0xAE98");
  ld = __builtin_nanl("0xAE98");
  f = __builtin_nansf("");
  d = __builtin_nans("");
  ld = __builtin_nansl("");
  f = __builtin_nansf("0xAE98");
  d = __builtin_nans("0xAE98");
  ld = __builtin_nansl("0xAE98");
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7f800000,-0x4(%rbp)
movabs $0x7ff0000000000000,%rax
mov    %rax,-0x10(%rbp)
flds   0xee1(%rip)
fstpt  -0x20(%rbp)
movl   $0x7fc00000,-0x4(%rbp)
movabs $0x7ff8000000000000,%rax
mov    %rax,-0x10(%rbp)
flds   0xec7(%rip)
fstpt  -0x20(%rbp)
movl   $0x7fc0ae98,-0x4(%rbp)
movabs $0x7ff800000000ae98,%rax
mov    %rax,-0x10(%rbp)
fldt   0xeb5(%rip)
fstpt  -0x20(%rbp)
movl   $0x7fa00000,-0x4(%rbp)
movabs $0x7ff4000000000000,%rax
mov    %rax,-0x10(%rbp)
fldt   0xea7(%rip)
fstpt  -0x20(%rbp)
movl   $0x7f80ae98,-0x4(%rbp)
movabs $0x7ff000000000ae98,%rax
mov    %rax,-0x10(%rbp)
fldt   0xe99(%rip)
fstpt  -0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
store float 0x7FF0000000000000, float* %1
store double 0x7FF0000000000000, double* %2
store x86_fp80 0xK7FFF8000000000000000, x86_fp80* %3
store float 0x7FF8000000000000, float* %1
store double 0x7FF8000000000000, double* %2
store x86_fp80 0xK7FFFC000000000000000, x86_fp80* %3
store float 0x7FF815D300000000, float* %1
store double 0x7FF800000000AE98, double* %2
store x86_fp80 0xK7FFFC00000000000AE98, x86_fp80* %3
store float 0x7FF4000000000000, float* %1
store double 0x7FF4000000000000, double* %2
store x86_fp80 0xK7FFFA000000000000000, x86_fp80* %3
store float 0x7FF015D300000000, float* %1
store double 0x7FF000000000AE98, double* %2
store x86_fp80 0xK7FFF800000000000AE98, x86_fp80* %3
ret void
}

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

/* Variables and functions */
struct qt_atom *find_leaf(struct qt_atom *self, const char *path[]) {
  if (path[0]) {
    return NULL;
  } else {
    return self;
  }
}


x86 assembly (clang, -O0):
<find_leaf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1127 <find_leaf+0x27>
movq   $0x0,-0x8(%rbp)
jmp    112f <find_leaf+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_leaf>:
xor    %eax,%eax
cmpq   $0x0,(%rsi)
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.qt_atom = type { i32 }
define %struct.qt_atom* @find_leaf(%struct.qt_atom* readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
%5 = select i1 %4, %struct.qt_atom* %0, %struct.qt_atom* null
ret %struct.qt_atom* %5
}
/* Type definitions */
struct lemon {
  int dummy;
};

/* Variables and functions */
int lobject_is_equal(struct lemon *, void *, void *);
int table_cmp(struct lemon *lemon, void *a, void *b) {
  return lobject_is_equal(lemon, a, b);
}


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

x86 assembly (clang, -O2):
<table_cmp>:
jmp    1030 <lobject_is_equal@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
define i32 @table_cmp(%struct.lemon* %0, i8* %1, i8* %2) {
%4 = alloca %struct.lemon*
%5 = alloca i8*
%6 = alloca i8*
store %struct.lemon* %0, %struct.lemon** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.lemon*, %struct.lemon** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @lobject_is_equal(%struct.lemon* %7, i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
define i32 @table_cmp(%struct.lemon* %0, i8* %1, i8* %2) {
%4 = tail call i32 @lobject_is_equal(%struct.lemon* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ hecmw_read_bin_value(unsigned char *, int, int /*<<< orphan*/ *);
int hecmw_read_bin_int(int *x, FILE *fp) {
  long xx;
  if (hecmw_read_bin_value((unsigned char *)&xx, sizeof(long), fp) != 0) {
    return -1;
  }
  *x = xx;
  return 0;
}


x86 assembly (clang, -O0):
<hecmw_read_bin_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1030 <hecmw_read_bin_value@plt>
cmp    $0x0,%rax
je     1148 <hecmw_read_bin_int+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <hecmw_read_bin_int+0x4b>
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hecmw_read_bin_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1030 <hecmw_read_bin_value@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    113f <hecmw_read_bin_int+0x2f>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hecmw_read_bin_int(i32* nocapture writeonly %0, i32* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @hecmw_read_bin_value(i8* %4, i32 8, i32* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %0
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef uintptr_t uint8_t;

/* Variables and functions */
void fill_target_address(uint8_t *buffer, const void *addr) {
  uintptr_t p = (uintptr_t)addr;
  for (int i = 0; i < 2; ++i) {
    buffer[2 - 1 - i] = p & 0xFF;
    p >>= 8;
  }
}


x86 assembly (clang, -O0):
<fill_target_address>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    115d <fill_target_address+0x5d>
mov    -0x18(%rbp),%rdx
and    $0xff,%rdx
mov    -0x8(%rbp),%rax
mov    $0x1,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <fill_target_address+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_target_address>:
mov    %rsi,%rax
movzbl %al,%ecx
mov    %rcx,0x8(%rdi)
movzbl %ah,%eax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @fill_target_address(i64* nocapture writeonly %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = and i64 %3, 255
%5 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %4, i64* %5
%6 = lshr i64 %3, 8
%7 = and i64 %6, 255
store i64 %7, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void kreski(int size) {
  int i;
  printf("\t ");
  for (i = 0; i < (2 * size - 1); i++) {
    printf("_");
  };
  printf("\n");
}


x86 assembly (clang, -O0):
<kreski>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    115c <kreski+0x4c>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <kreski+0x1e>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kreski>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
test   %ebx,%ebx
jle    115f <kreski+0x3f>
lea    (%rbx,%rbx,1),%eax
add    $0xffffffff,%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x5f,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <kreski+0x30>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\09 \00"
@.str.1 = [2 x i8] c"_\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @kreski(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = mul nsw i32 2, %7
%9 = sub nsw i32 %8, 1
%10 = icmp slt i32 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\09 \00"
define void @kreski(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = shl nuw nsw i32 %0, 1
%6 = add i32 %5, -1
%7 = call i32 @llvm.smax.i32(i32 %6, i32 1)
br label %8
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ 0, %4 ]
%10 = tail call i32 @putchar(i32 95)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %7
br i1 %12, label %13, label %8
13: ; preds = %8, %1
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_seccomp;
scalar_t__ errno;
int syscall(int /*<<< orphan*/, unsigned int, unsigned int, void *);
int seccomp(unsigned int op, unsigned int flags, void *args) {
  errno = 0;
  return syscall(__NR_seccomp, op, flags, args);
}


x86 assembly (clang, -O0):
<seccomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
movq   $0x0,(%rax)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seccomp>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
movq   $0x0,(%rax)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@errno = global i64 0
@__NR_seccomp = global i32 0
define i32 @seccomp(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
store i64 0, i64* @errno
%7 = load i32, i32* @__NR_seccomp
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@errno = global i64 0
@__NR_seccomp = global i32 0
define i32 @seccomp(i32 %0, i32 %1, i8* %2) {
store i64 0, i64* @errno
%4 = load i32, i32* @__NR_seccomp
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i8* %2)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_rt_coproc(uint32_t op) {
  return !((op & 0x0F000010) ^ 0x0E000010);
}


x86 assembly (clang, -O0):
<is_rt_coproc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf000010,%eax
xor    $0xe000010,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rt_coproc>:
and    $0xf000010,%edi
xor    %eax,%eax
cmp    $0xe000010,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_rt_coproc(i32 %0) {
%2 = and i32 %0, 251658256
%3 = icmp eq i32 %2, 234881040
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
scalar_t__ _setjmp(int /*<<< orphan*/);
int main() {
  jmp_buf entry;
  if (_setjmp(entry) != 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_setjmp@plt>
cmp    $0x0,%rax
je     113d <main+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <main+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @_setjmp(i32 undef)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *calloc(scalar_t__, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *r = calloc(strlen(s) + 1, sizeof(char));
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @calloc(i64 %6, i32 1)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ challenge_PI_any_one();
int /*<<< orphan*/ challenge_PI_run();
int main() {
  adainit();
  challenge_PI_run();
  challenge_PI_run();
  challenge_PI_any_one();
  challenge_PI_run();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <adainit@plt>
mov    $0x0,%al
call   1030 <challenge_PI_run@plt>
mov    $0x0,%al
call   1030 <challenge_PI_run@plt>
mov    $0x0,%al
call   1040 <challenge_PI_any_one@plt>
mov    $0x0,%al
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <adainit@plt>
xor    %eax,%eax
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
call   1040 <challenge_PI_any_one@plt>
xor    %eax,%eax
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @adainit()
%3 = call i32 (...) @challenge_PI_run()
%4 = call i32 (...) @challenge_PI_run()
%5 = call i32 (...) @challenge_PI_any_one()
%6 = call i32 (...) @challenge_PI_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
%2 = tail call i32 (...) @challenge_PI_run()
%3 = tail call i32 (...) @challenge_PI_run()
%4 = tail call i32 (...) @challenge_PI_any_one()
%5 = tail call i32 (...) @challenge_PI_run()
ret i32 0
}
int get_tx_data() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_tx_data() {
ret i32 0
}
int strrindex(char s[], char t) {
  int i;
  int count = -1;
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == t) {
      count = i;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<strrindex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1162 <strrindex+0x62>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114f <strrindex+0x4f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <strrindex+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <strrindex+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrindex>:
mov    (%rdi),%cl
mov    $0xffffffff,%eax
test   %cl,%cl
je     1123 <strrindex+0x23>
xor    %edx,%edx
nopl   (%rax)
cmp    %sil,%cl
cmove  %edx,%eax
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strrindex+0x10>
ret

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

LLVM IR (-O2):
define i32 @strrindex(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ -1, %2 ]
%9 = icmp eq i8 %7, %1
%10 = trunc i64 %6 to i32
%11 = select i1 %9, i32 %10, i32 %8
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ -1, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int __min_cost(int **, int);
int travelling_salesperson(int (*a)[100], int n) { return __min_cost(a, n); }


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

x86 assembly (clang, -O2):
<travelling_salesperson>:
jmp    1030 <__min_cost@plt>

LLVM IR (-O0):
define i32 @travelling_salesperson([100 x i32]* %0, i32 %1) {
%3 = alloca [100 x i32]*
%4 = alloca i32
store [100 x i32]* %0, [100 x i32]** %3
store i32 %1, i32* %4
%5 = load [100 x i32]*, [100 x i32]** %3
%6 = bitcast [100 x i32]* %5 to i32**
%7 = load i32, i32* %4
%8 = call i32 @__min_cost(i32** %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @travelling_salesperson([100 x i32]* %0, i32 %1) {
%3 = bitcast [100 x i32]* %0 to i32**
%4 = tail call i32 @__min_cost(i32** %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strxfrm(char *, char *, size_t);
void uninivar_strxfrm(void) {
  char *ds;
  char *ss;
  size_t n;
  (void)strxfrm(ds, ss, n);
}


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

x86 assembly (clang, -O2):
<uninivar_strxfrm>:
jmp    1030 <strxfrm@plt>

LLVM IR (-O0):
define void @uninivar_strxfrm() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @strxfrm(i8* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninivar_strxfrm() {
%1 = tail call i32 @strxfrm(i8* undef, i8* undef, i64 undef)
ret void
}
void func_call(char *x, char *y, void (*cb)(char *)) {
  cb(y);
  *x = (*y)++;
}


x86 assembly (clang, -O0):
<func_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    %cl,%dl
add    $0x1,%dl
mov    %dl,(%rax)
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_call>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   *%rdx
mov    (%rbx),%al
lea    0x1(%rax),%ecx
mov    %cl,(%rbx)
mov    %al,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @func_call(i8* %0, i8* %1, void (i8*)* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca void (i8*)*
store i8* %0, i8** %4
store i8* %1, i8** %5
store void (i8*)* %2, void (i8*)** %6
%7 = load void (i8*)*, void (i8*)** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = add i8 %10, 1
store i8 %11, i8* %9
%12 = load i8*, i8** %4
store i8 %10, i8* %12
ret void
}

LLVM IR (-O2):
define void @func_call(i8* nocapture writeonly %0, i8* %1, void (i8*)* nocapture %2) {
tail call void %2(i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, 1
store i8 %5, i8* %1
store i8 %4, i8* %0
ret void
}
void to_stdout(char c) {
  int *IO = (int *)(0x3c000000 + 1 * 0x00000020);
  *IO = (unsigned char)c;
}


x86 assembly (clang, -O0):
<to_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3c000020,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_stdout>:
movzbl %dil,%eax
mov    %eax,0x3c000020
ret

LLVM IR (-O0):
define void @to_stdout(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 1006632992 to i32*), i32** %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = load i32*, i32** %3
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @to_stdout(i8 signext %0) {
%2 = zext i8 %0 to i32
store i32 %2, i32* inttoptr (i64 1006632992 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, int);
void bar() { foo(1, 2, 3); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo(i32 1, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadQueryReaction(int);
int indigoReadString(char const *);
__attribute__((visibility("default"))) int
indigoLoadQueryReactionFromString(const char *string) {
  int source = indigoReadString(string);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadQueryReaction(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadQueryReactionFromString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <indigoReadString@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     115e <indigoLoadQueryReactionFromString+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <indigoLoadQueryReactionFromString+0x47>
mov    -0x14(%rbp),%edi
call   1030 <indigoLoadQueryReaction@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <indigoFree@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadQueryReactionFromString>:
push   %rbp
push   %rbx
push   %rax
call   1050 <indigoReadString@plt>
test   %eax,%eax
jle    1152 <indigoLoadQueryReactionFromString+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <indigoLoadQueryReaction@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadQueryReactionFromString+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indigoLoadQueryReactionFromString(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @indigoReadString(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @indigoLoadQueryReaction(i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @indigoFree(i32 %14)
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @indigoLoadQueryReactionFromString(i8* %0) {
%2 = tail call i32 @indigoReadString(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @indigoLoadQueryReaction(i32 %2)
%6 = tail call i32 @indigoFree(i32 %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
void test_threads(void) {}


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

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

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

LLVM IR (-O2):
define void @test_threads() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m512i;

/* Variables and functions */
int /*<<< orphan*/ _mm512_shuffle_i32x4(int /*<<< orphan*/, int /*<<< orphan*/,
                                        int);
__attribute__((always_)) __m512i unpack_hi_128(__m512i a, __m512i b) {
  return _mm512_shuffle_i32x4(a, b, 0xdd);
}


x86 assembly (clang, -O0):
<unpack_hi_128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xdd,%edx
call   1030 <_mm512_shuffle_i32x4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_hi_128>:
mov    $0xdd,%edx
jmp    1030 <_mm512_shuffle_i32x4@plt>

LLVM IR (-O0):
define i32 @unpack_hi_128(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* %4
%7 = call i32 @_mm512_shuffle_i32x4(i32 %5, i32 %6, i32 221)
ret i32 %7
}

LLVM IR (-O2):
define i32 @unpack_hi_128(i32 %0, i32 %1) {
%3 = tail call i32 @_mm512_shuffle_i32x4(i32 %0, i32 %1, i32 221)
ret i32 %3
}
__int128 imax(__int128 a, __int128 b) {
  if (a > b) {
    return a;
  }
  return b;
}


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdx,%rax
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    %rax,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rcx
mov    -0x50(%rbp),%rdx
mov    -0x48(%rbp),%rax
sub    %rsi,%rdx
sbb    %rcx,%rax
jge    116d <imax+0x6d>
jmp    1158 <imax+0x58>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    117d <imax+0x7d>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %rdx,%rax
cmp    %rdi,%rdx
mov    %rcx,%rdx
sbb    %rsi,%rdx
cmovl  %rdi,%rax
cmovl  %rsi,%rcx
mov    %rcx,%rdx
ret

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

LLVM IR (-O2):
define { i64, i64 } @imax(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = zext i64 %1 to i128
%6 = shl nuw i128 %5, 64
%7 = zext i64 %0 to i128
%8 = or i128 %6, %7
%9 = zext i64 %3 to i128
%10 = shl nuw i128 %9, 64
%11 = zext i64 %2 to i128
%12 = or i128 %10, %11
%13 = icmp sgt i128 %8, %12
%14 = select i1 %13, i64 %0, i64 %2
%15 = select i1 %13, i64 %1, i64 %3
%16 = insertvalue { i64, i64 } poison, i64 %14, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ DrawCube();
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  DrawCube();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1040 <glClear@plt>
mov    $0x0,%al
call   1030 <DrawCube@plt>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1040 <glClear@plt>
xor    %eax,%eax
call   1030 <DrawCube@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 (...) @DrawCube()
%6 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @DrawCube()
%6 = tail call i32 (...) @glutSwapBuffers()
ret void
}
int addDigits(int num) {
  int retval = 0;
  if (num < 10)
    return num;
  retval = num % 9;
  return retval ? retval : 9;
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1123 <addDigits+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <addDigits+0x59>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1146 <addDigits+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <addDigits+0x53>
mov    $0x9,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <addDigits+0x53>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
mov    %edi,%eax
cmp    $0xa,%edi
jl     1121 <addDigits+0x21>
mov    %eax,%ecx
imul   $0x38e38e39,%rcx,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
mov    $0x9,%ecx
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @addDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %19
9: ; preds = %1
%10 = load i32, i32* %3
%11 = srem i32 %10, 9
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i32, i32* %4
br label %17
16: ; preds = %9
br label %17
17: ; preds = %16, %14
%18 = phi i32 [ %15, %14 ], [ 9, %16 ]
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = urem i32 %0, 9
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 9, i32 %4
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ %0, %1 ]
ret i32 %8
}