xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dump_char(int);
void _dump_uint32_t(uint32_t x) {
  if (x != 0) {
    _dump_uint32_t(x / 10);
    dump_char('0' + x % 10);
  }
}


x86 assembly (clang, -O0):
<_dump_uint32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115c <_dump_uint32_t+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <_dump_uint32_t@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <dump_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dump_uint32_t>:
test   %edi,%edi
je     1163 <_dump_uint32_t+0x43>
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
movslq %edi,%rax
imul   $0x66666667,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <_dump_uint32_t@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
neg    %eax
lea    (%r14,%rax,1),%edi
add    $0x30,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dump_char@plt>
ret

LLVM IR (-O0):
define void @_dump_uint32_t(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 %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10
%8 = load i32, i32* %2
%9 = srem i32 %8, 10
%10 = add nsw i32 48, %9
%11 = call i32 @dump_char(i32 %10)
br label %12
12: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_dump_uint32_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = sdiv i32 %0, 10
tail call void @_dump_uint32_t(i32 %5)
%6 = srem i32 %0, 10
%7 = add nsw i32 %6, 48
%8 = tail call i32 @dump_char(i32 %7)
br label %3
}
long int labs(const long int j) { return (j < 0) ? -j : j; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* 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\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 = [246 x i8] c"usage: verifysig pubkey file\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 ([246 x i8], [246 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [246 x i8] c"usage: verifysig pubkey file\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 ([246 x i8], [246 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pp_overflow(void) {
  (1 || 1 ? printf("\x1b[31;1m[SBMP][E] "
                   "PayloadParser out of range."
                   "\x1b[0m\n")
          : 0);
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"\1B[31;1m[SBMP][E] PayloadParser out of range.\1B[0m\0A\00"
define void @pp_overflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"\1B[31;1m[SBMP][E] PayloadParser out of range.\1B[0m\00"
define void @pp_overflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
int INDEX(int ipd_port) {
  if (ipd_port < 32)
    return ipd_port & 15;
  return ipd_port & 3;
}


x86 assembly (clang, -O0):
<INDEX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    111f <INDEX+0x1f>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <INDEX+0x28>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<INDEX>:
cmp    $0x20,%edi
mov    $0xf,%ecx
mov    $0x3,%eax
cmovl  %ecx,%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @INDEX(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = select i1 %2, i32 15, i32 3
%4 = and i32 %3, %0
ret i32 %4
}
int test_imm_2Aint8_reg(signed char val) {
  return ((val) & (0x2A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Aint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Aint8_reg>:
test   $0x2a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Aint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 42
%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_2Aint8_reg(i8 signext %0) {
%2 = and i8 %0, 42
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct iovec {
  size_t iov_len;
  void *iov_base;
};

/* Variables and functions */
size_t pullv(int, struct iovec *, int, int);
size_t pull(int fd, void *data, size_t size, int timeout) {
  struct iovec iov;
  iov.iov_base = data;
  iov.iov_len = size;
  return pullv(fd, &iov, 1, timeout);
}


x86 assembly (clang, -O0):
<pull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%ecx
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1030 <pullv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pull>:
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %rdx,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <pullv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.iovec = type { i64, i8* }
define i64 @pull(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca %struct.iovec
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %6
%11 = getelementptr inbounds %struct.iovec, %struct.iovec* %9, i32 0, i32 1
store i8* %10, i8** %11
%12 = load i64, i64* %7
%13 = getelementptr inbounds %struct.iovec, %struct.iovec* %9, i32 0, i32 0
store i64 %12, i64* %13
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = call i64 @pullv(i32 %14, %struct.iovec* %9, i32 1, i32 %15)
ret i64 %16
}

LLVM IR (-O2):
%struct.iovec = type { i64, i8* }
define i64 @pull(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca %struct.iovec
%6 = bitcast %struct.iovec* %5 to i8*
%7 = getelementptr inbounds %struct.iovec, %struct.iovec* %5, i64 0, i32 1
store i8* %1, i8** %7
%8 = getelementptr inbounds %struct.iovec, %struct.iovec* %5, i64 0, i32 0
store i64 %2, i64* %8
%9 = call i64 @pullv(i32 %0, %struct.iovec* %5, i32 1, i32 %3)
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int strlen(char const *);
int fooFS_write(const char *data) {
  printf("foo: %s\n", data);
  return (strlen(data));
}


x86 assembly (clang, -O0):
<fooFS_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooFS_write>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"foo: %s\0A\00"
define i32 @fooFS_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"foo: %s\0A\00"
define i32 @fooFS_write(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
void M68KDummyInit(void) {}


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

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

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

LLVM IR (-O2):
define void @M68KDummyInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x25_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x25_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x25_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x25_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x25_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%d", &a);
  b = a * a;
  c = b * a;
  printf("\n%d", b);
  printf("\n%d", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
void av_timecode_make_smpte_tc_string() {}


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

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

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

LLVM IR (-O2):
define void @av_timecode_make_smpte_tc_string() {
ret void
}
/* Variables and functions */
int mult_ab(int, int);
int power(int num, int base) {
  if (num == 0)
    return 1;
  num--;
  return mult_ab(base, power(num, base));
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1144 <power+0x24>
movl   $0x1,-0x4(%rbp)
jmp    116b <power+0x4b>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <power@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <mult_ab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
je     1139 <power+0x19>
push   %rbx
mov    %esi,%ebx
add    $0xffffffff,%edi
call   1040 <power@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <mult_ab@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %9, %6 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = tail call i32 @power(i32 %7, i32 %1)
%9 = tail call i32 @mult_ab(i32 %1, i32 %8)
br label %4
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t h265hvcc_get_profile_compatibility(const uint8_t *p) {
  return (p[2] << 24) | (p[3] << 16) | (p[4] << 8) | p[5];
}


x86 assembly (clang, -O0):
<h265hvcc_get_profile_compatibility>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x14(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_profile_compatibility>:
mov    0x8(%rdi),%eax
mov    0xc(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_profile_compatibility(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 5
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @h265hvcc_get_profile_compatibility(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 5
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
void decode_curr(unsigned char curr, unsigned char *x, unsigned char *y) {
  *x = curr >> 4;
  *y = curr & 0x0f;
}


x86 assembly (clang, -O0):
<decode_curr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_curr>:
mov    %edi,%eax
shr    $0x4,%al
mov    %al,(%rsi)
and    $0xf,%dil
mov    %dil,(%rdx)
ret

LLVM IR (-O0):
define void @decode_curr(i8 zeroext %0, i8* %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
store i8 %10, i8* %11
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %6
store i8 %15, i8* %16
ret void
}

LLVM IR (-O2):
define void @decode_curr(i8 zeroext %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = lshr i8 %0, 4
store i8 %4, i8* %1
%5 = and i8 %0, 15
store i8 %5, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int equal_int(void *ip, void *jp) {
  printf("hit int\n");
  int i = *(int *)ip;
  int j = *(int *)jp;
  if (j == i) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1156 <equal_int+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115d <equal_int+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"hit int\00"
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %5
%9 = zext i1 %8 to i32
ret i32 %9
}
int HelpItem32(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem32() {
ret i32 0
}
int sign(int a) {
  if (a >= 0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111d <sign+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <sign+0x24>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
/* Variables and functions */
int mysubmodule_get();
int mymodule_get_count() { return mysubmodule_get(); }


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

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

LLVM IR (-O0):
define i32 @mymodule_get_count() {
%1 = call i32 (...) @mysubmodule_get()
ret i32 %1
}

LLVM IR (-O2):
define i32 @mymodule_get_count() {
%1 = tail call i32 (...) @mysubmodule_get()
ret i32 %1
}
const char *filename(const char *file) {
  const char *f = file;
  const char *p;
  for (p = file; 0 != *p; ++p) {
    if ('/' == *p || '\\' == *p) {
      f = p + 1;
    }
  }
  return f;
}


x86 assembly (clang, -O0):
<filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1173 <filename+0x73>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
je     1151 <filename+0x51>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x5c,%eax
cmp    %ecx,%eax
jne    115d <filename+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <filename+0x62>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <filename+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <filename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <filename+0x10>
cmp    $0x5c,%dl
je     1110 <filename+0x10>
test   %dl,%dl
jne    1113 <filename+0x13>
ret

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

LLVM IR (-O2):
define i8* @filename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %3, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int omp_get_thread_num();
void init(int len, int a[], int ppid) {
  int i;
#pragma omp parallel for private(i)
  for (i = 0; i < len; i++) {
    int iam = omp_get_thread_num();
    a[i] = ppid * 100 + iam;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <init+0x4f>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x1c(%rbp)
imul   $0x64,-0x14(%rbp),%edx
add    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <init+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <init+0x37>
mov    %rsi,%r14
imul   $0x64,%edx,%r15d
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
add    %r15d,%eax
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <init+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @init(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
store i32 0, i32* %7
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = call i32 (...) @omp_get_thread_num()
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 100
%17 = load i32, i32* %8
%18 = add nsw i32 %16, %17
%19 = load i32*, i32** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
store i32 %18, i32* %22
br label %23
23: ; preds = %13
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %9
26: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @init(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = mul nsw i32 %2, 100
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = tail call i32 (...) @omp_get_thread_num()
%11 = add nsw i32 %10, %6
%12 = getelementptr inbounds i32, i32* %1, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
ret void
}
/* Variables and functions */
int privsep_getfd_1int(int, int const);
int scamper_privsep_open_divert(const int port) {
  return privsep_getfd_1int(0x05U, port);
}


x86 assembly (clang, -O0):
<scamper_privsep_open_divert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x5,%edi
call   1030 <privsep_getfd_1int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scamper_privsep_open_divert>:
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <privsep_getfd_1int@plt>

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

LLVM IR (-O2):
define i32 @scamper_privsep_open_divert(i32 %0) {
%2 = tail call i32 @privsep_getfd_1int(i32 5, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void get_request(char *p, char *path, char *arg, char *ar1) {
  snprintf(p, 1024,
           "GET /%s/shell.php?cmd=%s HTTP/1.1\r\nHost: %s\r\nUser-Agent: File "
           "Upload Exploiter/v1.2\r\nAccept: */*\r\n\r\n",
           path, ar1, arg);
}


x86 assembly (clang, -O0):
<get_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x400,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_request>:
mov    %rcx,%r8
mov    %rdx,%r9
mov    %rsi,%rcx
lea    0xee0(%rip),%rdx
mov    $0x400,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [101 x i8] c"GET /%s/shell.php?cmd=%s HTTP/1.1\0D\0AHost: %s\0D\0AUser-Agent: File Upload Exploiter/v1.2\0D\0AAccept: */*\0D\0A\0D\0A\00"
define void @get_request(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = call i32 @snprintf(i8* %9, i32 1024, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [101 x i8] c"GET /%s/shell.php?cmd=%s HTTP/1.1\0D\0AHost: %s\0D\0AUser-Agent: File Upload Exploiter/v1.2\0D\0AAccept: */*\0D\0A\0D\0A\00"
define void @get_request(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @snprintf(i8* %0, i32 1024, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3, i8* %2)
ret void
}
__attribute__((__no__)) void
do_nothing_small_hole_assigned_dynamic_all(struct test_small_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_small_hole_assigned_dynamic_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_small_hole_assigned_dynamic_all+0x1b>
jmp    1120 <do_nothing_small_hole_assigned_dynamic_all+0x20>
jmp    1120 <do_nothing_small_hole_assigned_dynamic_all+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_assigned_dynamic_all(%struct.test_small_hole* %0) {
%2 = alloca %struct.test_small_hole*
store %struct.test_small_hole* %0, %struct.test_small_hole** %2
%3 = load %struct.test_small_hole*, %struct.test_small_hole** %2
%4 = ptrtoint %struct.test_small_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_assigned_dynamic_all(%struct.test_small_hole* nocapture %0) {
ret void
}
unsigned int min(unsigned int a, unsigned int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long root;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_root(void *_p, unsigned long _v) {
  ((XKeyPressedEvent *)_p)->root = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XKeyPressedEvent_root(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyPressedEvent_root(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int pmu_init(void) { return -19; }


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

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

LLVM IR (-O0):
define i32 @pmu_init() {
ret i32 -19
}

LLVM IR (-O2):
define i32 @pmu_init() {
ret i32 -19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void will_exit(void) { printf("This is will_exit function\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"This is will_exit function\00"
define void @will_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
int wide_strlen(char *s) {
  int l = 0;
  while (*(s + l) || *(s + l + 1))
    l += 2;
  return (l);
}


x86 assembly (clang, -O0):
<wide_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    113f <wide_strlen+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl 0x1(%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114f <wide_strlen+0x4f>
jmp    115d <wide_strlen+0x5d>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <wide_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wide_strlen>:
xor    %eax,%eax
jmp    1114 <wide_strlen+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <wide_strlen+0x10>
cmpb   $0x0,0x1(%rdi,%rax,1)
jne    1110 <wide_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @wide_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i64 [ %12, %11 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2, %7
%12 = add nuw i64 %3, 2
br label %2
13: ; preds = %7
%14 = trunc i64 %3 to i32
ret i32 %14
}
void rop3_125_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_125_0_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
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%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
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_125_0_1>:
mov    %edx,%eax
xor    %sil,%al
mov    (%rdi),%r8b
mov    %edx,%ecx
not    %cl
or     %sil,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
not    %r8b
or     %al,%r8b
and    %r8b,%cl
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_125_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, -1
%7 = or i8 %4, %6
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
int get_next_index(int cur_index) {
  if (cur_index < (10 - 1))
    return (cur_index + 1);
  if (cur_index == (10 - 1))
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<get_next_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    111f <get_next_index+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113c <get_next_index+0x3c>
cmpl   $0x9,-0x8(%rbp)
jne    1135 <get_next_index+0x35>
movl   $0x0,-0x4(%rbp)
jmp    113c <get_next_index+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_index>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x9,%edi
setne  %al
neg    %eax
cmp    $0x9,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_next_index(i32 %0) {
%2 = icmp slt i32 %0, 9
%3 = add nsw i32 %0, 1
%4 = icmp ne i32 %0, 9
%5 = sext i1 %4 to i32
%6 = select i1 %2, i32 %3, i32 %5
ret i32 %6
}
float vec4_squaredLength(float *a) {
  float x = a[0];
  float y = a[1];
  float z = a[2];
  float w = a[3];
  return x * x + y * y + z * z + w * w;
}


x86 assembly (clang, -O0):
<vec4_squaredLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_squaredLength>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
movss  0x8(%rdi),%xmm3
movss  0xc(%rdi),%xmm0
mulss  %xmm2,%xmm2
mulss  %xmm1,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm3,%xmm3
addss  %xmm1,%xmm3
mulss  %xmm0,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @vec4_squaredLength(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float* %0, float** %2
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
store float %9, float* %3
%10 = load float*, float** %2
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
store float %12, float* %4
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 2
%15 = load float, float* %14
store float %15, float* %5
%16 = load float*, float** %2
%17 = getelementptr inbounds float, float* %16, i64 3
%18 = load float, float* %17
store float %18, float* %6
%19 = load float, float* %3
%20 = load float, float* %3
%21 = load float, float* %4
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = call float @llvm.fmuladd.f32(float %19, float %20, float %23)
%25 = load float, float* %5
%26 = load float, float* %5
%27 = call float @llvm.fmuladd.f32(float %25, float %26, float %24)
%28 = load float, float* %6
%29 = load float, float* %6
%30 = call float @llvm.fmuladd.f32(float %28, float %29, float %27)
ret float %30
}

LLVM IR (-O2):
define float @vec4_squaredLength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 3
%8 = load float, float* %7
%9 = fmul float %4, %4
%10 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %9)
%11 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %10)
%12 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %11)
ret float %12
}