xunge/DecIR huggingface dataset:
int my_str_isprintable(char *str) {
  int i;
  char c;
  i = 0;
  while (str[i] != '\0') {
    c = str[i];
    if (c < 32 || c > 126) {
      return (0);
    }
    i = i + 1;
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_isprintable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1166 <my_str_isprintable+0x66>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x20,%eax
jl     114c <my_str_isprintable+0x4c>
movsbl -0x15(%rbp),%eax
cmp    $0x7e,%eax
jle    1158 <my_str_isprintable+0x58>
movl   $0x0,-0x4(%rbp)
jmp    116d <my_str_isprintable+0x6d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_isprintable+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_isprintable>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_isprintable+0x23>
add    $0x1,%rdi
nop
add    $0x81,%cl
cmp    $0xa0,%cl
jbe    1124 <my_str_isprintable+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_isprintable+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_isprintable(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -127
%12 = icmp ult i8 %11, -95
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
int rt_raisepri(int pri) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @rt_raisepri(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ zipmapLookupRaw(unsigned char *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/, unsigned int *);
size_t zipmapBlobLen(unsigned char *zm) {
  unsigned int totlen;
  zipmapLookupRaw(zm, NULL, 0, &totlen);
  return totlen;
}


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

x86 assembly (clang, -O2):
<zipmapBlobLen>:
push   %rax
lea    0x4(%rsp),%rcx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <zipmapLookupRaw@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @zipmapBlobLen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @zipmapLookupRaw(i8* %4, i32* null, i32 0, i32* %3)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @zipmapBlobLen(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @zipmapLookupRaw(i8* %0, i32* null, i32 0, i32* %2)
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_64(int /*<<< orphan*/);
uint64_t htobell(uint64_t hostlong) { return bswap_64(hostlong); }


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

x86 assembly (clang, -O2):
<htobell>:
jmp    1030 <bswap_64@plt>

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

LLVM IR (-O2):
define i32 @htobell(i32 %0) {
%2 = tail call i32 @bswap_64(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int u_int32_t;

/* Variables and functions */
int iceil_log2(int, int);
int /*<<< orphan*/ write_padding(int /*<<< orphan*/ *, int);
void insert_padding(u_int8_t *data, u_int32_t length) {
  u_int32_t aes_blks;
  u_int32_t remaining;
  aes_blks = iceil_log2(length, 4);
  remaining = (aes_blks << 4) - length;
  write_padding(data + length, remaining);
}


x86 assembly (clang, -O0):
<insert_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1040 <iceil_log2@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%esi
call   1030 <write_padding@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_padding>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x4,%esi
call   1040 <iceil_log2@plt>
shl    $0x4,%eax
sub    %ebx,%eax
movslq %ebx,%rcx
lea    (%r14,%rcx,4),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write_padding@plt>

LLVM IR (-O0):
define void @insert_padding(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @iceil_log2(i32 %7, i32 4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = shl i32 %9, 4
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %6
%18 = call i32 @write_padding(i32* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @insert_padding(i32* %0, i32 %1) {
%3 = tail call i32 @iceil_log2(i32 %1, i32 4)
%4 = shl i32 %3, 4
%5 = sub nsw i32 %4, %1
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @write_padding(i32* %7, i32 %5)
ret void
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i = i + 1) {
    if (num % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <check_prime+0x50>
jmp    113b <check_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ simplesample_http_run();
int main(void) {
  simplesample_http_run();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <simplesample_http_run@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @simplesample_http_run()
ret i32 0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct __kernel_old_timeval {
  int dummy;
};

/* Variables and functions */
int __cvdso_gettimeofday(struct __kernel_old_timeval *, struct timezone *);
int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
                          struct timezone *tz) {
  return __cvdso_gettimeofday(tv, tz);
}


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

x86 assembly (clang, -O2):
<__kernel_gettimeofday>:
jmp    1030 <__cvdso_gettimeofday@plt>

LLVM IR (-O0):
%struct.__kernel_old_timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @__kernel_gettimeofday(%struct.__kernel_old_timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.__kernel_old_timeval*
%4 = alloca %struct.timezone*
store %struct.__kernel_old_timeval* %0, %struct.__kernel_old_timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.__kernel_old_timeval*, %struct.__kernel_old_timeval** %3
%6 = load %struct.timezone*, %struct.timezone** %4
%7 = call i32 @__cvdso_gettimeofday(%struct.__kernel_old_timeval* %5, %struct.timezone* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.__kernel_old_timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @__kernel_gettimeofday(%struct.__kernel_old_timeval* %0, %struct.timezone* %1) {
%3 = tail call i32 @__cvdso_gettimeofday(%struct.__kernel_old_timeval* %0, %struct.timezone* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ UINT16_MAX;
int /*<<< orphan*/ xsd_integer_value(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
uint16_t xsd_uint16_value(const char *literal) {
  return (uint16_t)xsd_integer_value(literal, 0, UINT16_MAX);
}


x86 assembly (clang, -O0):
<xsd_uint16_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <xsd_integer_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_uint16_value>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <xsd_integer_value@plt>

LLVM IR (-O0):
@UINT16_MAX = global i32 0
define i32 @xsd_uint16_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @UINT16_MAX
%5 = call i32 @xsd_integer_value(i8* %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@UINT16_MAX = global i32 0
define i32 @xsd_uint16_value(i8* %0) {
%2 = load i32, i32* @UINT16_MAX
%3 = tail call i32 @xsd_integer_value(i8* %0, i32 0, i32 %2)
ret i32 %3
}
int test_imm_B8uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B8uint64_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, 184
%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_B8uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int array_set(void **base, size_t length, void *item, int position) {
  if (position > length)
    return 0;
  if (position < 0)
    return 0;
  base[position] = item;
  return 1;
}


x86 assembly (clang, -O0):
<array_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    112d <array_set+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    115a <array_set+0x5a>
cmpl   $0x0,-0x24(%rbp)
jge    1143 <array_set+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <array_set+0x5a>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_set>:
xor    %eax,%eax
test   %ecx,%ecx
js     1117 <array_set+0x17>
movslq %ecx,%rcx
cmp    %rsi,%rcx
ja     1117 <array_set+0x17>
mov    %rdx,(%rdi,%rcx,8)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @array_set(i8** nocapture writeonly %0, i64 %1, i8* %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = icmp ugt i64 %5, %1
%7 = icmp slt i32 %3, 0
%8 = or i1 %7, %6
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %0, i64 %5
store i8* %2, i8** %10
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ 1, %9 ], [ 0, %4 ]
ret i32 %12
}
void ui_reset_progress() {}


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

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

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

LLVM IR (-O2):
define void @ui_reset_progress() {
ret void
}
void foo284() {}


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

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

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

LLVM IR (-O2):
define void @foo284() {
ret void
}
/* Type definitions */
struct rpn_plugin {
  int dummy;
};

/* Variables and functions */
struct rpn_plugin *rpn_get_set_plugin_root(struct rpn_plugin *root) {
  static struct rpn_plugin *p_root = NULL;
  if (p_root == NULL)
    p_root = root;
  return p_root;
}


x86 assembly (clang, -O0):
<rpn_get_set_plugin_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f18(%rip)
jne    1121 <rpn_get_set_plugin_root+0x21>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f07(%rip)
mov    0x2f00(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_get_set_plugin_root>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
je     110d <rpn_get_set_plugin_root+0xd>
ret
mov    %rdi,0x2f14(%rip)
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.rpn_plugin = type { i32 }
@rpn_get_set_plugin_root.p_root = internal global %struct.rpn_plugin* null
define %struct.rpn_plugin* @rpn_get_set_plugin_root(%struct.rpn_plugin* %0) {
%2 = alloca %struct.rpn_plugin*
store %struct.rpn_plugin* %0, %struct.rpn_plugin** %2
%3 = load %struct.rpn_plugin*, %struct.rpn_plugin** @rpn_get_set_plugin_root.p_root
%4 = icmp eq %struct.rpn_plugin* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load %struct.rpn_plugin*, %struct.rpn_plugin** %2
store %struct.rpn_plugin* %6, %struct.rpn_plugin** @rpn_get_set_plugin_root.p_root
br label %7
7: ; preds = %5, %1
%8 = load %struct.rpn_plugin*, %struct.rpn_plugin** @rpn_get_set_plugin_root.p_root
ret %struct.rpn_plugin* %8
}

LLVM IR (-O2):
%struct.rpn_plugin = type { i32 }
@rpn_get_set_plugin_root.p_root = internal unnamed_addr global %struct.rpn_plugin* null
define %struct.rpn_plugin* @rpn_get_set_plugin_root(%struct.rpn_plugin* %0) {
%2 = load %struct.rpn_plugin*, %struct.rpn_plugin** @rpn_get_set_plugin_root.p_root
%3 = icmp eq %struct.rpn_plugin* %2, null
br i1 %3, label %4, label %5
4: ; preds = %1
store %struct.rpn_plugin* %0, %struct.rpn_plugin** @rpn_get_set_plugin_root.p_root
br label %5
5: ; preds = %4, %1
%6 = phi %struct.rpn_plugin* [ %0, %4 ], [ %2, %1 ]
ret %struct.rpn_plugin* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printvtx(const void *data) { printf("%02d", *(int *)data); }


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

x86 assembly (clang, -O2):
<printvtx>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02d\00"
define void @printvtx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02d\00"
define void @printvtx(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void stop() {
  printf("CTRL+C --> Stop sniffing...\n");
  exit(0);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"CTRL+C --> Stop sniffing...\0A\00"
define void @stop() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"CTRL+C --> Stop sniffing...\00"
define void @stop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int RTP_get_extension(unsigned char *p) {
  return ((unsigned int)(p[0] >> 4 & 0x01));
}


x86 assembly (clang, -O0):
<RTP_get_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sar    $0x4,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_get_extension>:
movzbl (%rdi),%eax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @RTP_get_extension(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @RTP_get_extension(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = lshr i8 %2, 4
%4 = and i8 %3, 1
%5 = zext i8 %4 to i32
ret i32 %5
}
const char *ls_costN_nm7_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm7_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_costN_nm7_name_out+0x2b>
jmp    111a <ls_costN_nm7_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_costN_nm7_name_out+0x3b>
jmp    114b <ls_costN_nm7_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm7_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm7_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm7_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm7_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm7_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void ami_ctxmenu_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ami_ctxmenu_free() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t valueAsInt(float value) {
  union {
    float f;
    uint32_t i;
  } u = {.f = value};
  if (((u.i >> 23) & 0xff) == 0xff && (u.i & 0x7fffff) != 0)
    return 0x7fffffff;
  return u.i;
}


x86 assembly (clang, -O0):
<valueAsInt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x17,%eax
and    $0xff,%eax
cmp    $0xff,%eax
jne    1146 <valueAsInt+0x46>
mov    -0x10(%rbp),%eax
and    $0x7fffff,%eax
cmp    $0x0,%eax
je     1146 <valueAsInt+0x46>
movl   $0x7fffffff,-0x4(%rbp)
jmp    114c <valueAsInt+0x4c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueAsInt>:
movd   %xmm0,%ecx
mov    %ecx,%edx
test   $0x7fffff,%ecx
mov    $0x7fffffff,%eax
cmove  %ecx,%eax
not    %edx
test   $0x7f800000,%edx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @valueAsInt(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %3
%5 = bitcast %union.anon* %4 to float*
%6 = load float, float* %3
store float %6, float* %5
%7 = bitcast %union.anon* %4 to i32*
%8 = load i32, i32* %7
%9 = ashr i32 %8, 23
%10 = and i32 %9, 255
%11 = icmp eq i32 %10, 255
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = bitcast %union.anon* %4 to i32*
%14 = load i32, i32* %13
%15 = and i32 %14, 8388607
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 2147483647, i32* %2
br label %21
18: ; preds = %12, %1
%19 = bitcast %union.anon* %4 to i32*
%20 = load i32, i32* %19
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @valueAsInt(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2139095040
%4 = icmp ne i32 %3, 2139095040
%5 = and i32 %2, 8388607
%6 = icmp eq i32 %5, 0
%7 = or i1 %4, %6
%8 = select i1 %7, i32 %2, i32 2147483647
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void die(char *msg) {
  printf("\nFatal error: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
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    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0AFatal error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AFatal error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pixel_pack_s16u8_y(short *, unsigned char *, unsigned int);
void llconv_grey_s16u8(short int *src, unsigned char *dst,
                       unsigned int nbpixels) {
  pixel_pack_s16u8_y(src, dst, nbpixels >> 3);
}


x86 assembly (clang, -O0):
<llconv_grey_s16u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shr    $0x3,%edx
call   1030 <pixel_pack_s16u8_y@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llconv_grey_s16u8>:
shr    $0x3,%edx
jmp    1030 <pixel_pack_s16u8_y@plt>

LLVM IR (-O0):
define void @llconv_grey_s16u8(i16* %0, i8* %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i8*
%6 = alloca i32
store i16* %0, i16** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i16*, i16** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = lshr i32 %9, 3
%11 = call i32 @pixel_pack_s16u8_y(i16* %7, i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @llconv_grey_s16u8(i16* %0, i8* %1, i32 %2) {
%4 = lshr i32 %2, 3
%5 = tail call i32 @pixel_pack_s16u8_y(i16* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
void SENNA_tokenize_untilspace(int *size_, const char *sentence) {
  int size = 0;
  while (1) {
    char c = sentence[size];
    if (c == '\0' || isspace(c))
      break;
    size++;
  }
  *size_ = size;
}


x86 assembly (clang, -O0):
<SENNA_tokenize_untilspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x0,%eax
je     1155 <SENNA_tokenize_untilspace+0x45>
movsbl -0x15(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115a <SENNA_tokenize_untilspace+0x4a>
jmp    1168 <SENNA_tokenize_untilspace+0x58>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <SENNA_tokenize_untilspace+0x17>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SENNA_tokenize_untilspace>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ecx,%ecx
nopl   (%rax)
mov    %rcx,%rbx
movzbl (%r15,%rcx,1),%eax
test   %al,%al
je     113d <SENNA_tokenize_untilspace+0x2d>
movsbl %al,%edi
call   1030 <isspace@plt>
lea    0x1(%rbx),%rcx
test   %rax,%rax
je     1120 <SENNA_tokenize_untilspace+0x10>
mov    %ebx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @SENNA_tokenize_untilspace(i32* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %11, %8 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = tail call i64 @isspace(i8 signext %6)
%10 = icmp eq i64 %9, 0
%11 = add nuw i64 %4, 1
br i1 %10, label %3, label %12
12: ; preds = %3, %8
%13 = trunc i64 %4 to i32
store i32 %13, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int tx_pthread_mutex_unlock(pthread_mutex_t *m) {
  if (0) {
    return pthread_mutex_unlock(m);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tx_pthread_mutex_unlock(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int countLines(FILE *table) {
  int c, count = 0;
  do {
    c = fgetc(table);
    if (c == '\n') {
      count++;
    }
  } while (c != EOF);
  return count;
}


x86 assembly (clang, -O0):
<countLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1142 <countLines+0x32>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <countLines+0x37>
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
jne    1123 <countLines+0x13>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countLines>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
mov    0x2ec7(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <fgetc@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
cmp    (%r15),%eax
jne    1130 <countLines+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @countLines(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %3, %6
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %4, %8
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 %7
}
void truncate_spaces(char *s, int maxlen) {
  int x;
  for (x = 0; x < maxlen; x++)
    if ((s[x] == ' ') || (s[x] == '\0')) {
      s[x] = '\0';
      return;
    }
}


x86 assembly (clang, -O0):
<truncate_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <truncate_spaces+0x6c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1148 <truncate_spaces+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1159 <truncate_spaces+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    116c <truncate_spaces+0x6c>
jmp    115e <truncate_spaces+0x5e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <truncate_spaces+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate_spaces>:
test   %esi,%esi
jle    111f <truncate_spaces+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
testb  $0xdf,(%rdi,%rcx,1)
je     1120 <truncate_spaces+0x20>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <truncate_spaces+0x10>
ret
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @truncate_spaces(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ 0, %4 ], [ %14, %13 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
switch i8 %9, label %13 [
i8 32, label %10
i8 0, label %10
]
10: ; preds = %6, %6
%11 = and i64 %7, 4294967295
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %16
13: ; preds = %6
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %13, %2, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *myname) {
  fprintf(stderr,
          "usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] "
          "[-t [[CC]YY]MMDDhhmm[.SS]]\n"
          "       [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] "
          "file ...\n",
          myname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [127 x i8] c"usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]]\0A [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] file ...\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [127 x i8] c"usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]]\0A [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] file ...\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void afficher(double *tab, int count) {
  int i = 0;
  for (i = 0; i < count - 1; i++) {
    printf("%lf \n", tab[i]);
  }
}


x86 assembly (clang, -O0):
<afficher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1165 <afficher+0x55>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <afficher+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficher>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     1147 <afficher+0x37>
mov    %esi,%r12d
mov    %rdi,%r14
add    $0xffffffff,%r12d
xor    %ebx,%ebx
lea    0xed0(%rip),%r15
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <afficher+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lf \0A\00"
define void @afficher(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
int isalnum(int);
int bow_isalphanum(int character) { return isalnum(character); }


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

x86 assembly (clang, -O2):
<bow_isalphanum>:
jmp    1030 <isalnum@plt>

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

LLVM IR (-O2):
define i32 @bow_isalphanum(i32 %0) {
%2 = tail call i32 @isalnum(i32 %0)
ret i32 %2
}
/* Variables and functions */
long long mask_value(long long);
int /*<<< orphan*/ set_carry(int);
long long topbit_mask();
long long int intLSL(long long int x) {
  set_carry(0 != (topbit_mask() & x));
  return mask_value((x << 1) & ~1);
}


x86 assembly (clang, -O0):
<intLSL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <topbit_mask@plt>
mov    %rax,%rcx
and    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_carry@plt>
mov    -0x8(%rbp),%rdi
shl    $0x1,%rdi
and    $0xfffffffffffffffe,%rdi
call   1040 <mask_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLSL>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <topbit_mask@plt>
xor    %edi,%edi
test   %rbx,%rax
setne  %dil
call   1030 <set_carry@plt>
add    %rbx,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mask_value@plt>

LLVM IR (-O0):
define i64 @intLSL(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @topbit_mask()
%4 = load i64, i64* %2
%5 = and i64 %3, %4
%6 = icmp ne i64 0, %5
%7 = zext i1 %6 to i32
%8 = call i32 @set_carry(i32 %7)
%9 = load i64, i64* %2
%10 = shl i64 %9, 1
%11 = and i64 %10, -2
%12 = call i64 @mask_value(i64 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @intLSL(i64 %0) {
%2 = tail call i64 (...) @topbit_mask()
%3 = and i64 %2, %0
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @set_carry(i32 %5)
%7 = shl i64 %0, 1
%8 = tail call i64 @mask_value(i64 %7)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, unsigned long);
char *strncpy0(char *dest, const char *src, unsigned long n) {
  strncpy(dest, src, n);
  dest[n - 1] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strncpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy0>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strncpy0(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strncpy0(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
__attribute__((gnu_)) double carmen_fmin(double val1, double val2) {
  if (val2 < val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <carmen_fmin+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <carmen_fmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_fmin>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @carmen_fmin(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}