xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int A(int);
unsigned int B(int, int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned x = A(16);
  printf("0X%.8X\n", x);
  unsigned y = B(8, 8);
  printf("0X%.8X\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10,%edi
call   1050 <A@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%esi
mov    %esi,%edi
call   1030 <B@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10,%edi
call   1050 <A@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x8,%edi
mov    $0x8,%esi
call   1030 <B@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"0X%.8X\0A\00"
define i32 @main() {
%1 = tail call i32 @A(i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @B(i32 8, i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int res_dnok(dn) const char *dn;
{
  int ch;
  while ((ch = *dn++) != '\0')
    if (!((ch) > 0x20 && (ch) < 0x7f))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<res_dnok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114b <res_dnok+0x4b>
cmpl   $0x20,-0x14(%rbp)
jle    113a <res_dnok+0x3a>
cmpl   $0x7f,-0x14(%rbp)
jl     1146 <res_dnok+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1152 <res_dnok+0x52>
jmp    1108 <res_dnok+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_dnok>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <res_dnok+0x14>
add    $0x1,%rdi
add    $0xdf,%al
cmp    $0x5e,%al
jb     1100 <res_dnok>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @res_dnok(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = add i8 %4, -33
%9 = icmp ult i8 %8, 94
br i1 %9, label %2, label %10
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %11
}
int malvern_txt_parse_header(struct saxs_document *doc,
                             const struct line *firstline,
                             const struct line *lastline) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.saxs_document = type opaque
%struct.line = type opaque
define i32 @malvern_txt_parse_header(%struct.saxs_document* %0, %struct.line* %1, %struct.line* %2) {
%4 = alloca %struct.saxs_document*
%5 = alloca %struct.line*
%6 = alloca %struct.line*
store %struct.saxs_document* %0, %struct.saxs_document** %4
store %struct.line* %1, %struct.line** %5
store %struct.line* %2, %struct.line** %6
ret i32 0
}

LLVM IR (-O2):
%struct.saxs_document = type opaque
%struct.line = type opaque
define i32 @malvern_txt_parse_header(%struct.saxs_document* nocapture readnone %0, %struct.line* nocapture readnone %1, %struct.line* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
char const *jsonq_internal(char const *, int /*<<< orphan*/ *, char *, int, int,
                           char *, int);
const char *jsonqi(const char *s, int idx, char *nambuf, int namlen,
                   char *dstbuf, int dstlen) {
  return jsonq_internal(s, NULL, dstbuf, dstlen, idx, nambuf, namlen);
}


x86 assembly (clang, -O0):
<jsonqi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    -0x1c(%rbp),%eax
xor    %esi,%esi
mov    %eax,(%rsp)
call   1030 <jsonq_internal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonqi>:
push   %rax
mov    %rdx,%r10
mov    %esi,%eax
mov    %ecx,(%rsp)
xor    %esi,%esi
mov    %r8,%rdx
mov    %r9d,%ecx
mov    %eax,%r8d
mov    %r10,%r9
call   1030 <jsonq_internal@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @jsonqi(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = tail call i8* @jsonq_internal(i8* %0, i32* null, i8* %4, i32 %5, i32 %1, i8* %2, i32 %3)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M322_f(char *s) {
  debug("M322_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M322_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M322_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M322_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M322_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M322_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M322_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
size_t mpz_sizeinbase(int /*<<< orphan*/, int);
extern ulong mpz_bitsize(mpz_t z) {
  size_t s = mpz_sizeinbase(z, 2);
  return (ulong)s;
}


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

x86 assembly (clang, -O2):
<mpz_bitsize>:
mov    $0x2,%esi
jmp    1030 <mpz_sizeinbase@plt>

LLVM IR (-O0):
define i32 @mpz_bitsize(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @mpz_sizeinbase(i32 %4, i32 2)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @mpz_bitsize(i32 %0) {
%2 = tail call i64 @mpz_sizeinbase(i32 %0, i32 2)
%3 = trunc i64 %2 to i32
ret i32 %3
}
char uart_getc() {
  unsigned char lsr;
  char c;
  do {
    lsr = *((volatile unsigned char *)(0x90000000 + 5));
  } while ((lsr & 0x01) != 0x01);
  c = *((volatile unsigned char *)(0x90000000 + 0));
  return c;
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90000005,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1104 <uart_getc+0x4>
mov    $0x90000000,%eax
mov    (%rax),%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
mov    $0x90000000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x1,0x5(%rax)
je     1110 <uart_getc+0x10>
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @uart_getc() {
%1 = alloca i8
%2 = alloca i8
br label %3
3: ; preds = %5, %0
%4 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
store i8 %4, i8* %1
br label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 1
br i1 %9, label %3, label %10
10: ; preds = %5
%11 = load volatile i8, i8* inttoptr (i64 2415919104 to i8*)
store i8 %11, i8* %2
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 2415919104 to i8*)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char const *, char const *);
char *lastStrStr(const char *s1, const char *s2) {
  char *pos;
  while (strstr(s1, s2) != NULL) {
    pos = (char *)s1;
    s1++;
  }
  return pos;
}


x86 assembly (clang, -O0):
<lastStrStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1150 <lastStrStr+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <lastStrStr+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastStrStr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r15
mov    %rdi,%rbx
mov    %r14,%rsi
call   1030 <strstr@plt>
lea    0x1(%rbx),%rdi
test   %rax,%rax
jne    1120 <lastStrStr+0x10>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @lastStrStr(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ undef, %2 ], [ %4, %3 ]
%6 = tail call i32* @strstr(i8* dereferenceable(1) %4, i8* dereferenceable(1) %1)
%7 = icmp eq i32* %6, null
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct covert_tracker {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ extractNBitFromBuffer(struct covert_tracker *, int,
                                         int /*<<< orphan*/ *, int);
uint64_t addData(uint64_t payload, int NBits, int shiftBits,
                 struct covert_tracker *tx_covert) {
  extractNBitFromBuffer(tx_covert, NBits, &payload, shiftBits);
  return payload;
}


x86 assembly (clang, -O0):
<addData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    -0x4(%rbp),%rdx
call   1030 <extractNBitFromBuffer@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addData>:
push   %rax
mov    %edx,%eax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %rcx,%rdi
mov    %eax,%ecx
call   1030 <extractNBitFromBuffer@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.covert_tracker = type { i32 }
define i32 @addData(i32 %0, i32 %1, i32 %2, %struct.covert_tracker* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.covert_tracker*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.covert_tracker* %3, %struct.covert_tracker** %8
%9 = load %struct.covert_tracker*, %struct.covert_tracker** %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @extractNBitFromBuffer(%struct.covert_tracker* %9, i32 %10, i32* %5, i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.covert_tracker = type { i32 }
define i32 @addData(i32 %0, i32 %1, i32 %2, %struct.covert_tracker* %3) {
%5 = alloca i32
store i32 %0, i32* %5
%6 = call i32 @extractNBitFromBuffer(%struct.covert_tracker* %3, i32 %1, i32* %5, i32 %2)
%7 = load i32, i32* %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, long);
int print(double ee) {
  printf("val\t%-8.8g\t0x%-8lx\n", ee, (long)ee);
  return (0);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"val\09%-8.8g\090x%-8lx\0A\00"
define i32 @print(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %3, i64 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"val\09%-8.8g\090x%-8lx\0A\00"
define i32 @print(double %0) {
%2 = fptosi double %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %0, i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void errorHandler(char errorText[]) {
  fprintf(stderr, "\nERROR: %s\n", errorText);
  fprintf(stderr, "*** PROGRAM TERMINATED ***\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<errorHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errorHandler>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"\0AERROR: %s\0A\00"
@.str.1 = [29 x i8] c"*** PROGRAM TERMINATED ***\0A\0A\00"
define void @errorHandler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"\0AERROR: %s\0A\00"
@.str.1 = [29 x i8] c"*** PROGRAM TERMINATED ***\0A\0A\00"
define void @errorHandler(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((gnu_)) __attribute__((always_)) int func1(int x) {
  return x * 23;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x17,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
lea    (%rdi,%rdi,2),%eax
shl    $0x3,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @func1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 23
ret i32 %4
}

LLVM IR (-O2):
define i32 @func1(i32 %0) {
%2 = mul nsw i32 %0, 23
ret i32 %2
}
/* Type definitions */
struct RSAKey {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freersakey(struct RSAKey *);
int /*<<< orphan*/ safefree(struct RSAKey *);
void rsa2_freekey(void *key) {
  struct RSAKey *rsa = (struct RSAKey *)key;
  freersakey(rsa);
  safefree(rsa);
}


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

x86 assembly (clang, -O2):
<rsa2_freekey>:
push   %rbx
mov    %rdi,%rbx
call   1040 <freersakey@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <safefree@plt>

LLVM IR (-O0):
%struct.RSAKey = type { i32 }
define void @rsa2_freekey(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.RSAKey*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.RSAKey*
store %struct.RSAKey* %5, %struct.RSAKey** %3
%6 = load %struct.RSAKey*, %struct.RSAKey** %3
%7 = call i32 @freersakey(%struct.RSAKey* %6)
%8 = load %struct.RSAKey*, %struct.RSAKey** %3
%9 = call i32 @safefree(%struct.RSAKey* %8)
ret void
}

LLVM IR (-O2):
%struct.RSAKey = type { i32 }
define void @rsa2_freekey(i8* %0) {
%2 = bitcast i8* %0 to %struct.RSAKey*
%3 = tail call i32 @freersakey(%struct.RSAKey* %2)
%4 = tail call i32 @safefree(%struct.RSAKey* %2)
ret void
}
void eglDestroySurface(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglDestroySurface() {
ret void
}
/* Variables and functions */
scalar_t__ checkSO();
int /*<<< orphan*/ system(char *);
void pause() {
  if (checkSO())
    system("pause");
  else
    system("read -p \"	Pressione <ENTER> para continuar\" saindo");
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <checkSO@plt>
cmp    $0x0,%rax
je     1146 <pause+0x26>
lea    0xec4(%rip),%rdi
call   1030 <system@plt>
jmp    1152 <pause+0x32>
lea    0xeb9(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
xor    %eax,%eax
call   1040 <checkSO@plt>
test   %rax,%rax
lea    0xed4(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
@.str.1 = [51 x i8] c"read -p \22\09Pressione <ENTER> para continuar\22 saindo\00"
define void @pause() {
%1 = call i64 (...) @checkSO()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
@.str.1 = [51 x i8] c"read -p \22\09Pressione <ENTER> para continuar\22 saindo\00"
define void @pause() {
%1 = tail call i64 (...) @checkSO()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @system(i8* %3)
ret void
}
OP(dd, b9) {
  illegal_1();
  op_b9();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_b9@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b9@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b9()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b9()
ret i32 undef
}
unsigned xrop3_252_0_0(unsigned char s, unsigned char t) {
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T | S;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_252_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_252_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
ret i32 %7
}
/* Type definitions */
struct VectorBase {
  int dummy;
};
struct QuerySegment {
  int dummy;
};

/* Variables and functions */
struct VectorBase *GetQuerySegmentVector(struct QuerySegment *, char const *);
struct VectorBase *qu_vector_result(struct QuerySegment *handle,
                                    const char *code) {
  return GetQuerySegmentVector(handle, code);
}


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

x86 assembly (clang, -O2):
<qu_vector_result>:
jmp    1030 <GetQuerySegmentVector@plt>

LLVM IR (-O0):
%struct.VectorBase = type { i32 }
%struct.QuerySegment = type { i32 }
define %struct.VectorBase* @qu_vector_result(%struct.QuerySegment* %0, i8* %1) {
%3 = alloca %struct.QuerySegment*
%4 = alloca i8*
store %struct.QuerySegment* %0, %struct.QuerySegment** %3
store i8* %1, i8** %4
%5 = load %struct.QuerySegment*, %struct.QuerySegment** %3
%6 = load i8*, i8** %4
%7 = call %struct.VectorBase* @GetQuerySegmentVector(%struct.QuerySegment* %5, i8* %6)
ret %struct.VectorBase* %7
}

LLVM IR (-O2):
%struct.VectorBase = type { i32 }
%struct.QuerySegment = type { i32 }
define %struct.VectorBase* @qu_vector_result(%struct.QuerySegment* %0, i8* %1) {
%3 = tail call %struct.VectorBase* @GetQuerySegmentVector(%struct.QuerySegment* %0, i8* %1)
ret %struct.VectorBase* %3
}
signed long signedlong_ignoring_signedlong(signed long x, signed long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlong_ignoring_signedlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
void sds_free(void *);
void cma_free(void *buf) { return sds_free(buf); }


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

x86 assembly (clang, -O2):
<cma_free>:
jmp    1030 <sds_free@plt>

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

LLVM IR (-O2):
define void @cma_free(i8* %0) {
tail call void @sds_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void quack2(void) { foo(4); }


x86 assembly (clang, -O0):
<quack2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quack2>:
mov    $0x4,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @quack2() {
%1 = call i32 @foo(i32 4)
ret void
}

LLVM IR (-O2):
define void @quack2() {
%1 = tail call i32 @foo(i32 4)
ret void
}
/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  long total = 0;
  for (int i = 2; i < 2000000; i++) {
    if (isPrime(i)) {
      total += i;
    }
  }
  printf("%ld\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0x1e8480,-0x14(%rbp)
jge    117c <main+0x5c>
mov    -0x14(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116e <main+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %ebx,%edi
call   1040 <isPrime@plt>
test   %rax,%rax
cmovne %rbx,%rax
add    %rax,%r14
add    $0x1,%rbx
cmp    $0x1e8480,%rbx
jne    1130 <main+0x10>
lea    0xeab(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i64 [ 2, %0 ], [ %11, %3 ]
%5 = phi i64 [ 0, %0 ], [ %10, %3 ]
%6 = trunc i64 %4 to i32
%7 = tail call i64 @isPrime(i32 %6)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i64 0, i64 %4
%10 = add nuw nsw i64 %9, %5
%11 = add nuw nsw i64 %4, 1
%12 = icmp eq i64 %11, 2000000
br i1 %12, label %1, label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_puts64() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_puts64"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_tagstruct_puts64\0A\00"
define i32 @pa_tagstruct_puts64() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_tagstruct_puts64\00"
define i32 @pa_tagstruct_puts64() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
float lookup(int);
float point_color(int point_number) {
  float correction;
  extern float red, green, blue;
  correction = lookup(point_number);
  return (red * correction * 100.0 + blue * correction * 10.0 +
          green * correction);
}


x86 assembly (clang, -O0):
<point_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lookup@plt>
movss  %xmm0,-0x8(%rbp)
mov    0x2ea1(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2ea5(%rip),%rax
movss  (%rax),%xmm1
mulss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb0(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2e65(%rip),%rax
movss  (%rax),%xmm1
mulss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_color>:
push   %rax
call   1030 <lookup@plt>
mov    0x2eb3(%rip),%rax
movss  (%rax),%xmm1
mulss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
mov    0x2eb8(%rip),%rax
movss  (%rax),%xmm2
mulss  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xebc(%rip),%xmm2
mulsd  0xebc(%rip),%xmm1
addsd  %xmm2,%xmm1
mov    0x2e81(%rip),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@red = external global float
@blue = external global float
@green = external global float
define float @point_color(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call float @lookup(i32 %4)
store float %5, float* %3
%6 = load float, float* @red
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = fpext float %8 to double
%10 = load float, float* @blue
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = fpext float %12 to double
%14 = fmul double %13, 1.000000e+01
%15 = call double @llvm.fmuladd.f64(double %9, double 1.000000e+02, double %14)
%16 = load float, float* @green
%17 = load float, float* %3
%18 = fmul float %16, %17
%19 = fpext float %18 to double
%20 = fadd double %15, %19
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
@red = external global float
@blue = external global float
@green = external global float
define float @point_color(i32 %0) {
%2 = tail call float @lookup(i32 %0)
%3 = load float, float* @red
%4 = fmul float %2, %3
%5 = fpext float %4 to double
%6 = load float, float* @blue
%7 = fmul float %2, %6
%8 = fpext float %7 to double
%9 = fmul double %8, 1.000000e+01
%10 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e+02, double %9)
%11 = load float, float* @green
%12 = fmul float %2, %11
%13 = fpext float %12 to double
%14 = fadd double %10, %13
%15 = fptrunc double %14 to float
ret float %15
}
void gc_init(void **stkbtm) { (void)stkbtm; }


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

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

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

LLVM IR (-O2):
define void @gc_init(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (1) {
    int old_x = x;
    x = -y;
    y = old_x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
nop
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
br label %7
7: ; preds = %0, %7
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %3
3: ; preds = %3, %0
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ ds_set_boolean(int /*<<< orphan*/, int, int);
void snmp_set_random_access(int x) { ds_set_boolean(0, 14, x); }


x86 assembly (clang, -O0):
<snmp_set_random_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0xe,%esi
call   1030 <ds_set_boolean@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snmp_set_random_access>:
mov    %edi,%edx
xor    %edi,%edi
mov    $0xe,%esi
jmp    1030 <ds_set_boolean@plt>

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

LLVM IR (-O2):
define void @snmp_set_random_access(i32 %0) {
%2 = tail call i32 @ds_set_boolean(i32 0, i32 14, i32 %0)
ret void
}
unsigned setbits(unsigned x, int p, int n, unsigned y) {
  return ((~(~0 << n) << (p + 1 - n)) | x) &
         (~(~(~0 << n) << (p + 1 - n)) | y << (p + 1 - n));
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
or     %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%eax
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
sub    %ecx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%edx
shl    %cl,%eax
or     %edx,%edi
not    %edx
or     %edx,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = shl i32 -1, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %7
%15 = sub nsw i32 %13, %14
%16 = shl i32 %11, %15
%17 = load i32, i32* %5
%18 = or i32 %16, %17
%19 = load i32, i32* %7
%20 = shl i32 -1, %19
%21 = xor i32 %20, -1
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %7
%25 = sub nsw i32 %23, %24
%26 = shl i32 %21, %25
%27 = xor i32 %26, -1
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
%31 = load i32, i32* %7
%32 = sub nsw i32 %30, %31
%33 = shl i32 %28, %32
%34 = or i32 %27, %33
%35 = and i32 %18, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = add nsw i32 %1, 1
%8 = sub i32 %7, %2
%9 = shl i32 %6, %8
%10 = or i32 %9, %0
%11 = xor i32 %9, -1
%12 = shl i32 %3, %8
%13 = or i32 %12, %11
%14 = and i32 %10, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void textcolor(int color) {
  char command[13];
  sprintf(command, "\e[%dm", color);
  printf("%s", command);
}


x86 assembly (clang, -O0):
<textcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x11(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x11(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcolor>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @textcolor(i32 %0) {
%2 = alloca i32
%3 = alloca [13 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @textcolor(i32 %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int power(int, int);
int valueToUnary(int value) { return power(2, (value % 8)) - 1; }


x86 assembly (clang, -O0):
<valueToUnary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    $0x2,%edi
call   1030 <power@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueToUnary>:
push   %rax
mov    %edi,%esi
lea    0x7(%rsi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
sub    %eax,%esi
mov    $0x2,%edi
call   1030 <power@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @valueToUnary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 8
%5 = call i32 @power(i32 2, i32 %4)
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @valueToUnary(i32 %0) {
%2 = srem i32 %0, 8
%3 = tail call i32 @power(i32 2, i32 %2)
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int module_dummy_init(Display *display) {
  (void)display;
  do {
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<module_dummy_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <module_dummy_init+0xd>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @module_dummy_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @module_dummy_init(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XCreateIC() {
  printf("XCreateIC called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"XCreateIC called\0A\00"
define i32 @XCreateIC() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"XCreateIC called\00"
define i32 @XCreateIC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int do_484() { return 484; }


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

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

LLVM IR (-O0):
define i32 @do_484() {
ret i32 484
}

LLVM IR (-O2):
define i32 @do_484() {
ret i32 484
}
/* Variables and functions */
double strtod(char const *, char **);
double gp_strtod(const char *str, char **endptr) { return strtod(str, endptr); }


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

x86 assembly (clang, -O2):
<gp_strtod>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @gp_strtod(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call double @strtod(i8* %5, i8** %6)
ret double %7
}

LLVM IR (-O2):
define double @gp_strtod(i8* %0, i8** nocapture %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
ret double %3
}
int Point_GetHashCode(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Point_GetHashCode() {
ret i32 0
}
int dequeue(int Q[], int *head, int *tail, int size) {
  int res;
  res = Q[*head];
  if (*head == *tail)
    res = 0;
  if (*head == size - 1)
    *head = 0;
  else
    (*head)++;
  return res;
}


x86 assembly (clang, -O0):
<dequeue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    113d <dequeue+0x3d>
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1160 <dequeue+0x60>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    116b <dequeue+0x6b>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequeue>:
movslq (%rsi),%r8
add    $0xffffffff,%ecx
lea    0x1(%r8),%r9d
xor    %eax,%eax
cmp    %ecx,%r8d
cmove  %eax,%r9d
cmp    (%rdx),%r8d
je     111c <dequeue+0x1c>
mov    (%rdi,%r8,4),%eax
mov    %r9d,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @dequeue(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = load i32, i32* %2
%10 = add nsw i32 %3, -1
%11 = icmp eq i32 %5, %10
%12 = add nsw i32 %5, 1
%13 = select i1 %11, i32 0, i32 %12
store i32 %13, i32* %1
%14 = icmp eq i32 %5, %9
%15 = select i1 %14, i32 0, i32 %8
ret i32 %15
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int lstat(char const *, struct stat *);
int xlstat(const char *pathname, struct stat *statbuf) {
  return lstat(pathname, statbuf);
}


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

x86 assembly (clang, -O2):
<xlstat>:
jmp    1030 <lstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @xlstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @lstat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @xlstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @lstat(i8* %0, %struct.stat* %1)
ret i32 %3
}