xunge/DecIR huggingface dataset:
unsigned short int cast_char_ushort_fast(char x) {
  return (unsigned short int)x;
}


x86 assembly (clang, -O0):
<cast_char_ushort_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_char_ushort_fast>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @cast_char_ushort_fast(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @cast_char_ushort_fast(i8 signext %0) {
%2 = sext i8 %0 to i16
ret i16 %2
}
/* Variables and functions */
int rand();
int RandInt(int min, int max) { return rand() % (max - min + 1) + min; }


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

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

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

LLVM IR (-O2):
define i32 @RandInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sc_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<sc_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sc_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void dl_G_RDPSETOTHERMODE() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_RDPSETOTHERMODE() {
ret void
}
int ascending(const void *p, const void *q) {
  return (*(double *)p - *(double *)q);
}


x86 assembly (clang, -O0):
<ascending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascending>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @ascending(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ascending(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printUsage(const char *prog) {
  printf("%s <quantum> <P1_burst_time ... P5_burst_time>\n", prog);
  printf("Examples:\n");
  printf("$ %s 2 10 13 5 7 1\n", prog);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"%s <quantum> <P1_burst_time ... P5_burst_time>\0A\00"
@.str.1 = [11 x i8] c"Examples:\0A\00"
@.str.2 = [20 x i8] c"$ %s 2 10 13 5 7 1\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"%s <quantum> <P1_burst_time ... P5_burst_time>\0A\00"
@.str.2 = [20 x i8] c"$ %s 2 10 13 5 7 1\0A\00"
@str = [10 x i8] c"Examples:\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *strchr(char *, char);
int read_till_nl(FILE *in) {
  char buf[4 + 1];
  do {
    if (!fgets(buf, 4, in))
      return 0;
  } while (strchr(buf, '\n') == NULL);
  return 1;
}


x86 assembly (clang, -O0):
<read_till_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x15(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x4,%esi
call   1040 <fgets@plt>
cmp    $0x0,%eax
jne    1153 <read_till_nl+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1177 <read_till_nl+0x57>
jmp    1158 <read_till_nl+0x38>
lea    -0x15(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     112c <read_till_nl+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_till_nl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x3(%rsp),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
test   %eax,%eax
je     115d <read_till_nl+0x3d>
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1130 <read_till_nl+0x10>
mov    $0x1,%eax
jmp    115f <read_till_nl+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @read_till_nl(i32* nocapture %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %7, %1
%5 = call i32 @fgets(i8* %3, i32 4, i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i32* @strchr(i8* %3, i8 signext 10)
%9 = icmp eq i32* %8, null
br i1 %9, label %4, label %10
10: ; preds = %7, %4
%11 = phi i32 [ 0, %4 ], [ 1, %7 ]
ret i32 %11
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
struct buf *buf_unbox(void *);
int /*<<< orphan*/ free(struct buf *);
void _buf_free(void **_buf) {
  struct buf *buf = buf_unbox(*_buf);
  if (buf) {
    free(buf);
    *_buf = NULL;
  }
}


x86 assembly (clang, -O0):
<_buf_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <buf_unbox@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <_buf_free+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_buf_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <buf_unbox@plt>
test   %rax,%rax
je     1140 <_buf_free+0x20>
mov    %rax,%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.buf = type { i32 }
define void @_buf_free(i8** %0) {
%2 = alloca i8**
%3 = alloca %struct.buf*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call %struct.buf* @buf_unbox(i8* %5)
store %struct.buf* %6, %struct.buf** %3
%7 = load %struct.buf*, %struct.buf** %3
%8 = icmp ne %struct.buf* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load %struct.buf*, %struct.buf** %3
%11 = call i32 @free(%struct.buf* %10)
%12 = load i8**, i8*** %2
store i8* null, i8** %12
br label %13
13: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define void @_buf_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call %struct.buf* @buf_unbox(i8* %2)
%4 = icmp eq %struct.buf* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(%struct.buf* %3)
store i8* null, i8** %0
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int log(int const);
double HQ(const double lk, const int k, const int n) {
  return -2 * lk + 2 * k * log(log(n));
}


x86 assembly (clang, -O0):
<HQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <log@plt>
mov    %eax,%edi
call   1030 <log@plt>
movsd  -0x20(%rbp),%xmm1
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HQ>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
mov    %esi,%edi
call   1030 <log@plt>
mov    %eax,%edi
call   1030 <log@plt>
imul   %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @HQ(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %6
%11 = call i32 @log(i32 %10)
%12 = call i32 @log(i32 %11)
%13 = mul nsw i32 %9, %12
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %7, double %14)
ret double %15
}

LLVM IR (-O2):
define double @HQ(double %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 1
%5 = tail call i32 @log(i32 %2)
%6 = tail call i32 @log(i32 %5)
%7 = mul nsw i32 %4, %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %8)
ret double %9
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank6(int);
void m33setParamsAXX2(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank6(val << 10);
}


x86 assembly (clang, -O0):
<m33setParamsAXX2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank6@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m33setParamsAXX2>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank6@plt>

LLVM IR (-O0):
define void @m33setParamsAXX2(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank6(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m33setParamsAXX2(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank6(i32 %3)
ret void
}
/* Variables and functions */
unsigned int xstrtoull_range(char const *, int, unsigned int, unsigned int);
unsigned int xstrtou_range(const char *str, int b, unsigned int l,
                           unsigned int u) {
  return xstrtoull_range(str, b, l, u);
}


x86 assembly (clang, -O0):
<xstrtou_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <xstrtoull_range@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtou_range>:
jmp    1030 <xstrtoull_range@plt>

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

LLVM IR (-O2):
define i32 @xstrtou_range(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @xstrtoull_range(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int find_seq(int /*<<< orphan*/);
int find_seq2(int /*<<< orphan*/);
int test_all_bits_zero() { return 1 == find_seq(0) && 1 == find_seq2(0); }


x86 assembly (clang, -O0):
<test_all_bits_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <find_seq@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1159 <test_all_bits_zero+0x39>
xor    %edi,%edi
call   1030 <find_seq2@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_bits_zero>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <find_seq@plt>
cmp    $0x1,%eax
jne    113e <test_all_bits_zero+0x1e>
xor    %edi,%edi
call   1030 <find_seq2@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_all_bits_zero() {
%1 = call i32 @find_seq(i32 0)
%2 = icmp eq i32 1, %1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @find_seq2(i32 0)
%5 = icmp eq i32 1, %4
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_all_bits_zero() {
%1 = tail call i32 @find_seq(i32 0)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @find_seq2(i32 0)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("yo\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"yo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void call_m32(void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0xFF);
  put8(0x15);
  put32((unsigned long)(m32));
}


x86 assembly (clang, -O0):
<call_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0xff,%edi
call   1030 <put8@plt>
mov    $0x15,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_m32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%edi
call   1030 <put8@plt>
mov    $0x15,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @call_m32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = call i32 @put8(i32 255)
%7 = call i32 @put8(i32 21)
%8 = load i64*, i64** %3
%9 = ptrtoint i64* %8 to i64
%10 = call i32 @put32(i64 %9)
ret void
}

LLVM IR (-O2):
define void @call_m32(i8* %0) {
%2 = tail call i32 @put8(i32 255)
%3 = tail call i32 @put8(i32 21)
%4 = ptrtoint i8* %0 to i64
%5 = tail call i32 @put32(i64 %4)
ret void
}
unsigned int max(unsigned int a, unsigned int b) {
  if (a >= b) {
    return a;
  } else {
    return b;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int BIO_write(int /*<<< orphan*/ *, char const *, size_t);
int print_bio(const char *str, size_t len, void *b) {
  return BIO_write((BIO *)b, str, len);
}


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

x86 assembly (clang, -O2):
<print_bio>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <BIO_write@plt>

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

LLVM IR (-O2):
define i32 @print_bio(i8* %0, i64 %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @BIO_write(i32* %4, i8* %0, i64 %1)
ret i32 %5
}
/* Variables and functions */
size_t base_encode_chunk_sz(int bits) {
  size_t chunk_sz = 0;
  if (bits > 0) {
    chunk_sz = 1;
    while (((chunk_sz * bits) % 8) != 0) {
      chunk_sz++;
    }
    chunk_sz--;
  }
  return chunk_sz;
}


x86 assembly (clang, -O0):
<base_encode_chunk_sz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1158 <base_encode_chunk_sz+0x58>
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
and    $0x7,%rax
cmp    $0x0,%rax
je     114c <base_encode_chunk_sz+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1121 <base_encode_chunk_sz+0x21>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_encode_chunk_sz>:
test   %edi,%edi
jle    1130 <base_encode_chunk_sz+0x30>
mov    %edi,%ecx
mov    $0xffffffffffffffff,%rax
mov    %rcx,%rdx
mov    %rcx,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
add    %rcx,%rsi
test   $0x7,%dl
mov    %rsi,%rdx
jne    1120 <base_encode_chunk_sz+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @base_encode_chunk_sz(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %10, %5 ], [ 1, %3 ]
%7 = mul i64 %6, %4
%8 = and i64 %7, 7
%9 = icmp eq i64 %8, 0
%10 = add i64 %6, 1
br i1 %9, label %11, label %5
11: ; preds = %5
%12 = add i64 %6, -1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ %12, %11 ], [ 0, %1 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ handle_tag_end(char *);
int /*<<< orphan*/ handle_tag_start(char *);
void handle_tag(char *tag) {
  if (tag[0] == '/') {
    tag++;
    handle_tag_end(tag);
  } else
    handle_tag_start(tag);
}


x86 assembly (clang, -O0):
<handle_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1156 <handle_tag+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <handle_tag_end@plt>
jmp    115f <handle_tag+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <handle_tag_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_tag>:
cmpb   $0x2f,(%rdi)
jne    112e <handle_tag+0xe>
add    $0x1,%rdi
jmp    1030 <handle_tag_end@plt>
jmp    1040 <handle_tag_start@plt>

LLVM IR (-O0):
define void @handle_tag(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @handle_tag_end(i8* %11)
br label %16
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i32 @handle_tag_start(i8* %14)
br label %16
16: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
define void @handle_tag(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @handle_tag_end(i8* %5)
br label %9
7: ; preds = %1
%8 = tail call i32 @handle_tag_start(i8* %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  printf("%d", (b * b - 4 * a * c) / (2 * a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
imul   %eax,%eax
mov    0x14(%rsp),%ecx
mov    0xc(%rsp),%edx
imul   %ecx,%edx
shl    $0x2,%edx
sub    %edx,%eax
add    %ecx,%ecx
cltd
idiv   %ecx
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %8
%10 = load i32, i32* %1
%11 = mul i32 %10, -4
%12 = load i32, i32* %3
%13 = mul i32 %11, %12
%14 = add i32 %13, %9
%15 = shl nsw i32 %10, 1
%16 = sdiv i32 %14, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ vmcontinue(int);
void power_continue() {
  int id;
  scanf("%d", &id);
  if (vmcontinue(id)) {
    printf("ok\n");
  } else {
    printf("error\n");
  }
}


x86 assembly (clang, -O0):
<power_continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <vmcontinue@plt>
cmp    $0x0,%rax
je     116b <power_continue+0x3b>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <power_continue+0x47>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_continue>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <vmcontinue@plt>
test   %rax,%rax
lea    0xeae(%rip),%rax
lea    0xead(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"ok\0A\00"
@.str.2 = [7 x i8] c"error\0A\00"
define void @power_continue() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = call i64 @vmcontinue(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"error\00"
@str.3 = [3 x i8] c"ok\00"
define void @power_continue() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @vmcontinue(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmCeil3f(float *, float *);
void glmCeil3f_(float x[3]) { glmCeil3f(x, x); }


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

x86 assembly (clang, -O2):
<glmCeil3f_>:
mov    %rdi,%rsi
jmp    1030 <glmCeil3f@plt>

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

LLVM IR (-O2):
define void @glmCeil3f_(float* %0) {
%2 = tail call i32 @glmCeil3f(float* %0, float* %0)
ret void
}
/* Type definitions */
struct pane {
  int dummy;
};

/* Variables and functions */
char *memsave(struct pane *, char const *, int);
char *strnsave(struct pane *p, const char *buf, int len) {
  char *s;
  if (!buf)
    return NULL;
  s = memsave(p, buf, len + 1);
  if (s)
    s[len] = 0;
  return s;
}


x86 assembly (clang, -O0):
<strnsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113b <strnsave+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1171 <strnsave+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
call   1030 <memsave@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1169 <strnsave+0x59>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnsave>:
push   %rbx
test   %rsi,%rsi
je     112e <strnsave+0x1e>
mov    %edx,%ebx
lea    0x1(%rbx),%edx
call   1030 <memsave@plt>
test   %rax,%rax
je     112e <strnsave+0x1e>
movslq %ebx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.pane = type { i32 }
define i8* @strnsave(%struct.pane* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = add nsw i32 %2, 1
%7 = tail call i8* @memsave(%struct.pane* %0, i8* %1, i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %5, %9, %3
%13 = phi i8* [ null, %3 ], [ %7, %9 ], [ null, %5 ]
ret i8* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int);
void checked_wait(pthread_cond_t *c, pthread_mutex_t *m) {
  int err = pthread_cond_wait(c, m);
  if (err != 0) {
    errx(1, "Failed to wait for a condition variable: %s", strerror(err));
  }
}


x86 assembly (clang, -O0):
<checked_wait>:
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 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1175 <checked_wait+0x45>
mov    -0x14(%rbp),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe90(%rip),%rsi
call   1040 <errx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_wait>:
push   %rax
call   1030 <pthread_cond_wait@plt>
test   %eax,%eax
je     1155 <checked_wait+0x25>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1040 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Failed to wait for a condition variable: %s\00"
define void @checked_wait(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @pthread_cond_wait(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @errx(i32 1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Failed to wait for a condition variable: %s\00"
define void @checked_wait(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strerror(i32 %3)
%7 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
char *malloc(int);
int entrypoint() {
  const char *x = malloc(1024 * 1024 * 1024);
  if (x)
    return 0;
  return *x;
}


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40000000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113d <entrypoint+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1147 <entrypoint+0x37>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @entrypoint() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @malloc(i32 1073741824)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %11
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @entrypoint() {
ret i32 0
}
void gtk_tree_view_column_get_clickable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_clickable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AT_cleanupGC();
int /*<<< orphan*/ AT_cleanupMemory();
void AT_cleanup(void) {
  AT_cleanupGC();
  AT_cleanupMemory();
}


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

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

LLVM IR (-O0):
define void @AT_cleanup() {
%1 = call i32 (...) @AT_cleanupGC()
%2 = call i32 (...) @AT_cleanupMemory()
ret void
}

LLVM IR (-O2):
define void @AT_cleanup() {
%1 = tail call i32 (...) @AT_cleanupGC()
%2 = tail call i32 (...) @AT_cleanupMemory()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ analyze(float *, float *);
int /*<<< orphan*/ filter_step(float, float *);
void analysis_callback(float input, float output[4]) {
  float bins[10];
  filter_step(input, bins);
  analyze(bins, output);
}


x86 assembly (clang, -O0):
<analysis_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x40(%rbp),%rdi
call   1040 <filter_step@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <analyze@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<analysis_callback>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <filter_step@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <analyze@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @analysis_callback(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca [10 x float]
store float %0, float* %3
store float* %1, float** %4
%6 = load float, float* %3
%7 = getelementptr inbounds [10 x float], [10 x float]* %5, i64 0, i64 0
%8 = call i32 @filter_step(float %6, float* %7)
%9 = getelementptr inbounds [10 x float], [10 x float]* %5, i64 0, i64 0
%10 = load float*, float** %4
%11 = call i32 @analyze(float* %9, float* %10)
ret void
}

LLVM IR (-O2):
define void @analysis_callback(float %0, float* %1) {
%3 = alloca [10 x float]
%4 = bitcast [10 x float]* %3 to i8*
%5 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 0
%6 = call i32 @filter_step(float %0, float* %5)
%7 = call i32 @analyze(float* %5, float* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ map2check_non_det_int();
unsigned map2check_non_det_unsigned() {
  return (unsigned)map2check_non_det_int();
}


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

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

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

LLVM IR (-O2):
define i32 @map2check_non_det_unsigned() {
%1 = tail call i32 (...) @map2check_non_det_int()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: fmt [-width] [files]...\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: fmt [-width] [files]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: fmt [-width] [files]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *, int /*<<< orphan*/);
extern void english_UTF_8_close_env(struct SN_env *z) { SN_close_env(z, 0); }


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

x86 assembly (clang, -O2):
<english_UTF_8_close_env>:
xor    %esi,%esi
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @english_UTF_8_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @english_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int counter;
  for (counter = 1; counter < 7; counter++) {
    printf("Number of counter: %d\n", counter);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Number of counter: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [23 x i8] c"Number of counter: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_proxy {
  int dummy;
};
struct wl_data_offer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, char const *);
void wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial,
                          const char *mime_type) {
  wl_proxy_marshal((struct wl_proxy *)wl_data_offer, 0, serial, mime_type);
}


x86 assembly (clang, -O0):
<wl_data_offer_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_data_offer_accept>:
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_data_offer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_offer_accept(%struct.wl_data_offer* %0, i32 %1, i8* %2) {
%4 = alloca %struct.wl_data_offer*
%5 = alloca i32
%6 = alloca i8*
store %struct.wl_data_offer* %0, %struct.wl_data_offer** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.wl_data_offer*, %struct.wl_data_offer** %4
%8 = bitcast %struct.wl_data_offer* %7 to %struct.wl_proxy*
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %8, i32 0, i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.wl_data_offer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_offer_accept(%struct.wl_data_offer* %0, i32 %1, i8* %2) {
%4 = bitcast %struct.wl_data_offer* %0 to %struct.wl_proxy*
%5 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0, i32 %1, i8* %2)
ret void
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return (c - 'a' + 'A');
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <ft_toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <ft_toupper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ srand48(unsigned int);
void srand(unsigned int seed) { srand48(seed); }


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

x86 assembly (clang, -O2):
<srand>:
jmp    1030 <srand48@plt>

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

LLVM IR (-O2):
define void @srand(i32 %0) {
%2 = tail call i32 @srand48(i32 %0)
ret void
}