xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ accept_payment_abort_returns_neg1(int *);
int /*<<< orphan*/ accept_payment_exact_change_returns_0(int *);
int /*<<< orphan*/ accept_payment_too_much_returns_5(int *);
int /*<<< orphan*/ printf(char *);
void accept_payment_tests(int stats[3]) {
  printf("Testing accept payment:\n");
  accept_payment_exact_change_returns_0(stats);
  accept_payment_too_much_returns_5(stats);
  accept_payment_abort_returns_neg1(stats);
  printf("\n");
}


x86 assembly (clang, -O0):
<accept_payment_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <accept_payment_exact_change_returns_0@plt>
mov    -0x8(%rbp),%rdi
call   1050 <accept_payment_too_much_returns_5@plt>
mov    -0x8(%rbp),%rdi
call   1030 <accept_payment_abort_returns_neg1@plt>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_payment_tests>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1070 <accept_payment_exact_change_returns_0@plt>
mov    %rbx,%rdi
call   1060 <accept_payment_too_much_returns_5@plt>
mov    %rbx,%rdi
call   1050 <accept_payment_abort_returns_neg1@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Testing accept payment:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @accept_payment_tests(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @accept_payment_exact_change_returns_0(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @accept_payment_too_much_returns_5(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @accept_payment_abort_returns_neg1(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Testing accept payment:\00"
define void @accept_payment_tests(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @accept_payment_exact_change_returns_0(i32* %0)
%4 = tail call i32 @accept_payment_too_much_returns_5(i32* %0)
%5 = tail call i32 @accept_payment_abort_returns_neg1(i32* %0)
%6 = tail call i32 @putchar(i32 10)
ret void
}
void rop3_243_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = T | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_243_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%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
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_243_1_1>:
mov    %edx,%eax
or     %sil,%al
not    %al
mov    (%rdi),%cl
and    %cl,%sil
or     %al,%sil
and    %dl,%cl
or     %sil,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_243_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
%9 = and i8 %6, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", fun(100));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *MemAlloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p) {
    fprintf(stderr, "***** Out of memory! *****\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<MemAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <MemAlloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemAlloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <MemAlloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define i8* @MemAlloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define noalias i8* @MemAlloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
void d2i_X509_bio(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ spi_transfer(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int);
void cc2k5_send_cmnd(uint8_t command) { spi_transfer(&command, NULL, 1); }


x86 assembly (clang, -O0):
<cc2k5_send_cmnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <spi_transfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc2k5_send_cmnd>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <spi_transfer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @cc2k5_send_cmnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @spi_transfer(i32* %2, i32* null, i32 1)
ret void
}

LLVM IR (-O2):
define void @cc2k5_send_cmnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @spi_transfer(i32* %2, i32* null, i32 1)
ret void
}
int make_int_16(int value) {
  return (value & 0x8000) ? value | ~0xffff : value & 0xffff;
}


x86 assembly (clang, -O0):
<make_int_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1128 <make_int_16+0x28>
mov    -0x4(%rbp),%eax
or     $0xffff0000,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <make_int_16+0x33>
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_int_16>:
movswl %di,%eax
movzwl %ax,%ecx
and    $0xffff0000,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @make_int_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, -65536
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = and i32 %10, 65535
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @make_int_16(i32 %0) {
%2 = and i32 %0, 32768
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 65535
%5 = select i1 %3, i32 0, i32 -65536
%6 = or i32 %5, %4
ret i32 %6
}
void baz_llong(long long *x) { *x = __imag foo_llong(5); }


x86 assembly (clang, -O0):
<baz_llong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_llong@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz_llong>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_llong@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @baz_llong(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_llong to i32 (i32, ...)*)(i32 5)
%4 = load i64*, i64** %2
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @baz_llong(i64* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_llong to i32 (i32, ...)*)(i32 5)
store i64 0, i64* %0
ret void
}
char get_bit(int i, char joint_type) {
  int bit = joint_type & (1 << (i));
  return bit ? 'r' : 't';
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x74,%eax
mov    $0x72,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
bt     %edi,%esi
setae  %al
add    %al,%al
add    $0x72,%al
ret

LLVM IR (-O0):
define signext i8 @get_bit(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = load i32, i32* %3
%9 = shl i32 1, %8
%10 = and i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 114, i32 116
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @get_bit(i32 %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = shl nuw i32 1, %0
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8 116, i8 114
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ net_send(int /*<<< orphan*/);
void net_send_string(unsigned char *s) {
  while (*s) {
    net_send(*s++);
  }
}


x86 assembly (clang, -O0):
<net_send_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <net_send_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <net_send@plt>
jmp    111c <net_send_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_send_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <net_send_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <net_send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <net_send_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @net_send_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = zext i8 %5 to i32
%9 = tail call i32 @net_send(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int f231(int *);
int f232(int *p) { return f231(p); }


x86 assembly (clang, -O0):
<f232>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f231@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f232>:
jmp    1030 <f231@plt>

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

LLVM IR (-O2):
define i32 @f232(i32* %0) {
%2 = tail call i32 @f231(i32* %0)
ret i32 %2
}
/* Variables and functions */
int number_mm();
int number_door(void) {
  int door;
  while ((door = number_mm() & (16 - 1)) > 9)
    ;
  return door;
}


x86 assembly (clang, -O0):
<number_door>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <number_mm@plt>
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x9,%eax
jle    1133 <number_door+0x23>
jmp    1118 <number_door+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_door>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <number_mm@plt>
and    $0xf,%eax
cmp    $0x9,%eax
ja     1120 <number_door+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @number_door() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @number_mm()
%3 = and i32 %2, 15
%4 = icmp ugt i32 %3, 9
br i1 %4, label %1, label %5
5: ; preds = %1
ret i32 %3
}
void *fn(void *x) { return x; }


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

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

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

LLVM IR (-O2):
define i8* @fn(i8* readnone returned %0) {
ret i8* %0
}
const char *filename_recode(const char *filename) { return filename; }


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

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

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

LLVM IR (-O2):
define i8* @filename_recode(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int link(char *, char *);
int /*<<< orphan*/ unlink(char *);
int Rename(char *oldname, char *newname) {
  int ret;
  unlink(newname);
  if (!(ret = link(oldname, newname)))
    unlink(oldname);
  return ret;
}


x86 assembly (clang, -O0):
<Rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <link@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    115b <Rename+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <unlink@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <link@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    114a <Rename+0x2a>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Rename(i8* %0, i8* %1) {
%3 = tail call i32 @unlink(i8* %1)
%4 = tail call i32 @link(i8* %0, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @unlink(i8* %0)
br label %8
8: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int startsWith(const char *str, const char *pre) {
  size_t lenpre = strlen(pre), lenstr = strlen(str);
  return lenstr < lenpre ? 0 : strncmp(pre, str, lenpre) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <startsWith+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     1161 <startsWith+0x41>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = call i64 @strncmp(i8* %16, i8* %17, i64 %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %15, %14
%23 = phi i32 [ 0, %14 ], [ %21, %15 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %1, i8* %0, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
void foo2a() {}


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

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

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

LLVM IR (-O2):
define void @foo2a() {
ret void
}
void putccc(unsigned char c) {
  while (!((*(volatile unsigned long *)0x50000010) & (1 << 2)))
    ;
  (*(volatile unsigned char *)0x50000020) = c;
}


x86 assembly (clang, -O0):
<putccc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50000010,%eax
mov    (%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <putccc+0x2c>
jmp    1131 <putccc+0x31>
jmp    110a <putccc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x50000020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putccc>:
testq  $0x4,0x50000010
je     1100 <putccc>
mov    %dil,0x50000020
50
ret

LLVM IR (-O0):
define void @putccc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%5 = and i64 %4, 4
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
store volatile i8 %10, i8* inttoptr (i64 1342177312 to i8*)
ret void
}

LLVM IR (-O2):
define void @putccc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%4 = and i64 %3, 4
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 1342177312 to i8*)
ret void
}
int is_leap_year(const int year) {
  if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1143 <is_leap_year+0x43>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap_year+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <is_leap_year+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <is_leap_year+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     1130 <is_leap_year+0x30>
test   $0x3,%dil
sete   %cl
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
setae  %al
and    %cl,%al
movzbl %al,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
%7 = srem i32 %0, 100
%8 = icmp ne i32 %7, 0
%9 = and i1 %6, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void fatal_out_of_memory() {
  fprintf(stderr, "elimination_step: could not assign memory for tag row\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"elimination_step: could not assign memory for tag row\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_out_of_memory() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"elimination_step: could not assign memory for tag row\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_out_of_memory() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __ecm_is_prime(unsigned long);
unsigned long __ecm_next_prime(const unsigned long n) {
  unsigned long m;
  if (n < 2UL)
    return 2UL;
  if (n == 2UL)
    return 3UL;
  m = n + 2UL;
  while (!__ecm_is_prime(m))
    m += 2UL;
  return m;
}


x86 assembly (clang, -O0):
<__ecm_next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jae    1134 <__ecm_next_prime+0x24>
movq   $0x2,-0x8(%rbp)
jmp    118f <__ecm_next_prime+0x7f>
cmpq   $0x2,-0x10(%rbp)
jne    114c <__ecm_next_prime+0x3c>
movq   $0x3,-0x8(%rbp)
jmp    118f <__ecm_next_prime+0x7f>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <__ecm_is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1176 <__ecm_next_prime+0x66>
jmp    1187 <__ecm_next_prime+0x77>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <__ecm_next_prime+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ecm_next_prime>:
push   %rbx
mov    $0x2,%ebx
cmp    $0x2,%rdi
jb     1140 <__ecm_next_prime+0x30>
mov    $0x3,%ebx
je     1140 <__ecm_next_prime+0x30>
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <__ecm_is_prime@plt>
test   %eax,%eax
je     1130 <__ecm_next_prime+0x20>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__ecm_next_prime(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 2, i64* %2
br label %25
8: ; preds = %1
%9 = load i64, i64* %3
%10 = icmp eq i64 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8
store i64 3, i64* %2
br label %25
12: ; preds = %8
%13 = load i64, i64* %3
%14 = add i64 %13, 2
store i64 %14, i64* %4
br label %15
15: ; preds = %20, %12
%16 = load i64, i64* %4
%17 = call i32 @__ecm_is_prime(i64 %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i64, i64* %4
%22 = add i64 %21, 2
store i64 %22, i64* %4
br label %15
23: ; preds = %15
%24 = load i64, i64* %4
store i64 %24, i64* %2
br label %25
25: ; preds = %23, %11, %7
%26 = load i64, i64* %2
ret i64 %26
}

LLVM IR (-O2):
define i64 @__ecm_next_prime(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp eq i64 %0, 2
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %7, %5 ], [ %0, %3 ]
%7 = add i64 %6, 2
%8 = tail call i32 @__ecm_is_prime(i64 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %3, %1
%11 = phi i64 [ 2, %1 ], [ 3, %3 ], [ %7, %5 ]
ret i64 %11
}
int test_imm_34int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x34 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_34int64_midword_mem>:
testb  $0x34,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_34int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 52
%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_34int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3407872
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_ENUMERATED;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ENUMERATED_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a,
                                     const unsigned char **in, long len) {
  return (ASN1_ENUMERATED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                          &ASN1_ENUMERATED_it);
}


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

x86 assembly (clang, -O2):
<d2i_ASN1_ENUMERATED>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_ENUMERATED_it = global i32 0
define i32* @d2i_ASN1_ENUMERATED(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_ENUMERATED_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_ENUMERATED_it = global i32 0
define i32* @d2i_ASN1_ENUMERATED(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_ENUMERATED_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int getInt() { return 141; }


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

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

LLVM IR (-O0):
define i32 @getInt() {
ret i32 141
}

LLVM IR (-O2):
define i32 @getInt() {
ret i32 141
}
/* Variables and functions */
int /*<<< orphan*/ inplace2(int *, int /*<<< orphan*/, int);
void qsort_inplace2(int *values, int n) { inplace2(values, 0, n - 1); }


x86 assembly (clang, -O0):
<qsort_inplace2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <inplace2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_inplace2>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <inplace2@plt>

LLVM IR (-O0):
define void @qsort_inplace2(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 = sub nsw i32 %6, 1
%8 = call i32 @inplace2(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @qsort_inplace2(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @inplace2(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int foo(float, double, float, double, float);
int main(void) {
  float f = 3.14f;
  double d = 2.71;
  return foo(f, d, 4.9f, 90.0, f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm4
movss  0xeb0(%rip),%xmm2
movsd  0xeb0(%rip),%xmm3
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movsd  0xee8(%rip),%xmm1
movss  0xef0(%rip),%xmm2
movsd  0xee0(%rip),%xmm3
movss  0xee4(%rip),%xmm0
movaps %xmm0,%xmm4
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
store i32 0, i32* %1
store float 0x40091EB860000000, float* %2
store double 2.710000e+00, double* %3
%4 = load float, float* %2
%5 = load double, double* %3
%6 = load float, float* %2
%7 = call i32 @foo(float %4, double %5, float 0x40139999A0000000, double 9.000000e+01, float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(float 0x40091EB860000000, double 2.710000e+00, float 0x40139999A0000000, double 9.000000e+01, float 0x40091EB860000000)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void deletechoices() {
  printf("\n\nYou have following choices\n\n\n");
  printf("1: \tTo delete any index no.\n");
  printf("2: \tTo delete any particular element.\n\n");
}


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

x86 assembly (clang, -O2):
<deletechoices>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0A\0AYou have following choices\0A\0A\0A\00"
@.str.1 = [29 x i8] c"1: \09To delete any index no.\0A\00"
@.str.2 = [40 x i8] c"2: \09To delete any particular element.\0A\0A\00"
define void @deletechoices() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"\0A\0AYou have following choices\0A\0A\00"
@str.3 = [28 x i8] c"1: \09To delete any index no.\00"
@str.4 = [39 x i8] c"2: \09To delete any particular element.\0A\00"
define void @deletechoices() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
ret void
}
int verify_benchmark(int nt) {
  int expected_negtotal = 396675;
  if (expected_negtotal != nt)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x60d83,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x60d83,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 396675
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned int getbe32(const unsigned char *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3] << 0);
}


x86 assembly (clang, -O0):
<getbe32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getbe32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void MT_init_redzone(void *address, unsigned long int size) {
  char *start = (char *)address + size - 4;
  strncpy(start, "xxxx", 4);
}


x86 assembly (clang, -O0):
<MT_init_redzone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_init_redzone>:
add    %rsi,%rdi
add    $0xfffffffffffffffc,%rdi
lea    0xee2(%rip),%rsi
mov    $0x4,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"xxxx\00"
define void @MT_init_redzone(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -4
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @strncpy(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"xxxx\00"
define void @MT_init_redzone(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = getelementptr inbounds i8, i8* %3, i64 -4
%5 = tail call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int gost_engine_finish(ENGINE *e) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @gost_engine_finish(i32* nocapture readnone %0) {
ret i32 1
}
imm0indreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    $0x16,%eax
cmp    (%rcx),%eax
ja     1135 <imm0indreg1+0x35>
movl   $0x1,-0x4(%rbp)
jmp    113c <imm0indreg1+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0indreg1>:
xor    %eax,%eax
cmpl   $0x16,(%r9)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @imm0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* %5
%8 = icmp ugt i32 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t _rnibble(uint8_t a) { return ((a >> 4) | (a << 4)); }


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

x86 assembly (clang, -O2):
<_rnibble>:
mov    %edi,%eax
sar    $0x4,%eax
shl    $0x4,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_rnibble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = load i32, i32* %2
%6 = shl i32 %5, 4
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @_rnibble(i32 %0) {
%2 = ashr i32 %0, 4
%3 = shl i32 %0, 4
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(int /*<<< orphan*/);
clock_t clock(void) { return times(0); }


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

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

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

LLVM IR (-O2):
define i32 @clock() {
%1 = tail call i32 @times(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Com_Quit();
void Client_Quit_f(void) { Com_Quit(); }


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

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

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

LLVM IR (-O2):
define void @Client_Quit_f() {
%1 = tail call i32 (...) @Com_Quit()
ret void
}
void gtk_check_menu_item_new_with_mnemonic() {}


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

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

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

LLVM IR (-O2):
define void @gtk_check_menu_item_new_with_mnemonic() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_system_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_system_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_system_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @get_system_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @get_system_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
void set_queen(char *p) { *p |= (1 << 4); }


x86 assembly (clang, -O0):
<set_queen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x10,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_queen>:
orb    $0x10,(%rdi)
ret

LLVM IR (-O0):
define void @set_queen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 16
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @set_queen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = or i8 %2, 16
store i8 %3, i8* %0
ret void
}