xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
void hea_cq_aer_cq_overflow_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 0, 0);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_cq_overflow_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hea_cq_aer_cq_overflow_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 0, i32 0)
store i32 %3, i32* %0
ret void
}
int test_imm_77uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x77 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_77uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x77,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_77uint64_highword_mem>:
testb  $0x77,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_77uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 511101108224
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: verifysig pubkey file key\n\n"
                  "return values:    0 -> signature verified OK\n"
                  "                  1 -> signature invalid\n"
                  "                  2 -> no signature found\n"
                  "                  3 -> signature verification error\n"
                  "                  4 -> other error\n");
  exit(4);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [250 x i8] c"usage: verifysig pubkey file key\0A\0Areturn values: 0 -> signature verified OK\0A 1 -> signature invalid\0A 2 -> no signature found\0A 3 -> signature verification error\0A 4 -> other error\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([250 x i8], [250 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [250 x i8] c"usage: verifysig pubkey file key\0A\0Areturn values: 0 -> signature verified OK\0A 1 -> signature invalid\0A 2 -> no signature found\0A 3 -> signature verification error\0A 4 -> other error\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([250 x i8], [250 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void get_current_hour_min(char *buf, size_t s) {
  time_t now = time(0);
  struct tm t;
  t = *localtime(&now);
  strftime(buf, s, "%H:%M", &t);
}


x86 assembly (clang, -O0):
<get_current_hour_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xe99(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_hour_min>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rsp)
lea    0xea5(%rip),%rdx
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%H:%M\00"
define void @get_current_hour_min(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.tm
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = call i32 @time(i32 0)
store i32 %7, i32* %5
%8 = call %struct.tm* @localtime(i32* %5)
%9 = bitcast %struct.tm* %6 to i8*
%10 = bitcast %struct.tm* %8 to i8*
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @strftime(i8* %11, i64 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%H:%M\00"
define void @get_current_hour_min(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.tm
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32 0)
store i32 %6, i32* %3
%7 = bitcast %struct.tm* %4 to i8*
%8 = call %struct.tm* @localtime(i32* %3)
%9 = getelementptr %struct.tm, %struct.tm* %8, i64 0, i32 0
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%11 = load i32, i32* %9
store i32 %11, i32* %10
%12 = call i32 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret void
}
unsigned xrop3_221_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~D;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_221_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_221_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_221_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = xor i32 %15, -1
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = or i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = xor i32 %21, -1
%23 = and i32 %20, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = and i32 %24, %25
%27 = or i32 %23, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @xrop3_221_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
unsigned long pow_fun_ulong(unsigned long a, unsigned long b) {
  unsigned long r = 1;
  int i;
  for (i = 0; i < b; ++i)
    r *= a;
  return r;
}


x86 assembly (clang, -O0):
<pow_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1144 <pow_fun_ulong+0x44>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <pow_fun_ulong+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_fun_ulong>:
test   %rsi,%rsi
je     111b <pow_fun_ulong+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <pow_fun_ulong+0x21>
mov    $0x1,%eax
jmp    1156 <pow_fun_ulong+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <pow_fun_ulong+0x30>
test   %rcx,%rcx
je     116a <pow_fun_ulong+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <pow_fun_ulong+0x60>
ret

LLVM IR (-O0):
define i64 @pow_fun_ulong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 1, i64* %5
store i32 0, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i64, i64* %3
%14 = load i64, i64* %5
%15 = mul i64 %14, %13
store i64 %15, i64* %5
br label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @pow_fun_ulong(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul i64 %11, %0
%14 = mul i64 %13, %0
%15 = mul i64 %14, %0
%16 = mul i64 %15, %0
%17 = mul i64 %16, %0
%18 = mul i64 %17, %0
%19 = mul i64 %18, %0
%20 = mul i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "%s <remote-host> <pkt-size>\n", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"%s <remote-host> <pkt-size>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"%s <remote-host> <pkt-size>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned short SIO1_readData16(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i16 @SIO1_readData16() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @SIO1_readData16() {
ret i16 0
}
/* Variables and functions */
long lseek(int, long, int);
long filelength(int hf) {
  long l0;
  long l;
  l0 = lseek(hf, 0, 1);
  l = lseek(hf, 0, 2);
  lseek(hf, l0, 0);
  return l;
}


x86 assembly (clang, -O0):
<filelength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <lseek@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1030 <lseek@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <lseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelength>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <lseek@plt>
mov    %rax,%r14
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <lseek@plt>
mov    %rax,%r15
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <lseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @filelength(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i64 @lseek(i32 %5, i64 0, i32 1)
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = call i64 @lseek(i32 %7, i64 0, i32 2)
store i64 %8, i64* %4
%9 = load i32, i32* %2
%10 = load i64, i64* %3
%11 = call i64 @lseek(i32 %9, i64 %10, i32 0)
%12 = load i64, i64* %4
ret i64 %12
}

LLVM IR (-O2):
define i64 @filelength(i32 %0) {
%2 = tail call i64 @lseek(i32 %0, i64 0, i32 1)
%3 = tail call i64 @lseek(i32 %0, i64 0, i32 2)
%4 = tail call i64 @lseek(i32 %0, i64 %2, i32 0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void max(int a, int b) {
  if (a > b) {
    printf("%d\n", a);
  } else {
    printf("%d\n", b);
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113e <max+0x2e>
mov    -0x4(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <max+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
cmp    %esi,%edi
cmovg  %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbb_getIndexByStr(char *);
int /*<<< orphan*/ bbb_showByIndex(int /*<<< orphan*/);
void bbb_showPin(char *str) { bbb_showByIndex(bbb_getIndexByStr(str)); }


x86 assembly (clang, -O0):
<bbb_showPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bbb_getIndexByStr@plt>
mov    %eax,%edi
call   1030 <bbb_showByIndex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbb_showPin>:
push   %rax
call   1040 <bbb_getIndexByStr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bbb_showByIndex@plt>

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

LLVM IR (-O2):
define void @bbb_showPin(i8* %0) {
%2 = tail call i32 @bbb_getIndexByStr(i8* %0)
%3 = tail call i32 @bbb_showByIndex(i32 %2)
ret void
}
/* Variables and functions */
int startsWith(const char *s, char c) {
  if (s != NULL)
    return s[0] == c;
  return 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <startsWith+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <startsWith+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <startsWith+0xd>
cmp    %sil,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, %1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
ret i32 %9
}
void Com_ScriptModule_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @Com_ScriptModule_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *, double *);
int main() {
  int x, y;
  double z;
  scanf("%d %d %lf", &x, &y, &z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, double* %3)
ret i32 0
}
/* Variables and functions */
int rand();
unsigned int random_int() {
  unsigned int i = 0;
  unsigned int v = 0;
  unsigned char buffer[4];
  for (i = 0; i < 4; i++) {
    buffer[i] = rand() & 0xFF;
  }
  v = *(unsigned int *)buffer;
  return v;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jae    115a <random_int+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %al,%cl
mov    -0x4(%rbp),%eax
mov    %cl,-0xc(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <random_int+0x1d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x18,%eax
movzbl %bl,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
shl    $0x8,%ebp
movzwl %bp,%ecx
or     %ecx,%eax
movzbl %r14b,%ecx
or     %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_int() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 4
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i32, i32* %1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 %12
store i8 %10, i8* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %1
%16 = add i32 %15, 1
store i32 %16, i32* %1
br label %4
17: ; preds = %4
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @random_int() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = shl i32 %4, 24
%6 = shl i32 %3, 16
%7 = and i32 %6, 16711680
%8 = or i32 %5, %7
%9 = shl i32 %2, 8
%10 = and i32 %9, 65280
%11 = or i32 %8, %10
%12 = and i32 %1, 255
%13 = or i32 %11, %12
ret i32 %13
}
int RTFBraceLevel(int level) {
  static int braceLevel;
  if (level == -99)
    return braceLevel;
  braceLevel = level;
  return braceLevel;
}


x86 assembly (clang, -O0):
<RTFBraceLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffff9d,-0x8(%rbp)
jne    111f <RTFBraceLevel+0x1f>
mov    0x2f0d(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <RTFBraceLevel+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,0x2efc(%rip)
mov    0x2ef6(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTFBraceLevel>:
cmp    $0xffffff9d,%edi
jne    110c <RTFBraceLevel+0xc>
mov    0x2f19(%rip),%eax
ret
mov    %edi,%eax
mov    %edi,0x2f10(%rip)
ret

LLVM IR (-O0):
@RTFBraceLevel.braceLevel = internal global i32 0
define i32 @RTFBraceLevel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -99
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @RTFBraceLevel.braceLevel
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* @RTFBraceLevel.braceLevel
%10 = load i32, i32* @RTFBraceLevel.braceLevel
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@RTFBraceLevel.braceLevel = internal unnamed_addr global i32 0
define i32 @RTFBraceLevel(i32 %0) {
%2 = icmp eq i32 %0, -99
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @RTFBraceLevel.braceLevel
br label %6
5: ; preds = %1
store i32 %0, i32* @RTFBraceLevel.braceLevel
br label %6
6: ; preds = %5, %3
%7 = phi i32 [ %4, %3 ], [ %0, %5 ]
ret i32 %7
}
/* Variables and functions */
bool isPowerOfTwo(int n) {
  if (n <= 0)
    return false;
  return !(n & (n - 1));
}


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <isPowerOfTwo+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1138 <isPowerOfTwo+0x38>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %edi,%edi
jle    110f <isPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = and i32 %8, %10
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void hot_sys_vPanic(char *reason, va_list args) {
  fprintf(stderr, "PANIC:HOT:");
  vfprintf(stderr, reason, args);
  fprintf(stderr, "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<hot_sys_vPanic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<hot_sys_vPanic>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea0(%rip),%r14
mov    (%r14),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <vfprintf@plt>
mov    (%r14),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"PANIC:HOT:\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @hot_sys_vPanic(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"PANIC:HOT:\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @hot_sys_vPanic(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @vfprintf(i32 %5, i8* %0, i32 %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
void authnone_destroy(AUTH *x) {}


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

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

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

LLVM IR (-O2):
define void @authnone_destroy(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EPIConfigHB16Set(uint32_t ui32Base, uint32_t ui32Config,
                      uint32_t ui32MaxWait) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000014))) =
      ((ui32Config & 0x00000800) ? 0x04000000 : 0) |
      ((ui32Config & 0x00001600) << 15);
  ui32Config &= ~0x0000FF00;
  ui32Config |= ui32MaxWait << 8;
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigHB16Set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edx
and    $0x800,%edx
xor    %ecx,%ecx
mov    $0x4000000,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0x1600,%eax
shl    $0xf,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xffff00ff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigHB16Set>:
mov    %esi,%eax
shl    $0xf,%eax
and    $0xf000000,%eax
movslq %edi,%rcx
mov    %eax,0x14(%rcx)
and    $0xffff00ff,%esi
shl    $0x8,%edx
or     %esi,%edx
mov    %edx,0x10(%rcx)
ret

LLVM IR (-O0):
define void @EPIConfigHB16Set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 2048
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 67108864, i32 0
%12 = load i32, i32* %5
%13 = and i32 %12, 5632
%14 = shl i32 %13, 15
%15 = or i32 %11, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 20
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
%20 = load i32, i32* %5
%21 = and i32 %20, -65281
store i32 %21, i32* %5
%22 = load i32, i32* %6
%23 = shl i32 %22, 8
%24 = load i32, i32* %5
%25 = or i32 %24, %23
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 16
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
store volatile i32 %26, i32* %30
ret void
}

LLVM IR (-O2):
define void @EPIConfigHB16Set(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 15
%5 = and i32 %4, 251658240
%6 = add nsw i32 %0, 20
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
%9 = and i32 %1, -65281
%10 = shl i32 %2, 8
%11 = or i32 %10, %9
%12 = add nsw i32 %0, 16
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %11, i32* %14
ret void
}
void rop3_14_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_14_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)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %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_14_1_1>:
ret

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

LLVM IR (-O2):
define void @rop3_14_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
scalar_t__ is_lower(int);
scalar_t__ is_upper(int);
int ft_isalpha(int c) { return (is_upper(c) || is_lower(c)); }


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_upper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <ft_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <is_lower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_upper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <is_lower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @is_upper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @is_lower(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = tail call i64 @is_upper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_lower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  int b;
  b = 10 / a;
  printf("%d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0xa,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
sub    $0x28,%rsp
movapd %xmm0,%xmm1
movapd %xmm0,(%rsp)
movapd 0xedb(%rip),%xmm0
xorpd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
call   1030 <exp@plt>
subsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @f3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = load double, double* %2
%11 = load double, double* %2
%12 = fneg double %10
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double %9)
ret double %13
}

LLVM IR (-O2):
define double @f3(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
%5 = fsub double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ handle_MSG(int /*<<< orphan*/);
int gen_MSG() {
  handle_MSG(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_MSG() {
%1 = call i32 @handle_MSG(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_MSG() {
%1 = tail call i32 @handle_MSG(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rm2(char, char *);
int main() {
  char c = 'b';
  char s[] = "babdaebache";
  printf("%s\n", s);
  rm2(c, s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x62,-0x1(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x5(%rbp)
lea    -0xd(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1(%rbp),%al
lea    -0xd(%rbp),%rsi
movsbl %al,%edi
call   1030 <rm2@plt>
lea    -0xd(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6162656164626162,%rax
65 62 61
mov    %rax,0x8(%rsp)
movl   $0x656863,0x10(%rsp)
lea    0xec7(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x62,%edi
mov    %rbx,%rsi
call   1030 <rm2@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s = [12 x i8] c"babdaebache\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [12 x i8]
store i8 98, i8* %1
%3 = bitcast [12 x i8]* %2 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8, i8* %1
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = call i32 @rm2(i8 signext %6, i8* %7)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [12 x i8] c"babdaebache\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @rm2(i8 signext 98, i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
double dcall(d)
double d;
{
  int Zero = 0;
  return d + Zero;
}


x86 assembly (clang, -O0):
<dcall>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcall>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dcall(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
store i32 0, i32* %3
%4 = load double, double* %2
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fadd double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @dcall(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
void tt_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @tt_exit() {
ret void
}
void u_tsd_init(struct u_tsd *tsd) { (void)tsd; }


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

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

LLVM IR (-O0):
%struct.u_tsd = type opaque
define void @u_tsd_init(%struct.u_tsd* %0) {
%2 = alloca %struct.u_tsd*
store %struct.u_tsd* %0, %struct.u_tsd** %2
%3 = load %struct.u_tsd*, %struct.u_tsd** %2
ret void
}

LLVM IR (-O2):
%struct.u_tsd = type opaque
define void @u_tsd_init(%struct.u_tsd* nocapture %0) {
ret void
}
void I422ToAR30Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToAR30Row_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *, void *, void *);
void test_1a(void *q, void *r) {
  void *p = NULL;
  foo(p, q, r);
}


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

x86 assembly (clang, -O2):
<test_1a>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @test_1a(i8* %0, i8* %1) {
%3 = tail call i32 @foo(i8* null, i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int rand();
int rand_binom(int n) { return rand() % n + rand() % n; }


x86 assembly (clang, -O0):
<rand_binom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    -0x8(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_binom>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_binom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = call i32 (...) @rand()
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rand_binom(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
%6 = add nsw i32 %5, %3
ret i32 %6
}
void RTLogSetCustomPrefixCallback(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogSetCustomPrefixCallback() {
ret void
}
/* Variables and functions */
int identity(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", identity(487)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e7,%edi
call   1040 <identity@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @identity(i32 487)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoNip(void) { InlineWords(2, 16, 20); }


x86 assembly (clang, -O0):
<DoNip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x10,%esi
mov    $0x14,%edx
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoNip>:
mov    $0x2,%edi
mov    $0x10,%esi
mov    $0x14,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoNip() {
%1 = call i32 @InlineWords(i32 2, i32 16, i32 20)
ret void
}

LLVM IR (-O2):
define void @DoNip() {
%1 = tail call i32 @InlineWords(i32 2, i32 16, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bug(char);
char getTaint(char **);
int main(int argc, char **argv) {
  char t = getTaint(argv);
  bug(t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getTaint@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1030 <bug@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdi
call   1040 <getTaint@plt>
movsbl %al,%edi
call   1030 <bug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = call signext i8 @getTaint(i8** %6)
store i8 %7, i8* %5
%8 = load i8, i8* %5
%9 = call i32 @bug(i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call signext i8 @getTaint(i8** %1)
%4 = tail call i32 @bug(i8 signext %3)
ret i32 0
}