xunge/DecIR huggingface dataset:
void U32TO8(unsigned char *p, unsigned int v) {
  p[0] = (unsigned char)((v)&0xff);
  p[1] = (unsigned char)((v >> 8) & 0xff);
  p[2] = (unsigned char)((v >> 16) & 0xff);
  p[3] = (unsigned char)((v >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<U32TO8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<U32TO8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @U32TO8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @U32TO8(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
unsigned is_prime_linear(unsigned n) {
  if (n < 2)
    return 0;
  for (unsigned i = 2; i < n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jae    111d <is_prime_linear+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1167 <is_prime_linear+0x67>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1160 <is_prime_linear+0x60>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    114d <is_prime_linear+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1167 <is_prime_linear+0x67>
jmp    1152 <is_prime_linear+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime_linear+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime_linear>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     113a <is_prime_linear+0x3a>
mov    $0x1,%eax
je     113a <is_prime_linear+0x3a>
mov    $0x0,%eax
test   $0x1,%dil
je     113a <is_prime_linear+0x3a>
mov    $0x3,%eax
xchg   %ax,%ax
mov    %eax,%ecx
cmp    %eax,%edi
je     1133 <is_prime_linear+0x33>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
lea    0x1(%rcx),%eax
test   %edx,%edx
jne    1120 <is_prime_linear+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @is_prime_linear(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %5, %11
%9 = phi i32 [ %14, %11 ], [ 3, %5 ]
%10 = icmp eq i32 %9, %0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = urem i32 %0, %9
%13 = icmp eq i32 %12, 0
%14 = add nuw i32 %9, 1
br i1 %13, label %15, label %8
15: ; preds = %8, %11
%16 = icmp uge i32 %9, %0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %3, %5, %15, %1
%19 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %5 ], [ %17, %15 ]
ret i32 %19
}
/* Variables and functions */
int __libc_msync(void *, size_t, int);
int /*<<< orphan*/ pthread_testcancel();
int msync(void *addr, size_t len, int flags) {
  pthread_testcancel();
  return __libc_msync(addr, len, flags);
}


x86 assembly (clang, -O0):
<msync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <pthread_testcancel@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <__libc_msync@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msync>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <pthread_testcancel@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__libc_msync@plt>

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

LLVM IR (-O2):
define i32 @msync(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 (...) @pthread_testcancel()
%5 = tail call i32 @__libc_msync(i8* %0, i64 %1, i32 %2)
ret i32 %5
}
void arm_mrrc2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int iterator(void *context, struct stack *stack, void *data) {
  (void)context;
  (void)stack;
  printf("%s ", (char *)data);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stack = type { i32 }
@.str = [4 x i8] c"%s \00"
define i32 @iterator(i8* %0, %struct.stack* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.stack*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.stack* %1, %struct.stack** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.stack*, %struct.stack** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.stack = type { i32 }
@.str = [4 x i8] c"%s \00"
define i32 @iterator(i8* nocapture readnone %0, %struct.stack* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ina_write(unsigned char, int, unsigned int);
void ina_set_reg(unsigned char addr, unsigned int configure,
                 unsigned int calibration) {
  ina_write(addr, 0x00, configure);
  ina_write(addr, 0x16, calibration);
}


x86 assembly (clang, -O0):
<ina_set_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
xor    %esi,%esi
movzbl %al,%edi
call   1030 <ina_write@plt>
mov    -0x1(%rbp),%al
mov    -0xc(%rbp),%edx
mov    $0x16,%esi
movzbl %al,%edi
call   1030 <ina_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ina_set_reg>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%edx
mov    %edi,%ebp
xor    %esi,%esi
call   1030 <ina_write@plt>
mov    %ebp,%edi
mov    $0x16,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ina_write@plt>

LLVM IR (-O0):
define void @ina_set_reg(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = load i32, i32* %5
%9 = call i32 @ina_write(i8 zeroext %7, i32 0, i32 %8)
%10 = load i8, i8* %4
%11 = load i32, i32* %6
%12 = call i32 @ina_write(i8 zeroext %10, i32 22, i32 %11)
ret void
}

LLVM IR (-O2):
define void @ina_set_reg(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @ina_write(i8 zeroext %0, i32 0, i32 %1)
%5 = tail call i32 @ina_write(i8 zeroext %0, i32 22, i32 %2)
ret void
}
int foo(int n, int *out) { *out = n; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret i32 undef
}
void usb_amd_dev_put(void) {}


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

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

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

LLVM IR (-O2):
define void @usb_amd_dev_put() {
ret void
}
/* Variables and functions */
scalar_t__ soc_is_s3c24xx();
unsigned long tcfg_to_divisor(unsigned long tcfg1) {
  if (soc_is_s3c24xx())
    return 1 << (tcfg1 + 1);
  else
    return 1 << tcfg1;
}


x86 assembly (clang, -O0):
<tcfg_to_divisor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <soc_is_s3c24xx@plt>
cmp    $0x0,%rax
je     1149 <tcfg_to_divisor+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    115c <tcfg_to_divisor+0x4c>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcfg_to_divisor>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <soc_is_s3c24xx@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
add    %ebx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @tcfg_to_divisor(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i64 (...) @soc_is_s3c24xx()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = shl i32 1, %9
%11 = sext i32 %10 to i64
store i64 %11, i64* %2
br label %17
12: ; preds = %1
%13 = load i64, i64* %3
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = sext i32 %15 to i64
store i64 %16, i64* %2
br label %17
17: ; preds = %12, %6
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @tcfg_to_divisor(i64 %0) {
%2 = tail call i64 (...) @soc_is_s3c24xx()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = add i64 %4, %0
%6 = trunc i64 %5 to i32
%7 = shl nuw i32 1, %6
%8 = sext i32 %7 to i64
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ LIS_NlgN(int *, int);
int main() {
  int arr[] = {2, 1, 5, 3, 6, 4, 8, 9, 7};
  int length = sizeof(arr) / sizeof(arr[0]);
  LIS_NlgN(arr, length);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x9,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <LIS_NlgN@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <LIS_NlgN@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [9 x i32] [i32 2, i32 1, i32 5, i32 3, i32 6, i32 4, i32 8, i32 9, i32 7]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca i32
%3 = bitcast [9 x i32]* %1 to i8*
store i32 9, i32* %2
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @LIS_NlgN(i32* %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [9 x i32] [i32 2, i32 1, i32 5, i32 3, i32 6, i32 4, i32 8, i32 9, i32 7]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @LIS_NlgN(i32* %3, i32 9)
ret i32 0
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_41(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 41)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_41>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x29,%eax
jne    1144 <fn_ch_41+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_41+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_41>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x29,%ecx
jne    1133 <fn_ch_41+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_ch_41(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @next_utf8(i8* %5, i32* %4)
%7 = icmp eq i32 %6, 41
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn_ch_41(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 41
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
void lcase(char *cp) {
  {
    while (*cp) {
      if ((int)*cp >= 65) {
        if ((int)*cp <= 90) {
          *cp = (char)((int)*cp + 32);
        } else {
          *cp = *cp;
        }
      } else {
        *cp = *cp;
      }
      cp++;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117a <lcase+0x7a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     115d <lcase+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <lcase+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1158 <lcase+0x58>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1169 <lcase+0x69>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <lcase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
mov    (%rdi),%al
test   %al,%al
je     112a <lcase+0x2a>
add    $0x1,%rdi
jmp    111b <lcase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lcase+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lcase+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lcase+0x10>
ret

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

LLVM IR (-O2):
define void @lcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
int Roundplus(double a) { return (a < 0 ? 0 : a + 0.5); }


x86 assembly (clang, -O0):
<Roundplus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1124 <Roundplus+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1136 <Roundplus+0x36>
movsd  0xed4(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Roundplus>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @Roundplus(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fadd double %7, 5.000000e-01
br label %9
9: ; preds = %6, %5
%10 = phi double [ 0.000000e+00, %5 ], [ %8, %6 ]
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @Roundplus(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fadd double %0, 5.000000e-01
%4 = select i1 %2, double 0.000000e+00, double %3
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int imgfile_seek_internal(int /*<<< orphan*/, int, int);
bool imgfile_seek_cdda(uint32_t sec) {
  return imgfile_seek_internal(sec, 0x12, false);
}


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

x86 assembly (clang, -O2):
<imgfile_seek_cdda>:
mov    $0x12,%esi
xor    %edx,%edx
jmp    1030 <imgfile_seek_internal@plt>

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

LLVM IR (-O2):
define i32 @imgfile_seek_cdda(i32 %0) {
%2 = tail call i32 @imgfile_seek_internal(i32 %0, i32 18, i32 0)
ret i32 %2
}
/* Variables and functions */
int lib2fun();
int lib3fun();
int libfun() { return lib2fun() + lib3fun(); }


x86 assembly (clang, -O0):
<libfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lib2fun@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lib3fun@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libfun>:
push   %rbx
xor    %eax,%eax
call   1040 <lib2fun@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <lib3fun@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @libfun() {
%1 = call i32 (...) @lib2fun()
%2 = call i32 (...) @lib3fun()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @libfun() {
%1 = tail call i32 (...) @lib2fun()
%2 = tail call i32 (...) @lib3fun()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ line_Comment(int /*<<< orphan*/ *);
int binary(int c, FILE *source_file) {
  if (c == '0' || c == '1')
    return (c - 48);
  else if (c == '#' || c == ';')
    line_Comment(source_file);
  return -1;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x30,-0x8(%rbp)
je     1133 <binary+0x23>
cmpl   $0x31,-0x8(%rbp)
jne    1141 <binary+0x31>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <binary+0x5a>
cmpl   $0x23,-0x8(%rbp)
je     1155 <binary+0x45>
cmpl   $0x3b,-0x8(%rbp)
jne    115e <binary+0x4e>
mov    -0x10(%rbp),%rdi
call   1030 <line_Comment@plt>
jmp    1163 <binary+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
push   %rbx
mov    %edi,%eax
and    $0xfffffffe,%eax
cmp    $0x30,%eax
jne    1122 <binary+0x12>
add    $0xffffffd0,%edi
mov    %edi,%ebx
jmp    1139 <binary+0x29>
mov    $0xffffffff,%ebx
cmp    $0x3b,%edi
je     1131 <binary+0x21>
cmp    $0x23,%edi
jne    1139 <binary+0x29>
mov    %rsi,%rdi
call   1030 <line_Comment@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @binary(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 48
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 48
store i32 %13, i32* %3
br label %25
14: ; preds = %8
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 35
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 59
br i1 %19, label %20, label %23
20: ; preds = %17, %14
%21 = load i32*, i32** %5
%22 = call i32 @line_Comment(i32* %21)
br label %23
23: ; preds = %20, %17
br label %24
24: ; preds = %23
store i32 -1, i32* %3
br label %25
25: ; preds = %24, %11
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @binary(i32 %0, i32* %1) {
%3 = and i32 %0, -2
%4 = icmp eq i32 %3, 48
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = add nsw i32 %0, -48
br label %10
7: ; preds = %2
switch i32 %0, label %10 [
i32 59, label %8
i32 35, label %8
]
8: ; preds = %7, %7
%9 = tail call i32 @line_Comment(i32* %1)
br label %10
10: ; preds = %8, %7, %5
%11 = phi i32 [ %6, %5 ], [ -1, %7 ], [ -1, %8 ]
ret i32 %11
}
/* Variables and functions */
int strvalid(const char *buffer, size_t bufferlen) {
  size_t i;
  for (i = 0; i < bufferlen; i++)
    if (buffer[i] == '\0')
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<strvalid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1159 <strvalid+0x59>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1143 <strvalid+0x43>
movl   $0x1,-0x4(%rbp)
jmp    1160 <strvalid+0x60>
jmp    1148 <strvalid+0x48>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <strvalid+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strvalid>:
test   %rsi,%rsi
je     111f <strvalid+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strvalid+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strvalid+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strvalid(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %6
4: ; preds = %6
%5 = icmp eq i64 %11, %1
br i1 %5, label %12, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %11, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = add nuw i64 %7, 1
br i1 %10, label %12, label %4
12: ; preds = %6, %4, %2
%13 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %6 ]
ret i32 %13
}
/* Variables and functions */
int lgetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ remove_blanks(char *);
int main(void) {
  char line[1000];
  int len;
  while ((len = lgetline(line, 1000)) > 0) {
    remove_blanks(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <lgetline@plt>
mov    %eax,-0x3f4(%rbp)
cmp    $0x0,%eax
jle    1186 <main+0x56>
lea    -0x3f0(%rbp),%rdi
call   1050 <remove_blanks@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <lgetline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1050 <remove_blanks@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <lgetline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @lgetline(i8* %5, i32 1000)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = call i32 @remove_blanks(i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @lgetline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @remove_blanks(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @lgetline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ while_upto20(int);
void call_while_upto20_minus100_constant() { while_upto20(-100); }


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

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

LLVM IR (-O0):
define void @call_while_upto20_minus100_constant() {
%1 = call i32 @while_upto20(i32 -100)
ret void
}

LLVM IR (-O2):
define void @call_while_upto20_minus100_constant() {
%1 = tail call i32 @while_upto20(i32 -100)
ret void
}
double fun(double x, double y) { return (x + y) * (x + y); }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
addsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @fun(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fadd double %8, %9
%11 = fmul double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @fun(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("I'm matching\n");
  printf("All the expect blocks\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"I'm matching\0A\00"
@.str.1 = [23 x i8] c"All the expect blocks\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"I'm matching\00"
@str.2 = [22 x i8] c"All the expect blocks\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
iswild(str) char *str;
{
  char c;
  while ((c = *str++) != '\0')
    if (c == '*' || c == '?')
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iswild>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1153 <iswild+0x53>
movsbl -0x11(%rbp),%eax
cmp    $0x2a,%eax
je     1142 <iswild+0x42>
movsbl -0x11(%rbp),%eax
cmp    $0x3f,%eax
jne    114e <iswild+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    115a <iswild+0x5a>
jmp    1108 <iswild+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswild>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
test   %cl,%cl
je     1126 <iswild+0x26>
cmp    $0x3f,%cl
je     1125 <iswild+0x25>
add    $0x1,%rdi
cmp    $0x2a,%cl
jne    1110 <iswild+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iswild(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
switch i8 %4, label %2 [
i8 63, label %8
i8 42, label %8
]
8: ; preds = %2, %6, %6
%9 = phi i32 [ 1, %6 ], [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int mg_is_big_endian(void) {
  static const int n = 1;
  return ((char *)&n)[0] == 0;
}


x86 assembly (clang, -O0):
<mg_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xef5(%rip),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@mg_is_big_endian.n = internal constant i32 1
define i32 @mg_is_big_endian() {
%1 = load i8, i8* bitcast (i32* @mg_is_big_endian.n to i8*)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @mg_is_big_endian() {
ret i32 0
}
int test_imm_CFint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xCF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CFint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 889058230272
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ get_voltage(float *);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ stderr;
void show_voltage(void) {
  float mv;
  if (get_voltage(&mv)) {
    fprintf(stderr, "Error reading voltage\n");
    return;
  }
  printf("%4.0f\n", mv);
}


x86 assembly (clang, -O0):
<show_voltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <get_voltage@plt>
cmp    $0x0,%rax
je     1165 <show_voltage+0x35>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1176 <show_voltage+0x46>
movss  -0x4(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_voltage>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <get_voltage@plt>
test   %rax,%rax
je     1157 <show_voltage+0x27>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1050 <fprintf@plt>
pop    %rax
ret
movss  0x4(%rsp),%xmm0
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Error reading voltage\0A\00"
@.str.1 = [7 x i8] c"%4.0f\0A\00"
define void @show_voltage() {
%1 = alloca float
%2 = call i64 @get_voltage(float* %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = load float, float* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %8)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error reading voltage\0A\00"
@.str.1 = [7 x i8] c"%4.0f\0A\00"
define void @show_voltage() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @get_voltage(float* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = load float, float* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %9)
br label %11
11: ; preds = %8, %5
ret void
}
/* Type definitions */
typedef int const uint32_t;

/* Variables and functions */
int const hash_rot(int const, int);
uint32_t hash_boolean(bool x, uint32_t basis) {
  const uint32_t P0 = 0xc2b73583;
  const uint32_t P1 = 0xe90f1258;
  return (x ? P0 : P1) ^ hash_rot(basis, 1);
}


x86 assembly (clang, -O0):
<hash_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xc2b73583,-0xc(%rbp)
movl   $0xe90f1258,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xe90f1258,%eax
mov    $0xc2b73583,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <hash_rot@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_boolean>:
push   %rbx
test   %edi,%edi
mov    $0xe90f1258,%eax
mov    $0xc2b73583,%ebx
cmove  %eax,%ebx
mov    %esi,%edi
mov    $0x1,%esi
call   1030 <hash_rot@plt>
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_boolean(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
store i32 -1028180605, i32* %5
store i32 -384888232, i32* %6
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1028180605, i32 -384888232
%11 = load i32, i32* %4
%12 = call i32 @hash_rot(i32 %11, i32 1)
%13 = xor i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash_boolean(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -384888232, i32 -1028180605
%5 = tail call i32 @hash_rot(i32 %1, i32 1)
%6 = xor i32 %5, %4
ret i32 %6
}
/* Variables and functions */
double exp(double);
double rq_pricing_norm_density(double x) {
  return 0.39894228040143 * exp(-(x * x) / 2.0);
}


x86 assembly (clang, -O0):
<rq_pricing_norm_density>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xea6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_norm_density>:
push   %rax
mulsd  %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rq_pricing_norm_density(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fneg double %5
%7 = fdiv double %6, 2.000000e+00
%8 = call double @exp(double %7)
%9 = fmul double 0x3FD9884533D43620, %8
ret double %9
}

LLVM IR (-O2):
define double @rq_pricing_norm_density(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = fmul double %3, 5.000000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 0x3FD9884533D43620
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ ifly_error_txt(char *);
void ifly_error_gui(char *message) { ifly_error_txt(message); }


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

x86 assembly (clang, -O2):
<ifly_error_gui>:
jmp    1030 <ifly_error_txt@plt>

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

LLVM IR (-O2):
define void @ifly_error_gui(i8* %0) {
%2 = tail call i32 @ifly_error_txt(i8* %0)
ret void
}
/* Type definitions */
typedef int bool_t;

/* Variables and functions */
bool_t xdr_void(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @xdr_void() {
ret i32 1
}

LLVM IR (-O2):
define i32 @xdr_void() {
ret i32 1
}
/* Type definitions */
struct timex {
  scalar_t__ modes;
};

/* Variables and functions */
int TIME_ERROR;
int adjtimex(struct timex *);
int ntp_sync(void) {
  int rc;
  struct timex timex;
  timex.modes = 0;
  rc = adjtimex(&timex);
  return (rc >= 0 && rc != TIME_ERROR);
}


x86 assembly (clang, -O0):
<ntp_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <adjtimex@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jl     114d <ntp_sync+0x3d>
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntp_sync>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <adjtimex@plt>
test   %eax,%eax
setns  %cl
mov    0x2ebb(%rip),%rdx
cmp    (%rdx),%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timex = type { i64 }
@TIME_ERROR = global i32 0
define i32 @ntp_sync() {
%1 = alloca i32
%2 = alloca %struct.timex
%3 = getelementptr inbounds %struct.timex, %struct.timex* %2, i32 0, i32 0
store i64 0, i64* %3
%4 = call i32 @adjtimex(%struct.timex* %2)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %1
%9 = load i32, i32* @TIME_ERROR
%10 = icmp ne i32 %8, %9
br label %11
11: ; preds = %7, %0
%12 = phi i1 [ false, %0 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.timex = type { i64 }
@TIME_ERROR = global i32 0
define i32 @ntp_sync() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
store i64 0, i64* %3
%4 = call i32 @adjtimex(%struct.timex* %1)
%5 = icmp sgt i32 %4, -1
%6 = load i32, i32* @TIME_ERROR
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void Q_strncpyz(char *dest, const char *src, int destsize) {
  if (!dest) {
    ;
  }
  if (!src) {
    ;
  }
  if (destsize < 1) {
    ;
  }
  strncpy(dest, src, destsize - 1);
  dest[destsize - 1] = 0;
}


x86 assembly (clang, -O0):
<Q_strncpyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <Q_strncpyz+0x23>
jmp    1133 <Q_strncpyz+0x23>
cmpq   $0x0,-0x10(%rbp)
jne    1143 <Q_strncpyz+0x33>
jmp    1143 <Q_strncpyz+0x33>
cmpl   $0x1,-0x14(%rbp)
jge    1152 <Q_strncpyz+0x42>
jmp    1152 <Q_strncpyz+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Q_strncpyz(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 i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %3
br label %10
10: ; preds = %9, %3
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %10
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %14
br label %18
18: ; preds = %17, %14
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = call i32 @strncpy(i8* %19, i8* %20, i32 %22)
%24 = load i8*, i8** %4
%25 = load i32, i32* %6
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
store i8 0, i8* %28
ret void
}

LLVM IR (-O2):
define void @Q_strncpyz(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
scalar_t__ floor(double);
int rounded(double f) { return (int)(f > 0 ? floor(f + 0.5) : ceil(f - 0.5)); }


x86 assembly (clang, -O0):
<rounded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <rounded+0x3a>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
jmp    1174 <rounded+0x54>
movsd  -0x8(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounded>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    113a <rounded+0x1a>
addsd  0xed5(%rip),%xmm0
call   1040 <floor@plt>
pop    %rcx
ret
addsd  0xebe(%rip),%xmm0
call   1030 <ceil@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rounded(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call i64 @floor(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = call i64 @ceil(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi i64 [ %8, %5 ], [ %12, %9 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @rounded(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call i64 @floor(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call i64 @ceil(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
%11 = trunc i64 %10 to i32
ret i32 %11
}