xunge/DecIR huggingface dataset:
int fun182() { return 182; }


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

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

LLVM IR (-O0):
define i32 @fun182() {
ret i32 182
}

LLVM IR (-O2):
define i32 @fun182() {
ret i32 182
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *getsp(char *p) {
  while (*p && !isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<getsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <getsp+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <getsp+0x48>
jmp    1169 <getsp+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <getsp+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsp>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <getsp+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <getsp+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <getsp+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getsp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @getsp(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int nc__create(char const *, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
               int *);
int nc_create(const char *path, int ioflags, int *ncid_ptr) {
  return nc__create(path, ioflags, 0, NULL, ncid_ptr);
}


x86 assembly (clang, -O0):
<nc_create>:
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),%esi
mov    -0x18(%rbp),%r8
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <nc__create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_create>:
mov    %rdx,%r8
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <nc__create@plt>

LLVM IR (-O0):
define i32 @nc_create(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @nc__create(i8* %7, i32 %8, i32 0, i32* null, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @nc_create(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @nc__create(i8* %0, i32 %1, i32 0, i32* null, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_STRING;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ DISPLAYTEXT_it;
int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &DISPLAYTEXT_it);
}


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

x86 assembly (clang, -O2):
<i2d_DISPLAYTEXT>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@DISPLAYTEXT_it = global i32 0
define i32 @i2d_DISPLAYTEXT(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @DISPLAYTEXT_it)
ret i32 %7
}

LLVM IR (-O2):
@DISPLAYTEXT_it = global i32 0
define i32 @i2d_DISPLAYTEXT(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @DISPLAYTEXT_it)
ret i32 %3
}
void foo683(int p) {}


x86 assembly (clang, -O0):
<foo683>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo683(i32 %0) {
ret void
}
void collision_detecte() {}


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

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

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

LLVM IR (-O2):
define void @collision_detecte() {
ret void
}
OP(fd, aa) {
  illegal_1();
  op_aa();
}


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_aa@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_aa@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_aa()
%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_aa()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ renderQuad(int, int);
void renderCubeFront(int xSplines, int ySplines) {
  glPushMatrix();
  glTranslatef(0.0, 0.0, 0.5);
  renderQuad(xSplines, ySplines);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<renderCubeFront>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <glPushMatrix@plt>
xorps  %xmm1,%xmm1
movsd  0xea0(%rip),%xmm2
movaps %xmm1,%xmm0
call   1050 <glTranslatef@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <renderQuad@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderCubeFront>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <glPushMatrix@plt>
movsd  0xeaa(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1050 <glTranslatef@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <renderQuad@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @renderCubeFront(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @glPushMatrix()
%6 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 5.000000e-01)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @renderQuad(i32 %7, i32 %8)
%10 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @renderCubeFront(i32 %0, i32 %1) {
%3 = tail call i32 (...) @glPushMatrix()
%4 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double 5.000000e-01)
%5 = tail call i32 @renderQuad(i32 %0, i32 %1)
%6 = tail call i32 (...) @glPopMatrix()
ret void
}
int is_number_in_array(int *p, int size, int n) {
  int flag = 0;
  int i;
  for (i = 0; i < size; i++) {
    if (*(p + i) == n) {
      flag = 1;
      break;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<is_number_in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <is_number_in_array+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    1148 <is_number_in_array+0x48>
movl   $0x1,-0x14(%rbp)
jmp    115b <is_number_in_array+0x5b>
jmp    114d <is_number_in_array+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <is_number_in_array+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number_in_array>:
test   %esi,%esi
jle    111e <is_number_in_array+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <is_number_in_array+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <is_number_in_array+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_number_in_array(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %7, %9, %3
%16 = phi i32 [ 0, %3 ], [ 1, %9 ], [ 0, %7 ]
ret i32 %16
}
/* Variables and functions */
int Thrd_Get_Word(int);
int Thrd_Get_Long(int t) {
  int i;
  int tmp;
  {
    i = Thrd_Get_Word(t);
    tmp = Thrd_Get_Word(t);
    return ((i << 16) | tmp);
  }
}


x86 assembly (clang, -O0):
<Thrd_Get_Long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Thrd_Get_Word@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Thrd_Get_Word@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thrd_Get_Long>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <Thrd_Get_Word@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <Thrd_Get_Word@plt>
shl    $0x10,%ebp
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Thrd_Get_Long(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @Thrd_Get_Word(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @Thrd_Get_Word(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 16
%11 = load i32, i32* %4
%12 = or i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @Thrd_Get_Long(i32 %0) {
%2 = tail call i32 @Thrd_Get_Word(i32 %0)
%3 = tail call i32 @Thrd_Get_Word(i32 %0)
%4 = shl i32 %2, 16
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int get_accumulated_throttled_time(int /*<<< orphan*/, int, double *);
int /*<<< orphan*/ pkg_node_to_cpu(int /*<<< orphan*/);
int get_pkg_accumulated_throttled_time(
    uint64_t node, double *accumulated_throttled_time_seconds) {
  uint64_t cpu = pkg_node_to_cpu(node);
  return get_accumulated_throttled_time(cpu, 0x613,
                                        accumulated_throttled_time_seconds);
}


x86 assembly (clang, -O0):
<get_pkg_accumulated_throttled_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pkg_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x613,%esi
call   1030 <get_accumulated_throttled_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pkg_accumulated_throttled_time>:
push   %rbx
mov    %rsi,%rbx
call   1040 <pkg_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x613,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <get_accumulated_throttled_time@plt>

LLVM IR (-O0):
define i32 @get_pkg_accumulated_throttled_time(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = call i32 @pkg_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double*, double** %4
%10 = call i32 @get_accumulated_throttled_time(i32 %8, i32 1555, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_pkg_accumulated_throttled_time(i32 %0, double* %1) {
%3 = tail call i32 @pkg_node_to_cpu(i32 %0)
%4 = tail call i32 @get_accumulated_throttled_time(i32 %3, i32 1555, double* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar();
double foo();
void foobar() {
  double d = foo();
  bar();
}


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <foo@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foobar() {
%1 = alloca double
%2 = call double (...) @foo()
store double %2, double* %1
%3 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @foobar() {
%1 = tail call double (...) @foo()
%2 = tail call i32 (...) @bar()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ find_k_closest(int *, int, int, int);
void main() {
  int a[] = {12, 16, 22, 30, 35, 39, 42, 45, 48, 50, 53, 55, 56};
  int len = sizeof(a) / sizeof(a[0]);
  find_k_closest(a, len, 35, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x34,%edx
call   1040 <memcpy@plt>
movl   $0xd,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    $0x23,%edx
mov    $0x4,%ecx
call   1030 <find_k_closest@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xf16(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xefb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xd,%esi
mov    $0x23,%edx
mov    $0x4,%ecx
call   1030 <find_k_closest@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [13 x i32] [i32 12, i32 16, i32 22, i32 30, i32 35, i32 39, i32 42, i32 45, i32 48, i32 50, i32 53, i32 55, i32 56]
define void @main() {
%1 = alloca [13 x i32]
%2 = alloca i32
%3 = bitcast [13 x i32]* %1 to i8*
store i32 13, i32* %2
%4 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @find_k_closest(i32* %4, i32 %5, i32 35, i32 4)
ret void
}

LLVM IR (-O2):
@__const.main.a = [13 x i32] [i32 12, i32 16, i32 22, i32 30, i32 35, i32 39, i32 42, i32 45, i32 48, i32 50, i32 53, i32 55, i32 56]
define void @main() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%4 = call i32 @find_k_closest(i32* %3, i32 13, i32 35, i32 4)
ret void
}
int __attribute__((section("libgloss_epiphany"))) _isatty(int filedes) {
  return (0 <= filedes) && (filedes <= 2);
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1121 <_isatty+0x21>
cmpl   $0x2,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @_isatty(i32 %0) section "libgloss_epiphany" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_isatty(i32 %0) section "libgloss_epiphany" {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void winner(char *name) {
  printf("%s, you are now ready for the real thing!\n", name);
}


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

x86 assembly (clang, -O2):
<winner>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"%s, you are now ready for the real thing!\0A\00"
define void @winner(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"%s, you are now ready for the real thing!\0A\00"
define void @winner(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128Timer1P__Capture__stop();
void Atm128GpioCaptureC__0__Atm128Capture__stop(void) {
  HplAtm128Timer1P__Capture__stop();
}


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

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

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

LLVM IR (-O2):
define void @Atm128GpioCaptureC__0__Atm128Capture__stop() {
%1 = tail call i32 (...) @HplAtm128Timer1P__Capture__stop()
ret void
}
/* Variables and functions */
void save_processor_state(void) {}


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

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

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

LLVM IR (-O2):
define void @save_processor_state() {
ret void
}
void testLabelDecl() {
  __label__ TestLabelDecl;
TestLabelDecl:
  goto TestLabelDecl;
}


x86 assembly (clang, -O0):
<testLabelDecl>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <testLabelDecl+0x9>
jmp    1109 <testLabelDecl+0x9>

x86 assembly (clang, -O2):
<testLabelDecl>:
jmp    1100 <testLabelDecl>

LLVM IR (-O0):
define void @testLabelDecl() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @testLabelDecl() {
br label %1
1: ; preds = %1, %0
br label %1
}
int roundfloat(float value) {
  return (int)(value + (value >= 0 ? 0.5f : -0.5f));
}


x86 assembly (clang, -O0):
<roundfloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee5(%rip),%xmm4
movss  0xee1(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpless %xmm2,%xmm1
movaps %xmm1,%xmm2
andps  %xmm4,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundfloat>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @roundfloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, float 5.000000e-01, float -5.000000e-01
%8 = fadd float %3, %7
%9 = fptosi float %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @roundfloat(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 5.000000e-01, float -5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
int lcase(c)
int c;
{
  if (c >= 'A' && c <= 'Z') {
    return c - 'A' + 'a';
  }
  return c;
}


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

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

LLVM IR (-O0):
define i32 @lcase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
%12 = add nsw i32 %11, 97
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 @lcase(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void argv_free(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    free(argv[i]);
  }
  free(argv);
}


x86 assembly (clang, -O0):
<argv_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <argv_free+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <argv_free+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_free>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <argv_free+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <argv_free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @argv_free(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: getpof [-0] [-r] [-q] [-x] filename [dir ..]\n");
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: getpof [-0] [-r] [-q] [-x] filename [dir ..]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: getpof [-0] [-r] [-q] [-x] filename [dir ..]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int sys$mount(void *itmlst) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(itmlst);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(47), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$mount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2f,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$mount>:
mov    $0x2f,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$mount"(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 47, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$mount"(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 47, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int set_pin_up(void) {
  unsigned tmp;
  tmp = (*(volatile unsigned long *)0xE0200C28);
  tmp = (tmp & ~(0x3 << 2 * 2)) | (0x2 << 2 * 2);
  (*(volatile unsigned long *)0xE0200C28) = tmp;
}


x86 assembly (clang, -O0):
<set_pin_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200c28,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffffcf,%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    $0xe0200c28,%eax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pin_up>:
mov    $0xe0200c28,%eax
mov    (%rax),%rcx
and    $0xffffffcf,%ecx
or     $0x20,%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define i32 @set_pin_up() {
%1 = alloca i32
%2 = alloca i32
%3 = load volatile i64, i64* inttoptr (i64 3760196648 to i64*)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -49
%7 = or i32 %6, 32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
store volatile i64 %9, i64* inttoptr (i64 3760196648 to i64*)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_pin_up() {
%1 = load volatile i64, i64* inttoptr (i64 3760196648 to i64*)
%2 = and i64 %1, 4294967247
%3 = or i64 %2, 32
store volatile i64 %3, i64* inttoptr (i64 3760196648 to i64*)
ret i32 undef
}
/* Variables and functions */
double __dnint(double);
double intr_wrap_404(double p1) { return __dnint(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_404>:
jmp    1030 <__dnint@plt>

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

LLVM IR (-O2):
define double @intr_wrap_404(double %0) {
%2 = tail call double @__dnint(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS] FILE\n"
          "\n"
          "Saves many files together into a single database, and can "
          "restore individual files\nfrom the database.\n"
          "\n"
          "Options:\n"
          " -f or --file FILE     Set the path to database.\n"
          " -x or --extract       Extract file from a database.\n"
          " -h or --help          Display this message.\n"
          " -V or --version       Display the version.\n"
          "",
          applet(arg0));
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [330 x i8] c"Usage: %s [OPTIONS] FILE\0A\0ASaves many files together into a single database, and can restore individual files\0Afrom the database.\0A\0AOptions:\0A -f or --file FILE Set the path to database.\0A -x or --extract Extract file from a database.\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [330 x i8] c"Usage: %s [OPTIONS] FILE\0A\0ASaves many files together into a single database, and can restore individual files\0Afrom the database.\0A\0AOptions:\0A -f or --file FILE Set the path to database.\0A -x or --extract Extract file from a database.\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int test_imm_7Auint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x7A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Auint64_midword_reg>:
test   $0x7a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Auint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7995392
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cairo_code_draw_pwrstartcLabel_get_width() { return 132; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_pwrstartcLabel_get_width() {
ret i32 132
}

LLVM IR (-O2):
define i32 @cairo_code_draw_pwrstartcLabel_get_width() {
ret i32 132
}
/* Variables and functions */
int /*<<< orphan*/ isprint(int);
int is_not_print(int ch) { return !isprint(ch); }


x86 assembly (clang, -O0):
<is_not_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_not_print>:
push   %rax
call   1030 <isprint@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_not_print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isprint(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_not_print(i32 %0) {
%2 = tail call i32 @isprint(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  switch (2) {
  case 2:
    switch (5 - 2) {
    case 3:
      break;
    case 10:
      abort();
    }
    break;
  case 1:
  default:
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sqlite3_free(char *);
void sqlite_print_error(char *error_msg) {
  printf("SQL error: %s\n", error_msg);
  sqlite3_free(error_msg);
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"SQL error: %s\0A\00"
define void @sqlite_print_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @sqlite3_free(i8* %0)
ret void
}
char char_is_invisible(const char c) {
  return ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n'));
}


x86 assembly (clang, -O0):
<char_is_invisible>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <char_is_invisible+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <char_is_invisible+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <char_is_invisible+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_is_invisible>:
cmp    $0x20,%dil
ja     111d <char_is_invisible+0x1d>
mov    $0x1,%al
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    111d <char_is_invisible+0x1d>
ret
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define signext i8 @char_is_invisible(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @char_is_invisible(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i8
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i8 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void display_version(void) {
  printf("%s\n", "screenfetch-c - Version "
                 "1"
                 "."
                 "6"
                 ", revision "
                 "0"
                 ".");
  return;
}


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

x86 assembly (clang, -O2):
<display_version>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [41 x i8] c"screenfetch-c - Version 1.6, revision 0.\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [41 x i8] c"screenfetch-c - Version 1.6, revision 0.\00"
define void @display_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read_data_cmd();
int /*<<< orphan*/ send_ctrl_cmd(int);
unsigned int lcm_compare_id(void) {
  send_ctrl_cmd(0x00);
  return ((0x5408) == read_data_cmd()) ? 1 : 0;
}


x86 assembly (clang, -O0):
<lcm_compare_id>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    %eax,%esi
mov    $0x5408,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_compare_id>:
push   %rax
xor    %edi,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
xor    %ecx,%ecx
cmp    $0x5408,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lcm_compare_id() {
%1 = call i32 @send_ctrl_cmd(i32 0)
%2 = call i32 (...) @read_data_cmd()
%3 = icmp eq i32 21512, %2
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @lcm_compare_id() {
%1 = tail call i32 @send_ctrl_cmd(i32 0)
%2 = tail call i32 (...) @read_data_cmd()
%3 = icmp eq i32 %2, 21512
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long strlen(const char *s) {
  int d0;
  register int __res;
  __asm__ __volatile__("repne\n\t"
                       "scasb\n\t"
                       "notl %0\n\t"
                       "decl %0"
                       : "=c"(__res), "=&D"(d0)
                       : "1"(s), "a"(0), "0"(0xffffffffu)
                       : "memory");
  return __res;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    $0xffffffff,%ecx
repnz scas %es:(%rdi),%al
not    %ecx
dec    %ecx
mov    %ecx,-0x10(%rbp)
mov    %edi,%eax
mov    %eax,-0xc(%rbp)
movslq -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
mov    $0xffffffff,%ecx
repnz scas %es:(%rdi),%al
not    %ecx
dec    %ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call { i32, i8* } asm sideeffect "repne\0A\09scasb\0A\09notl $0\0A\09decl $0", "={cx},=&{di},1,{ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %5, i32 0, i32 -1)
%7 = extractvalue { i32, i8* } %6, 0
%8 = extractvalue { i32, i8* } %6, 1
store i32 %7, i32* %4
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
%2 = tail call { i32, i8* } asm sideeffect "repne\0A\09scasb\0A\09notl $0\0A\09decl $0", "={cx},=&{di},1,{ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 0, i32 -1)
%3 = extractvalue { i32, i8* } %2, 0
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int islower(int);
__attribute__((regparm(0))) int(_win_islower)(int c) { return islower(c); }


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

x86 assembly (clang, -O2):
<_win_islower>:
jmp    1030 <islower@plt>

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

LLVM IR (-O2):
define i32 @_win_islower(i32 %0) {
%2 = tail call i32 @islower(i32 %0)
ret i32 %2
}
int test_imm_7Fint64_lowword_mem(long long *val) {
  return ((*val) & (0x7F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Fint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int next_rand();
int gg_rand(void) { return (int)(next_rand() & 0x7fffffff); }


x86 assembly (clang, -O0):
<gg_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next_rand@plt>
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_rand>:
push   %rax
xor    %eax,%eax
call   1030 <next_rand@plt>
and    $0x7fffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gg_rand() {
%1 = call i32 (...) @next_rand()
%2 = and i32 %1, 2147483647
ret i32 %2
}

LLVM IR (-O2):
define i32 @gg_rand() {
%1 = tail call i32 (...) @next_rand()
%2 = and i32 %1, 2147483647
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ net_send(char *, int, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
void inject_initial_packet() {
  char *buf;
  buf = (char *)malloc(2);
  strcpy(buf, "");
  net_send(buf, 2, 0, 0);
}


x86 assembly (clang, -O0):
<inject_initial_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <net_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inject_initial_packet>:
push   %rbx
mov    $0x2,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <net_send@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @inject_initial_packet() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 2)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @net_send(i8* %6, i32 2, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @inject_initial_packet() {
%1 = tail call i64 @malloc(i32 2)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @net_send(i8* %2, i32 2, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void do_echo(void) {
  char buffer[256];
  fgets(buffer, 1024, stdin);
  printf(buffer);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<do_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
lea    -0x100(%rbp),%rdi
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_echo>:
push   %rbx
sub    $0x100,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define void @do_echo() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 1024, i32 %3)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define void @do_echo() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 1024, i32 %3)
%5 = call i32 @printf(i8* %2)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}