xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ alias2_OK();
int loop2_bad(int k) {
  for (int i = 0; i < k; i++) {
    alias2_OK();
  }
  return 0;
}


x86 assembly (clang, -O0):
<loop2_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <loop2_bad+0x33>
mov    $0x0,%al
call   1030 <alias2_OK@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <loop2_bad+0x12>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop2_bad>:
push   %rbx
test   %edi,%edi
jle    112c <loop2_bad+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <alias2_OK@plt>
add    $0xffffffff,%ebx
jne    1120 <loop2_bad+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @loop2_bad(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret i32 0
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @alias2_OK()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
int stateqa500a(unsigned int pixel) {
  int qctemp;
  qctemp = pixel & 0x03;
  return qctemp;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @stateqa500a(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 3
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @stateqa500a(i32 %0) {
%2 = and i32 %0, 3
ret i32 %2
}
const char *byte_to_binary(unsigned long int x) {
  static char b[sizeof(x) * 8 + 1] = {0};
  int y;
  long long z;
  for (z = 1LL << sizeof(x) * 8 - 1, y = 0; z > 0; z >>= 1, y++) {
    b[y] = (((x & z) == z) ? '1' : '0');
  }
  b[y] = 0;
  return b;
}


x86 assembly (clang, -O0):
<byte_to_binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    116e <byte_to_binary+0x6e>
mov    -0x8(%rbp),%rdx
and    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %al,%dl
movslq -0xc(%rbp),%rcx
lea    0x2edf(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <byte_to_binary+0x1d>
movslq -0xc(%rbp),%rcx
lea    0x2eb7(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2eac(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_to_binary>:
movb   $0x0,0x2f29(%rip)
lea    0x2f22(%rip),%rax
ret

LLVM IR (-O0):
@byte_to_binary.b = internal global [65 x i8] zeroinitializer
define i8* @byte_to_binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
store i64 -9223372036854775808, i64* %4
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i64, i64* %4
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i64, i64* %2
%10 = load i64, i64* %4
%11 = and i64 %9, %10
%12 = load i64, i64* %4
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 49, i32 48
%16 = trunc i32 %15 to i8
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [65 x i8], [65 x i8]* @byte_to_binary.b, i64 0, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %8
%21 = load i64, i64* %4
%22 = ashr i64 %21, 1
store i64 %22, i64* %4
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %5
25: ; preds = %5
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [65 x i8], [65 x i8]* @byte_to_binary.b, i64 0, i64 %27
store i8 0, i8* %28
ret i8* getelementptr inbounds ([65 x i8], [65 x i8]* @byte_to_binary.b, i64 0, i64 0)
}

LLVM IR (-O2):
@byte_to_binary.b = internal global [65 x i8] zeroinitializer
define i8* @byte_to_binary(i64 %0) {
store i8 0, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @byte_to_binary.b, i64 0, i64 0)
ret i8* getelementptr inbounds ([65 x i8], [65 x i8]* @byte_to_binary.b, i64 0, i64 0)
}
int main(void) {
  int i = 21, j;
  j = i++;
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 21, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
store i32 %4, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 43
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_getguardsize(int /*<<< orphan*/ *, size_t *);
int my_pthread_attr_getguardsize(pthread_attr_t const *__attr,
                                 size_t *guard_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_getguardsize(realattr, guard_size);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_getguardsize>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_getguardsize@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_getguardsize(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
%5 = alloca i32*
store i32* %0, i32** %3
store i64* %1, i64** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i64*, i64** %4
%12 = call i32 @pthread_attr_getguardsize(i32* %10, i64* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_getguardsize(i32* nocapture %0, i64* %1) {
%3 = load i32, i32* %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_getguardsize(i32* %5, i64* %1)
ret i32 %6
}
int exact_square(int num) {
  int i;
  for (i = 0; i <= num; i++) {
    if (num == i * i) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114b <exact_square+0x4b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <exact_square+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1152 <exact_square+0x52>
jmp    113d <exact_square+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
js     1120 <exact_square+0x20>
lea    0x1(%rdi),%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1123 <exact_square+0x23>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %10, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %11
}
void s3c_i2c7_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_i2c7_setname(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_opp(uintptr_t, uintptr_t);
void fiat_secp256k1_opp(uint64_t out1[4], const uint64_t arg1[4]) {
  internal_fiat_secp256k1_opp((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_secp256k1_opp>:
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 <internal_fiat_secp256k1_opp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_secp256k1_opp>:
jmp    1030 <internal_fiat_secp256k1_opp@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_opp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_secp256k1_opp(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_opp(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_opp(i64 %3, i64 %4)
ret void
}
long long int f7(long long int x) {
  return (long long int)((unsigned long long int)x >> 59) | (x << 5);
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3b,%rax
mov    -0x8(%rbp),%rcx
shl    $0x5,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %rdi,%rax
rol    $0x5,%rax
ret

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

LLVM IR (-O2):
define i64 @f7(i64 %0) {
%2 = tail call i64 @llvm.fshl.i64(i64 %0, i64 %0, i64 5)
ret i64 %2
}
int gpio_get_value(unsigned gpio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_get_value(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_data_write(char);
int i2c_not_rcv_ack();
int /*<<< orphan*/ i2c_trx_pend();
int /*<<< orphan*/ i2c_trx_resume();
int i2c_send_data(char ch) {
  i2c_data_write(ch);
  i2c_trx_resume();
  while (!i2c_trx_pend())
    ;
  return i2c_not_rcv_ack();
}


x86 assembly (clang, -O0):
<i2c_send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1060 <i2c_data_write@plt>
mov    $0x0,%al
call   1040 <i2c_trx_resume@plt>
mov    $0x0,%al
call   1030 <i2c_trx_pend@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117a <i2c_send_data+0x3a>
jmp    117f <i2c_send_data+0x3f>
jmp    115e <i2c_send_data+0x1e>
mov    $0x0,%al
call   1050 <i2c_not_rcv_ack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_send_data>:
push   %rax
call   1060 <i2c_data_write@plt>
xor    %eax,%eax
call   1040 <i2c_trx_resume@plt>
nopl   (%rax)
xor    %eax,%eax
call   1030 <i2c_trx_pend@plt>
test   %eax,%eax
je     1150 <i2c_send_data+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1050 <i2c_not_rcv_ack@plt>

LLVM IR (-O0):
define i32 @i2c_send_data(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @i2c_data_write(i8 signext %3)
%5 = call i32 (...) @i2c_trx_resume()
br label %6
6: ; preds = %10, %1
%7 = call i32 (...) @i2c_trx_pend()
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
%12 = call i32 (...) @i2c_not_rcv_ack()
ret i32 %12
}

LLVM IR (-O2):
define i32 @i2c_send_data(i8 signext %0) {
%2 = tail call i32 @i2c_data_write(i8 signext %0)
%3 = tail call i32 (...) @i2c_trx_resume()
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @i2c_trx_pend()
%6 = icmp eq i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
%8 = tail call i32 (...) @i2c_not_rcv_ack()
ret i32 %8
}
/* Variables and functions */
float expf(double);
double powf(float, double);
float gauss(float n, float N, float o) {
  return expf(-1.0 / 2.0 *
              powf((n - (N - 1.0) / 2.0) / (o * (N - 1.0) / 2.0), 2.0));
}


x86 assembly (clang, -O0):
<gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xebf(%rip),%xmm2
subsd  %xmm2,%xmm1
movsd  0xeab(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xe91(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe79(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe65(%rip),%xmm1
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movsd  0xe4d(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
addsd  0xecf(%rip),%xmm1
cvtss2sd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xec7(%rip),%xmm1
mulsd  0xec7(%rip),%xmm2
addsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <powf@plt>
mulsd  0xe9b(%rip),%xmm0
pop    %rax
jmp    1040 <expf@plt>

LLVM IR (-O0):
define float @gauss(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = fsub double %10, 1.000000e+00
%12 = fdiv double %11, 2.000000e+00
%13 = fsub double %8, %12
%14 = load float, float* %6
%15 = fpext float %14 to double
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fsub double %17, 1.000000e+00
%19 = fmul double %15, %18
%20 = fdiv double %19, 2.000000e+00
%21 = fdiv double %13, %20
%22 = fptrunc double %21 to float
%23 = call double @powf(float %22, double 2.000000e+00)
%24 = fmul double -5.000000e-01, %23
%25 = call float @expf(double %24)
ret float %25
}

LLVM IR (-O2):
define float @gauss(float %0, float %1, float %2) {
%4 = fpext float %0 to double
%5 = fpext float %1 to double
%6 = fadd double %5, -1.000000e+00
%7 = fmul double %6, 5.000000e-01
%8 = fsub double %4, %7
%9 = fpext float %2 to double
%10 = fmul double %6, %9
%11 = fmul double %10, 5.000000e-01
%12 = fdiv double %8, %11
%13 = fptrunc double %12 to float
%14 = tail call double @powf(float %13, double 2.000000e+00)
%15 = fmul double %14, -5.000000e-01
%16 = tail call float @expf(double %15)
ret float %16
}
/* Variables and functions */
int /*<<< orphan*/ e_inx();
void e_inx_accu() { e_inx(); }


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

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

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

LLVM IR (-O2):
define void @e_inx_accu() {
%1 = tail call i32 (...) @e_inx()
ret void
}
/* Variables and functions */
int munlockall();
int main(void) { return munlockall(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @munlockall()
ret i32 %1
}
float my_rand(long idum) {
  long k;
  float answer;
  idum ^= 123459876;
  k = idum / 127773;
  idum = 16807 * (idum - k * 127773) - 2836 * k;
  idum ^= 123459876;
  if (idum < 0)
    idum += 2147483647;
  answer = (1.0 / 2147483647) * idum;
  return answer;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x75bd924,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x1f31d,-0x10(%rbp),%rcx
sub    %rcx,%rax
imul   $0x41a7,%rax,%rax
imul   $0xb14,-0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x75bd924,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1174 <my_rand+0x74>
mov    -0x8(%rbp),%rax
add    $0x7fffffff,%rax
mov    %rax,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
xor    $0x75bd924,%rdi
movabs $0x41a705af1fe3fb79,%rcx
05 a7 41
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xf,%rdx
add    %rax,%rdx
imul   $0xfffffffffffe0ce3,%rdx,%rax
add    %rdi,%rax
imul   $0x41a7,%rax,%rax
imul   $0xfffffffffffff4ec,%rdx,%rcx
add    %rax,%rcx
mov    %rcx,%rax
xor    $0x75bd924,%rax
lea    0x7fffffff(%rax),%rdx
test   %rcx,%rcx
cmovns %rax,%rdx
cvtsi2sd %rdx,%xmm0
mulsd  0xe9c(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @my_rand(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca float
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = xor i64 %5, 123459876
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = sdiv i64 %7, 127773
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, 127773
%12 = sub nsw i64 %9, %11
%13 = mul nsw i64 16807, %12
%14 = load i64, i64* %3
%15 = mul nsw i64 2836, %14
%16 = sub nsw i64 %13, %15
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = xor i64 %17, 123459876
store i64 %18, i64* %2
%19 = load i64, i64* %2
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %1
%22 = load i64, i64* %2
%23 = add nsw i64 %22, 2147483647
store i64 %23, i64* %2
br label %24
24: ; preds = %21, %1
%25 = load i64, i64* %2
%26 = sitofp i64 %25 to double
%27 = fmul double 0x3E00000000200000, %26
%28 = fptrunc double %27 to float
store float %28, float* %4
%29 = load float, float* %4
ret float %29
}

LLVM IR (-O2):
define float @my_rand(i64 %0) {
%2 = xor i64 %0, 123459876
%3 = sdiv i64 %2, 127773
%4 = mul nsw i64 %3, -127773
%5 = add i64 %4, %2
%6 = mul nsw i64 %5, 16807
%7 = mul nsw i64 %3, -2836
%8 = add i64 %6, %7
%9 = xor i64 %8, 123459876
%10 = icmp slt i64 %8, 0
%11 = add nsw i64 %9, 2147483647
%12 = select i1 %10, i64 %11, i64 %9
%13 = sitofp i64 %12 to double
%14 = fmul double %13, 0x3E00000000200000
%15 = fptrunc double %14 to float
ret float %15
}
const char *of_alias_get(struct device_node *np) { return ((void *)0); }


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define i8* @of_alias_get(%struct.device_node* %0) {
%2 = alloca %struct.device_node*
store %struct.device_node* %0, %struct.device_node** %2
ret i8* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias i8* @of_alias_get(%struct.device_node* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void shl_reg32_imm8(unsigned int reg32, unsigned char imm8) {
  put8(0xC1);
  put8(0xE0 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<shl_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0xc1,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc1,%edi
call   1030 <put8@plt>
add    $0xe0,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shl_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -63)
%6 = load i32, i32* %3
%7 = add i32 224, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @shl_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -63)
%4 = trunc i32 %0 to i8
%5 = add i8 %4, -32
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yylex();
int main() {
  printf("\n--------------- Pattern print -------------------\n");
  yylex();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [51 x i8] c"\0A--------------- Pattern print -------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @yylex()
ret i32 0
}
/* Variables and functions */
double fmax(int, int /*<<< orphan*/);
int /*<<< orphan*/ fmin(int, double);
double normalize_lat(double lat) { return fmax(-90., fmin(90., lat)); }


x86 assembly (clang, -O0):
<normalize_lat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x5a,%edi
call   1030 <fmin@plt>
mov    %eax,%esi
mov    $0xffffffa6,%edi
call   1040 <fmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_lat>:
push   %rax
mov    $0x5a,%edi
call   1030 <fmin@plt>
mov    $0xffffffa6,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <fmax@plt>

LLVM IR (-O0):
define double @normalize_lat(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fmin(i32 90, double %3)
%5 = call double @fmax(i32 -90, i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @normalize_lat(double %0) {
%2 = tail call i32 @fmin(i32 90, double %0)
%3 = tail call double @fmax(i32 -90, i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "Usage: %s [start|stop|reload|status]\n", "clerkd");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xefb(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xeff(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: %s [start|stop|reload|status]\0A\00"
@.str.1 = [7 x i8] c"clerkd\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: %s [start|stop|reload|status]\0A\00"
@.str.1 = [7 x i8] c"clerkd\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *lwork(void const *, void *, size_t *, size_t,
            int (*)(void const *, void const *), int);
void *lsearch(const void *key, void *base, size_t *nelp, size_t width,
              int (*compar)(const void *, const void *)) {
  return lwork(key, base, nelp, width, compar, 1);
}


x86 assembly (clang, -O0):
<lsearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <lwork@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsearch>:
mov    $0x1,%r9d
jmp    1030 <lwork@plt>

LLVM IR (-O0):
define i8* @lsearch(i8* %0, i8* %1, i64* %2, i64 %3, i32 (i8*, i8*)* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64* %2, i64** %8
store i64 %3, i64* %9
store i32 (i8*, i8*)* %4, i32 (i8*, i8*)** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64*, i64** %8
%14 = load i64, i64* %9
%15 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%16 = call i8* @lwork(i8* %11, i8* %12, i64* %13, i64 %14, i32 (i8*, i8*)* %15, i32 1)
ret i8* %16
}

LLVM IR (-O2):
define i8* @lsearch(i8* %0, i8* %1, i64* %2, i64 %3, i32 (i8*, i8*)* %4) {
%6 = tail call i8* @lwork(i8* %0, i8* %1, i64* %2, i64 %3, i32 (i8*, i8*)* %4, i32 1)
ret i8* %6
}
/* Type definitions */
struct pollfd {
  int /*<<< orphan*/ fd;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int snprintf(char *, int, char *, char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void txline(struct pollfd *fds, char *line) {
  char buf[64];
  int len = snprintf(buf, sizeof(buf), "%s\r\n", line);
  if (len < 0)
    return;
  write(fds->fd, buf, len);
}


x86 assembly (clang, -O0):
<txline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xebc(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jge    115b <txline+0x3b>
jmp    116d <txline+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   1030 <write@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txline>:
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xece(%rip),%rdx
mov    %rsp,%rdi
mov    $0x40,%esi
call   1040 <snprintf@plt>
test   %eax,%eax
js     114f <txline+0x2f>
mov    (%rbx),%edi
mov    %rsp,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
@.str = [5 x i8] c"%s\0D\0A\00"
define void @txline(%struct.pollfd* %0, i8* %1) {
%3 = alloca %struct.pollfd*
%4 = alloca i8*
%5 = alloca [64 x i8]
%6 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %7, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
br label %20
13: ; preds = %2
%14 = load %struct.pollfd*, %struct.pollfd** %3
%15 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%18 = load i32, i32* %6
%19 = call i32 @write(i32 %16, i8* %17, i32 %18)
br label %20
20: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
@.str = [5 x i8] c"%s\0D\0A\00"
define void @txline(%struct.pollfd* nocapture %0, i8* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = icmp slt i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %0, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @write(i32 %9, i8* %4, i32 %5)
br label %11
11: ; preds = %2, %7
ret void
}
int test_imm_16uint8_reg(unsigned char val) {
  return ((val) & (-0x16 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_16uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffea,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_16uint8_reg>:
test   $0xea,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_16uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -22
%6 = icmp ne i32 %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_16uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -22
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float powf(float, int);
float filter_butter(float k, float r, float w) {
  return 1.f / (1.f + powf(k / r, 2 * w));
}


x86 assembly (clang, -O0):
<filter_butter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  0xecb(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
cvttss2si %xmm1,%edi
call   1030 <powf@plt>
movss  0xeb1(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xea5(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_butter>:
push   %rax
divss  %xmm1,%xmm0
addss  %xmm2,%xmm2
cvttss2si %xmm2,%edi
call   1030 <powf@plt>
movss  0xed6(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @filter_butter(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fdiv float %7, %8
%10 = load float, float* %6
%11 = fmul float 2.000000e+00, %10
%12 = fptosi float %11 to i32
%13 = call float @powf(float %9, i32 %12)
%14 = fadd float 1.000000e+00, %13
%15 = fdiv float 1.000000e+00, %14
ret float %15
}

LLVM IR (-O2):
define float @filter_butter(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = fmul float %2, 2.000000e+00
%6 = fptosi float %5 to i32
%7 = tail call float @powf(float %4, i32 %6)
%8 = fadd float %7, 1.000000e+00
%9 = fdiv float 1.000000e+00, %8
ret float %9
}
unsigned clamped_subtract(unsigned const a, unsigned const b) {
  return (a > b) ? a - b : 0;
}


x86 assembly (clang, -O0):
<clamped_subtract>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1124 <clamped_subtract+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112e <clamped_subtract+0x2e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <clamped_subtract+0x2e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamped_subtract>:
xor    %eax,%eax
sub    %esi,%edi
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamped_subtract(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.usub.sat.i32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int allocate_pair(int, int);
int find_pair(int, int);
int colmgr_alloc_pair(int fg, int bg) {
  const int pair_index = find_pair(fg, bg);
  return (pair_index != -1) ? pair_index : allocate_pair(fg, bg);
}


x86 assembly (clang, -O0):
<colmgr_alloc_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <find_pair@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     1151 <colmgr_alloc_pair+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115f <colmgr_alloc_pair+0x3f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <allocate_pair@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colmgr_alloc_pair>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <find_pair@plt>
cmp    $0xffffffff,%eax
je     1138 <colmgr_alloc_pair+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <allocate_pair@plt>

LLVM IR (-O0):
define i32 @colmgr_alloc_pair(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @find_pair(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
br label %17
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @allocate_pair(i32 %14, i32 %15)
br label %17
17: ; preds = %13, %11
%18 = phi i32 [ %12, %11 ], [ %16, %13 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @colmgr_alloc_pair(i32 %0, i32 %1) {
%3 = tail call i32 @find_pair(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @allocate_pair(i32 %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void Except_raise(const char *e, const char *file, int line) {
  fprintf(stderr, "An error, {%s} occured in %s at line %d.", e, file, line);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<Except_raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Except_raise>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"An error, {%s} occured in %s at line %d.\00"
@EXIT_FAILURE = global i32 0
define void @Except_raise(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"An error, {%s} occured in %s at line %d.\00"
@EXIT_FAILURE = global i32 0
define void @Except_raise(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void drawSSphere(void) {
  glColor3f(0.5, 0.0, 1.0);
  glutSolidSphere(5.5, 30, 30);
}


x86 assembly (clang, -O0):
<drawSSphere>:
push   %rbp
mov    %rsp,%rbp
movsd  0xedc(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xed9(%rip),%xmm2
call   1030 <glColor3f@plt>
movsd  0xebc(%rip),%xmm0
mov    $0x1e,%esi
mov    %esi,%edi
call   1040 <glutSolidSphere@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSSphere>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1030 <glColor3f@plt>
movsd  0xecf(%rip),%xmm0
mov    $0x1e,%edi
mov    $0x1e,%esi
pop    %rax
jmp    1040 <glutSolidSphere@plt>

LLVM IR (-O0):
define void @drawSSphere() {
%1 = call i32 @glColor3f(double 5.000000e-01, double 0.000000e+00, double 1.000000e+00)
%2 = call i32 @glutSolidSphere(double 5.500000e+00, i32 30, i32 30)
ret void
}

LLVM IR (-O2):
define void @drawSSphere() {
%1 = tail call i32 @glColor3f(double 5.000000e-01, double 0.000000e+00, double 1.000000e+00)
%2 = tail call i32 @glutSolidSphere(double 5.500000e+00, i32 30, i32 30)
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void rtbst_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<rtbst_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <rtbst_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtbst_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @rtbst_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @rtbst_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
int bar(int (*fn)(void *), void *arg, unsigned long flags) { return 0; }


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

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

LLVM IR (-O0):
define i32 @bar(i32 (i8*)* %0, i8* %1, i64 %2) {
%4 = alloca i32 (i8*)*
%5 = alloca i8*
%6 = alloca i64
store i32 (i8*)* %0, i32 (i8*)** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @bar(i32 (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
float normalize_and_interpolate(float min, float max, float t) {
  return (min == max) ? 0.0f : (t - min) / (max - min);
}


x86 assembly (clang, -O0):
<normalize_and_interpolate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1135 <normalize_and_interpolate+0x35>
jp     1135 <normalize_and_interpolate+0x35>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1152 <normalize_and_interpolate+0x52>
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_and_interpolate>:
xorps  %xmm3,%xmm3
ucomiss %xmm1,%xmm0
jne    110e <normalize_and_interpolate+0xe>
jp     110e <normalize_and_interpolate+0xe>
movaps %xmm3,%xmm0
ret
subss  %xmm0,%xmm2
subss  %xmm0,%xmm1
divss  %xmm1,%xmm2
movaps %xmm2,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @normalize_and_interpolate(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp oeq float %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %19
11: ; preds = %3
%12 = load float, float* %6
%13 = load float, float* %4
%14 = fsub float %12, %13
%15 = load float, float* %5
%16 = load float, float* %4
%17 = fsub float %15, %16
%18 = fdiv float %14, %17
br label %19
19: ; preds = %11, %10
%20 = phi float [ 0.000000e+00, %10 ], [ %18, %11 ]
ret float %20
}

LLVM IR (-O2):
define float @normalize_and_interpolate(float %0, float %1, float %2) {
%4 = fcmp oeq float %0, %1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = fsub float %2, %0
%7 = fsub float %1, %0
%8 = fdiv float %6, %7
br label %9
9: ; preds = %3, %5
%10 = phi float [ %8, %5 ], [ 0.000000e+00, %3 ]
ret float %10
}
extern void libvampsdk_v_2_4_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_4_present() {
ret void
}
/* Variables and functions */
scalar_t__ char_colonne_valide(char);
scalar_t__ char_ligne_valide(char);
int case_valide(char colonne, char ligne) {
  return char_ligne_valide(ligne) && char_colonne_valide(colonne);
}


x86 assembly (clang, -O0):
<case_valide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <char_ligne_valide@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x3(%rbp)
je     1162 <case_valide+0x42>
movsbl -0x1(%rbp),%edi
call   1030 <char_colonne_valide@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<case_valide>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <char_ligne_valide@plt>
test   %rax,%rax
je     1144 <case_valide+0x24>
movsbl %bl,%edi
call   1030 <char_colonne_valide@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @case_valide(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i64 @char_ligne_valide(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %3
%10 = call i64 @char_colonne_valide(i8 signext %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @case_valide(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @char_ligne_valide(i8 signext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @char_colonne_valide(i8 signext %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
void hwpl_core_privcall(void (*call)(void *), void *args) { call(args); }


x86 assembly (clang, -O0):
<hwpl_core_privcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwpl_core_privcall>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @hwpl_core_privcall(void (i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ delay();
int /*<<< orphan*/ startTone(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stopTone(int /*<<< orphan*/);
void playOneTone(uint8_t freqIndex) {
  startTone(0, freqIndex);
  delay();
  stopTone(0);
}


x86 assembly (clang, -O0):
<playOneTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1050 <startTone@plt>
mov    $0x0,%al
call   1040 <delay@plt>
xor    %edi,%edi
call   1030 <stopTone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playOneTone>:
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1050 <startTone@plt>
xor    %eax,%eax
call   1040 <delay@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <stopTone@plt>

LLVM IR (-O0):
define void @playOneTone(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @startTone(i32 0, i32 %3)
%5 = call i32 (...) @delay()
%6 = call i32 @stopTone(i32 0)
ret void
}

LLVM IR (-O2):
define void @playOneTone(i32 %0) {
%2 = tail call i32 @startTone(i32 0, i32 %0)
%3 = tail call i32 (...) @delay()
%4 = tail call i32 @stopTone(i32 0)
ret void
}