xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgclear2(void) { gen("xorq\t%rcx,%rcx"); }


x86 assembly (clang, -O0):
<cgclear2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <gen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgclear2>:
lea    0xee9(%rip),%rdi
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"xorq\09%rcx,%rcx\00"
define void @cgclear2() {
%1 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"xorq\09%rcx,%rcx\00"
define void @cgclear2() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void keyboard_init(void) {}


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

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

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

LLVM IR (-O2):
define void @keyboard_init() {
ret void
}
/* Variables and functions */
char *crypt(char const *, char const *);
scalar_t__ strcmp(char *, char *);
int DWChkValidCode(char *szStr, char *szCryptStr) {
  char *p;
  p = crypt((const char *)szStr, (const char *)szCryptStr);
  if (p == NULL || strcmp(p, szCryptStr) != 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<DWChkValidCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <crypt@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1163 <DWChkValidCode+0x43>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     116f <DWChkValidCode+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <DWChkValidCode+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DWChkValidCode>:
push   %rbx
mov    %rsi,%rbx
call   1030 <crypt@plt>
test   %rax,%rax
je     1146 <DWChkValidCode+0x26>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @DWChkValidCode(i8* %0, i8* %1) {
%3 = tail call i8* @crypt(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
long reverse(long N) {
  unsigned char B[4];
  B[0] = (N & 0x000000FF) >> 0;
  B[1] = (N & 0x0000FF00) >> 8;
  B[2] = (N & 0x00FF0000) >> 16;
  B[3] = (N & 0xFF000000) >> 24;
  return ((B[0] << 24) | (B[1] << 16) | (B[2] << 8) | (B[3] << 0));
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
sar    $0x0,%rax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff00,%rax
sar    $0x8,%rax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff0000,%rax
sar    $0x10,%rax
mov    %al,-0xa(%rbp)
movabs $0xff000000,%rax
and    -0x8(%rbp),%rax
sar    $0x18,%rax
mov    %al,-0x9(%rbp)
movzbl -0xc(%rbp),%eax
shl    $0x18,%eax
movzbl -0xb(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x9(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
bswap  %edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @reverse(i64 %0) {
%2 = alloca i64
%3 = alloca [4 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 255
%6 = ashr i64 %5, 0
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i64, i64* %2
%10 = and i64 %9, 65280
%11 = ashr i64 %10, 8
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i64, i64* %2
%15 = and i64 %14, 16711680
%16 = ashr i64 %15, 16
%17 = trunc i64 %16 to i8
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %17, i8* %18
%19 = load i64, i64* %2
%20 = and i64 %19, 4278190080
%21 = ashr i64 %20, 24
%22 = trunc i64 %21 to i8
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %22, i8* %23
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 24
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 16
%32 = or i32 %27, %31
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = shl i32 %35, 8
%37 = or i32 %32, %36
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = shl i32 %40, 0
%42 = or i32 %37, %41
%43 = sext i32 %42 to i64
ret i64 %43
}

LLVM IR (-O2):
define i64 @reverse(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = sext i32 %3 to i64
ret i64 %4
}
int is_digit(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_x(void *_p, int _v) {
  ((XWindowAttributes *)_p)->x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _array_private_container(void *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void _array_free_helper(void *a) {
  if (a == NULL)
    return;
  free(_array_private_container(a));
}


x86 assembly (clang, -O0):
<_array_free_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <_array_free_helper+0x1c>
jmp    114c <_array_free_helper+0x2c>
mov    -0x8(%rbp),%rdi
call   1040 <_array_private_container@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_array_free_helper>:
test   %rdi,%rdi
je     1133 <_array_free_helper+0x13>
push   %rax
call   1040 <_array_private_container@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @_array_free_helper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @_array_private_container(i8* %0)
%5 = tail call i32 @free(i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
void *Cyc_Toc_id(void *obj) { return obj; }


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

x86 assembly (clang, -O2):
<Cyc_Toc_id>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @Cyc_Toc_id(i8* readnone returned %0) {
ret i8* %0
}
yywrap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @yywrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void says(const char *str) { write(1, str, strlen(str)); }


x86 assembly (clang, -O0):
<says>:
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 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @says(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
void transdata_newsocketpair(void) {}


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

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

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

LLVM IR (-O2):
define void @transdata_newsocketpair() {
ret void
}
void arch_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_idle() {
ret void
}
int i_min(a1, a2, a3)
double a1, a2, a3;
{
  int ii;
  double dmin;
  if (a2 < a1) {
    dmin = a2;
    ii = 2;
  } else {
    dmin = a1;
    ii = 1;
  }
  if (a3 < dmin) {
    dmin = a3;
    ii = 3;
  }
  return ii;
}


x86 assembly (clang, -O0):
<i_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113d <i_min+0x3d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x2,-0x1c(%rbp)
jmp    114e <i_min+0x4e>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x1,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1173 <i_min+0x73>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x3,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_min>:
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
add    $0x1,%ecx
minsd  %xmm0,%xmm1
ucomisd %xmm2,%xmm1
mov    $0x3,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @i_min(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %5
%10 = load double, double* %4
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load double, double* %5
store double %13, double* %8
store i32 2, i32* %7
br label %16
14: ; preds = %3
%15 = load double, double* %4
store double %15, double* %8
store i32 1, i32* %7
br label %16
16: ; preds = %14, %12
%17 = load double, double* %6
%18 = load double, double* %8
%19 = fcmp olt double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load double, double* %6
store double %21, double* %8
store i32 3, i32* %7
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @i_min(double %0, double %1, double %2) {
%4 = fcmp olt double %1, %0
%5 = select i1 %4, i32 2, i32 1
%6 = select i1 %4, double %1, double %0
%7 = fcmp ogt double %6, %2
%8 = select i1 %7, i32 3, i32 %5
ret i32 %8
}
void xassert(int expr) {
  if (!(expr)) {
    while (1)
      ;
  }
}


x86 assembly (clang, -O0):
<xassert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <xassert+0x1b>
jmp    1116 <xassert+0x16>
jmp    1116 <xassert+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xassert>:
test   %edi,%edi
je     1110 <xassert+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <xassert+0x10>

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

LLVM IR (-O2):
define void @xassert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
/* Type definitions */
typedef int layer;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void ClearLayer(unsigned char layer) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x05) & 0xFF);
  SendChar((layer)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<ClearLayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x5,%edi
call   1030 <SendChar@plt>
movzbl -0x1(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearLayer>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x5,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @ClearLayer(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 5)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = call i32 @SendChar(i32 %7)
%9 = call i32 @SendChar(i32 255)
%10 = call i32 @SendChar(i32 252)
%11 = call i32 @SendChar(i32 255)
%12 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @ClearLayer(i8 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 5)
%4 = zext i8 %0 to i32
%5 = tail call i32 @SendChar(i32 %4)
%6 = tail call i32 @SendChar(i32 255)
%7 = tail call i32 @SendChar(i32 252)
%8 = tail call i32 @SendChar(i32 255)
%9 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void win() { printf("exploit!\n"); }


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

x86 assembly (clang, -O2):
<win>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"exploit!\0A\00"
define void @win() {
%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"exploit!\00"
define void @win() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int node_sort(struct corpus_tree_node *node, const struct corpus_tree *tree) {
  (void)node;
  (void)tree;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.corpus_tree_node = type opaque
%struct.corpus_tree = type opaque
define i32 @node_sort(%struct.corpus_tree_node* %0, %struct.corpus_tree* %1) {
%3 = alloca %struct.corpus_tree_node*
%4 = alloca %struct.corpus_tree*
store %struct.corpus_tree_node* %0, %struct.corpus_tree_node** %3
store %struct.corpus_tree* %1, %struct.corpus_tree** %4
%5 = load %struct.corpus_tree_node*, %struct.corpus_tree_node** %3
%6 = load %struct.corpus_tree*, %struct.corpus_tree** %4
ret i32 0
}

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

/* Variables and functions */
int fflush(FILE *file) {
  if (file) {
  } else {
  }
  return 0;
}


x86 assembly (clang, -O0):
<fflush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <fflush+0x18>
jmp    111d <fflush+0x1d>
jmp    111d <fflush+0x1d>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fflush(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_54(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_54() {
ret i32 0
}
/* Variables and functions */
int fls(int);
int mask(int x) { return ((unsigned)~0 >> (32 - fls(x))); }


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fls@plt>
mov    $0x20,%ecx
sub    %eax,%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
push   %rax
call   1030 <fls@plt>
neg    %al
mov    $0xffffffff,%edx
mov    %eax,%ecx
shr    %cl,%edx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fls(i32 %3)
%5 = sub nsw i32 32, %4
%6 = lshr i32 -1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @mask(i32 %0) {
%2 = tail call i32 @fls(i32 %0)
%3 = sub nsw i32 32, %2
%4 = lshr i32 -1, %3
ret i32 %4
}
int _HCI_getMaxAclFrameSize() { return 680; }


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

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

LLVM IR (-O0):
define i32 @_HCI_getMaxAclFrameSize() {
ret i32 680
}

LLVM IR (-O2):
define i32 @_HCI_getMaxAclFrameSize() {
ret i32 680
}
int is_digit_char(char x) { return ('0' <= x && x <= '9'); }


x86 assembly (clang, -O0):
<is_digit_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <is_digit_char+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit_char>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int os_preamble(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_preamble() {
ret i32 0
}
/* Variables and functions */
int bits_hi(void *ptr) {
  intptr_t int64 = (intptr_t)ptr;
  int64 >>= 32;
  return (int)int64;
}


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

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

LLVM IR (-O0):
define i32 @bits_hi(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = ashr i64 %6, 32
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bits_hi(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void set_tweak_in_tweakey(uint8_t *tweakey, uint8_t *tweak) {
  memcpy(tweakey + 10, tweak, 14);
}


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

x86 assembly (clang, -O2):
<set_tweak_in_tweakey>:
add    $0x28,%rdi
mov    $0xe,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @set_tweak_in_tweakey(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 = getelementptr inbounds i32, i32* %5, i64 10
%7 = load i32*, i32** %4
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 14)
ret void
}

LLVM IR (-O2):
define void @set_tweak_in_tweakey(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 10
%4 = tail call i32 @memcpy(i32* %3, i32* %1, i32 14)
ret void
}
void PDC_set_title(char *title) { return; }


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

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

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

LLVM IR (-O2):
define void @PDC_set_title(i8* nocapture %0) {
ret void
}
/* Variables and functions */
float _pico_little_float(float src) { return src; }


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

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

LLVM IR (-O0):
define float @_pico_little_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define float @_pico_little_float(float returned %0) {
ret float %0
}
void render(int xori, int yori, int xres, int yres) {}


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

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

LLVM IR (-O0):
define void @render(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @render(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_quit(int signo) { printf("catch the signal\n"); }


x86 assembly (clang, -O0):
<sig_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_quit>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"catch the signal\0A\00"
define void @sig_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"catch the signal\00"
define void @sig_quit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *strrchr(char const *, char);
char *cleanToolName(const char *name) {
  char *last = strrchr(name, '/');
  if (last && *(last + 1)) {
    return strdup(last + 1);
  } else {
    return strdup(name);
  }
}


x86 assembly (clang, -O0):
<cleanToolName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <cleanToolName+0x50>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1170 <cleanToolName+0x50>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    117d <cleanToolName+0x5d>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanToolName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1146 <cleanToolName+0x26>
cmpb   $0x0,0x1(%rax)
je     1146 <cleanToolName+0x26>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
jmp    1040 <strdup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @cleanToolName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = call i8* @strdup(i8* %17)
store i8* %18, i8** %2
br label %22
19: ; preds = %9, %1
%20 = load i8*, i8** %3
%21 = call i8* @strdup(i8* %20)
store i8* %21, i8** %2
br label %22
22: ; preds = %19, %15
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @cleanToolName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i8* @strdup(i8* %5)
br label %12
10: ; preds = %4, %1
%11 = tail call i8* @strdup(i8* %0)
br label %12
12: ; preds = %10, %8
%13 = phi i8* [ %9, %8 ], [ %11, %10 ]
ret i8* %13
}
int test_imm_02int16_reg(short val) {
  return ((val) & (-0x02 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_02int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xfffffffe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_02int16_reg>:
cmp    $0x2,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_02int16_reg(i16 signext %0) {
%2 = icmp ult i16 %0, 2
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void rop3_117_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_117_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_117_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t int64p_comparator(const void *pl, const void *pr) {
  int64_t lv = *(const int64_t *)pl;
  int64_t rv = *(const int64_t *)pr;
  if (lv < rv)
    return -1;
  else if (lv == rv)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<int64p_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <int64p_comparator+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <int64p_comparator+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <int64p_comparator+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <int64p_comparator+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @int64p_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
char *rindex(src, c) const char *src;
int c;
{ return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @rindex(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int fconf_istoken(char const, char);
int fconf_istoken_lf(const char str) { return fconf_istoken(str, '\n'); }


x86 assembly (clang, -O0):
<fconf_istoken_lf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xa,%esi
movsbl -0x1(%rbp),%edi
call   1030 <fconf_istoken@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fconf_istoken_lf>:
mov    $0xa,%esi
jmp    1030 <fconf_istoken@plt>

LLVM IR (-O0):
define i32 @fconf_istoken_lf(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @fconf_istoken(i8 signext %3, i8 signext 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @fconf_istoken_lf(i8 signext %0) {
%2 = tail call i32 @fconf_istoken(i8 signext %0, i8 signext 10)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ *RSA_new_method(int /*<<< orphan*/ *);
RSA *RSA_new(void) {
  RSA *r = RSA_new_method(NULL);
  return r;
}


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

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

LLVM IR (-O0):
define i32* @RSA_new() {
%1 = alloca i32*
%2 = call i32* @RSA_new_method(i32* null)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
define i32* @RSA_new() {
%1 = tail call i32* @RSA_new_method(i32* null)
ret i32* %1
}
char set_dead_field() { return 'x'; }


x86 assembly (clang, -O0):
<set_dead_field>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_dead_field>:
mov    $0x78,%al
ret

LLVM IR (-O0):
define signext i8 @set_dead_field() {
ret i8 120
}

LLVM IR (-O2):
define signext i8 @set_dead_field() {
ret i8 120
}
/* Variables and functions */
scalar_t__ getchar();
scalar_t__ isgraph(char);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char c = NULL;
  c = (char)getchar();
  if (isgraph(c)) {
    printf("%02x is Graphic Character!\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1050 <isgraph@plt>
cmp    $0x0,%rax
je     1170 <main+0x40>
lea    0xe99(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rax,%rbx
movsbl %bl,%edi
call   1050 <isgraph@plt>
test   %rax,%rax
je     1157 <main+0x27>
movsbl %bl,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%02x is Graphic Character!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = call i64 (...) @getchar()
%4 = trunc i64 %3 to i8
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i64 @isgraph(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %9)
br label %11
11: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"%02x is Graphic Character!\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = trunc i64 %1 to i8
%3 = tail call i64 @isgraph(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %2)
br label %7
7: ; preds = %5, %0
ret i32 0
}
int matherr(x)
struct exception *x;
{
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.exception = type opaque
define i32 @matherr(%struct.exception* nocapture readnone %0) {
ret i32 1
}
int fun1378() { return 1378; }


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

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

LLVM IR (-O0):
define i32 @fun1378() {
ret i32 1378
}

LLVM IR (-O2):
define i32 @fun1378() {
ret i32 1378
}
void make_human(int length, unsigned int *min, unsigned char *sec) {
  *min = (length / 60);
  *sec = (length % 60);
}


x86 assembly (clang, -O0):
<make_human>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_human>:
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
sar    $0x5,%ecx
add    %edi,%ecx
mov    %ecx,(%rsi)
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %al,(%rdx)
ret

LLVM IR (-O0):
define void @make_human(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 60
%9 = load i32*, i32** %5
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = srem i32 %10, 60
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %6
store i8 %12, i8* %13
ret void
}

LLVM IR (-O2):
define void @make_human(i32 %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = sdiv i32 %0, 60
store i32 %4, i32* %1
%5 = srem i32 %0, 60
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
ret void
}
void tswap(int *x, int *y, int *z) {
  int tx = *x;
  int ty = *y;
  *x = *z;
  *y = tx;
  *z = ty;
}


x86 assembly (clang, -O0):
<tswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tswap>:
mov    (%rdi),%r8d
mov    (%rsi),%ecx
mov    (%rdx),%eax
mov    %eax,(%rdi)
mov    %r8d,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @tswap(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
store i32 %12, i32* %8
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = load i32*, i32** %6
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @tswap(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
store i32 %6, i32* %0
store i32 %4, i32* %1
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int *test1();
int *test2(void) { return test1(); }


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

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

LLVM IR (-O0):
define i32* @test2() {
%1 = call i32* (...) @test1()
ret i32* %1
}

LLVM IR (-O2):
define i32* @test2() {
%1 = tail call i32* (...) @test1()
ret i32* %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int check_endianness() {
  uint32_t u;
  char *c;
  c = (char *)(&u);
  c[0] = 0;
  c[1] = 0;
  c[2] = 1;
  c[3] = 0;
  if (u == 256 * 256)
    return 0;
  else if (u == 256)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<check_endianness>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
cmpl   $0x10000,-0x8(%rbp)
jne    1144 <check_endianness+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1164 <check_endianness+0x64>
cmpl   $0x100,-0x8(%rbp)
jne    115d <check_endianness+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <check_endianness+0x64>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @check_endianness() {
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double rand();
int randint(int n) { return (rand() * (1.0 / (RAND_MAX + 1.0))) * n; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xed6(%rip),%xmm2
mov    0x2eb7(%rip),%rax
addsd  (%rax),%xmm2
movsd  0xec3(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec7(%rip),%rax
movsd  0xed7(%rip),%xmm1
movsd  (%rax),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = fmul double %3, %6
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fmul double %7, %9
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0) {
%2 = tail call double (...) @rand()
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fmul double %2, %5
%7 = sitofp i32 %0 to double
%8 = fmul double %6, %7
%9 = fptosi double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ tambah_data_mhs();
int /*<<< orphan*/ tampil_data();
int main() {
  tambah_data_mhs();
  tampil_data();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tambah_data_mhs()
%3 = call i32 (...) @tampil_data()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tambah_data_mhs()
%2 = tail call i32 (...) @tampil_data()
ret i32 0
}