xunge/DecIR huggingface dataset:
int val_seg_alaw(int val) {
  int r = 1;
  val >>= 8;
  if (val & 0xf0) {
    val >>= 4;
    r += 4;
  }
  if (val & 0x0c) {
    val >>= 2;
    r += 2;
  }
  if (val & 0x02)
    r += 1;
  return r;
}


x86 assembly (clang, -O0):
<val_seg_alaw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
cmp    $0x0,%eax
je     113a <val_seg_alaw+0x3a>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc,%eax
cmp    $0x0,%eax
je     115b <val_seg_alaw+0x5b>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1173 <val_seg_alaw+0x73>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_seg_alaw>:
xor    %edx,%edx
test   $0xf000,%edi
setne  %dl
lea    0x0(,%rdx,4),%ecx
or     $0x8,%cl
sar    %cl,%edi
lea    0x1(,%rdx,4),%ecx
mov    %edi,%eax
shr    $0x2,%eax
test   $0xc,%dil
lea    0x3(,%rdx,4),%edx
cmove  %edi,%eax
cmove  %ecx,%edx
shr    %eax
and    $0x1,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @val_seg_alaw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 8
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 240
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* %2
%11 = ashr i32 %10, 4
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 4
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %1
%15 = load i32, i32* %2
%16 = and i32 %15, 12
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %2
%20 = ashr i32 %19, 2
store i32 %20, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 2
store i32 %22, i32* %3
br label %23
23: ; preds = %18, %14
%24 = load i32, i32* %2
%25 = and i32 %24, 2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %27, %23
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @val_seg_alaw(i32 %0) {
%2 = and i32 %0, 61440
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 8, i32 12
%5 = ashr i32 %0, %4
%6 = select i1 %3, i32 1, i32 5
%7 = and i32 %5, 12
%8 = icmp eq i32 %7, 0
%9 = lshr i32 %5, 2
%10 = or i32 %6, 2
%11 = select i1 %8, i32 %5, i32 %9
%12 = select i1 %8, i32 %6, i32 %10
%13 = lshr i32 %11, 1
%14 = and i32 %13, 1
%15 = add nuw nsw i32 %14, %12
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ strlcpy(char *, char *, int);
void vlas(int size) {
  char z[size];
  char str[] = "hi";
  strlcpy(z, str, sizeof(str));
}


x86 assembly (clang, -O0):
<vlas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x19(%rbp)
lea    -0x1b(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strlcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
movb   $0x0,-0x2(%rbp)
movw   $0x6968,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strlcpy@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@__const.vlas.str = [3 x i8] c"hi\00"
define void @vlas(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [3 x i8]
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = bitcast [3 x i8]* %5 to i8*
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlcpy(i8* %9, i8* %11, i32 3)
%13 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__const.vlas.str = [3 x i8] c"hi\00"
define void @vlas(i32 %0) {
%2 = alloca [3 x i8]
%3 = zext i32 %0 to i64
%4 = alloca i8, i64 %3
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlcpy(i8* %4, i8* %5, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ on_exit(void *, void *);
void AtExit(void (*handler)(void)) { on_exit((void *)handler, ((void *)0)); }


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

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

LLVM IR (-O0):
define void @AtExit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to i8*
%5 = call i32 @on_exit(i8* %4, i8* null)
ret void
}

LLVM IR (-O2):
define void @AtExit(void ()* %0) {
%2 = bitcast void ()* %0 to i8*
%3 = tail call i32 @on_exit(i8* %2, i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void do_alrm(int s) {
  printf("not ok 1 - tcpfullwindowrst\n");
  exit(0);
}


x86 assembly (clang, -O0):
<do_alrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [29 x i8] c"not ok 1 - tcpfullwindowrst\0A\00"
define void @do_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"not ok 1 - tcpfullwindowrst\00"
define void @do_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_debug_level(void) {
  record_linux_param_description(
      "tcp_linux.c", "debug_level",
      "The debug level: 0: INFO; <=1: NOTICE; <=2: ERROR");
}


x86 assembly (clang, -O0):
<module_param_desc_debug_level>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xeef(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_debug_level>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xef3(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"tcp_linux.c\00"
@.str.1 = [12 x i8] c"debug_level\00"
@.str.2 = [50 x i8] c"The debug level: 0: INFO; <=1: NOTICE; <=2: ERROR\00"
define void @module_param_desc_debug_level() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"tcp_linux.c\00"
@.str.1 = [12 x i8] c"debug_level\00"
@.str.2 = [50 x i8] c"The debug level: 0: INFO; <=1: NOTICE; <=2: ERROR\00"
define void @module_param_desc_debug_level() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ErrHandler(char *);
void SigAlrm(int sigNo) { ErrHandler("Timeout error, connection stopped!!"); }


x86 assembly (clang, -O0):
<SigAlrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <ErrHandler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SigAlrm>:
lea    0xee9(%rip),%rdi
jmp    1030 <ErrHandler@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Timeout error, connection stopped!!\00"
define void @SigAlrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ErrHandler(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Timeout error, connection stopped!!\00"
define void @SigAlrm(i32 %0) {
%2 = tail call i32 @ErrHandler(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long fib(unsigned long);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  register unsigned long IMax, value;
  IMax = 30;
  printf("\n");
  printf("Fibonacci Benchmark\n");
  value = fib(IMax);
  printf("\n");
  printf("The %02d'th Fibonacci Number is: %d\n", IMax, value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1e,-0x10(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fib@plt>
mov    %rax,-0x18(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1e,%edi
call   1060 <fib@plt>
mov    %rax,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe8b(%rip),%rdi
mov    $0x1e,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [21 x i8] c"Fibonacci Benchmark\0A\00"
@.str.2 = [37 x i8] c"The %02d'th Fibonacci Number is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 30, i64* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = load i64, i64* %2
%7 = call i64 @fib(i64 %6)
store i64 %7, i64* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 %9, i64 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [37 x i8] c"The %02d'th Fibonacci Number is: %d\0A\00"
@str = [20 x i8] c"Fibonacci Benchmark\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i64 @fib(i64 30)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 30, i64 %3)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int inb(unsigned short);
int /*<<< orphan*/ printf(char *, unsigned short, int);
int main(int argc, char **argv) {
  unsigned short int status = 0x379;
  printf("port 0x%X : %X\n", status, inb(status) & 0xF0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x379,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,-0x14(%rbp)
movzwl -0x12(%rbp),%edi
call   1040 <inb@plt>
mov    %eax,%edx
mov    -0x14(%rbp),%ax
and    $0xf0,%edx
lea    0xea0(%rip),%rdi
movzwl %ax,%esi
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x379,%edi
call   1040 <inb@plt>
and    $0xf0,%eax
lea    0xec9(%rip),%rdi
mov    $0x379,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"port 0x%X : %X\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 889, i16* %6
%7 = load i16, i16* %6
%8 = load i16, i16* %6
%9 = call i32 @inb(i16 zeroext %8)
%10 = and i32 %9, 240
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i16 zeroext %7, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"port 0x%X : %X\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @inb(i16 zeroext 889)
%4 = and i32 %3, 240
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i16 zeroext 889, i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int main() {
  test1();
  printf("------2----------\n");
  printf("------end----------\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [18 x i8] c"------2----------\00"
@str.2 = [20 x i8] c"------end----------\00"
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int drand48();
double asec_domain(void) { return (1 / (2 * drand48() - 1)); }


x86 assembly (clang, -O0):
<asec_domain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
mov    %eax,%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<asec_domain>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <drand48@plt>
lea    (%rax,%rax,1),%ecx
add    $0xffffffff,%ecx
add    %eax,%eax
cmp    $0x3,%eax
cmovae %ebx,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @asec_domain() {
%1 = call i32 (...) @drand48()
%2 = mul nsw i32 2, %1
%3 = sub nsw i32 %2, 1
%4 = sdiv i32 1, %3
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @asec_domain() {
%1 = tail call i32 (...) @drand48()
%2 = shl nsw i32 %1, 1
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %2, 3
%5 = select i1 %4, i32 %3, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
char *strchr(s, c)
register const char *s;
int c;
{
  do {
    if (*s == c) {
      return (char *)s;
    }
  } while (*s++);
  return (0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <strchr+0x4d>
jmp    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i8* [ %4, %3 ], [ null, %8 ]
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_getc(int /*<<< orphan*/ *);
int __wrap__IO_getc(FILE *stream) { return dll_getc(stream); }


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

x86 assembly (clang, -O2):
<__wrap__IO_getc>:
jmp    1030 <dll_getc@plt>

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

LLVM IR (-O2):
define i32 @__wrap__IO_getc(i32* %0) {
%2 = tail call i32 @dll_getc(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dma_cache_wback_inv(unsigned long, long);
void fd_cacheflush(char *addr, long size) {
  dma_cache_wback_inv((unsigned long)addr, size);
}


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

x86 assembly (clang, -O2):
<fd_cacheflush>:
jmp    1030 <dma_cache_wback_inv@plt>

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

LLVM IR (-O2):
define void @fd_cacheflush(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @dma_cache_wback_inv(i64 %3, i64 %1)
ret void
}
unsigned int f25(unsigned int x, unsigned int y) {
  return (x >> (8 * sizeof(unsigned int) - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f25>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
mov    $0x20,%ecx
sub    %rdx,%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f25>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f25(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 = zext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
%10 = lshr i32 %5, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = xor i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f25(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = lshr i32 %0, %3
%5 = shl i32 %0, %1
%6 = xor i32 %4, %5
ret i32 %6
}
int _min(const int first, const int second) {
  if (first <= second)
    return first;
  else
    return second;
}


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

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

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

LLVM IR (-O2):
define i32 @_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
set_signals() {}


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

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

LLVM IR (-O0):
define i32 @set_signals() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @set_signals() {
ret i32 undef
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, void const *, size_t);
ssize_t write_auto_resume(int fd, const void *buffer, size_t n) {
  ssize_t m = 0;
  do {
    m = write(fd, buffer, n);
  } while (m == -1 && errno == EINTR);
  return m;
}


x86 assembly (clang, -O0):
<write_auto_resume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    1166 <write_auto_resume+0x56>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    112a <write_auto_resume+0x1a>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_auto_resume>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    114b <write_auto_resume+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <write_auto_resume+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @write_auto_resume(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @write(i32 %9, i8* %10, i64 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @write_auto_resume(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int __islower_impl(int);
int islower(int c) { return __islower_impl(c); }


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

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

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = tail call i32 @__islower_impl(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SSIDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000024))) |= ui32DMAFlags;
}


x86 assembly (clang, -O0):
<SSIDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDMAEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x24(%rcx)
ret

LLVM IR (-O0):
define void @SSIDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 36
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SSIDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 36
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
void fa29(void) {
P0A:
  goto P0A;
  ({
    a:
      ({
        p012A:
          goto p012A;
          goto a;
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa29>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa29+0x4>

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

LLVM IR (-O0):
define void @fa29() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %8
br label %10
10: ; preds = %10, %9
br label %10
11: ; preds = %11
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa29() {
br label %1
1: ; preds = %1, %0
br label %1
}
int test_imm_41uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 65
%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_41uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4259840
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int do_914() { return 914; }


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

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

LLVM IR (-O0):
define i32 @do_914() {
ret i32 914
}

LLVM IR (-O2):
define i32 @do_914() {
ret i32 914
}
int isalpha(int c) {
  return (((c) <= (0x5a)) && ((c) >= (0x41))) ||
         (((c) <= (0x7a)) && ((c) >= (0x61)));
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5a,-0x4(%rbp)
jg     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jg     1139 <isalpha+0x39>
cmpl   $0x61,-0x4(%rbp)
setge  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 90
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 65
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 97
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void error_pointer_compare(int *a, int __attribute((unit("m"))) * b) { a == b; }


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

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

LLVM IR (-O0):
define void @error_pointer_compare(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 eq i32* %5, %6
%8 = zext i1 %7 to i32
ret void
}

LLVM IR (-O2):
define void @error_pointer_compare(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t clamp64(int64_t x, int64_t minval, int64_t maxval) {
  if (x < minval)
    return minval;
  if (x > maxval)
    return maxval;
  return x;
}


x86 assembly (clang, -O0):
<clamp64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <clamp64+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp64+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <clamp64+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp64+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp64>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clamp64(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail(char *, char *, int, char *);
void reach_error() {
  __assert_fail("0", "minepump_spec2_product33.cil.c", 3, "reach_error");
}


x86 assembly (clang, -O0):
<reach_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x3,%edx
lea    0xef3(%rip),%rcx
call   1030 <__assert_fail@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reach_error>:
lea    0xee9(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xefc(%rip),%rcx
mov    $0x3,%edx
jmp    1030 <__assert_fail@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [31 x i8] c"minepump_spec2_product33.cil.c\00"
@.str.2 = [12 x i8] c"reach_error\00"
define void @reach_error() {
%1 = call i32 @__assert_fail(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [31 x i8] c"minepump_spec2_product33.cil.c\00"
@.str.2 = [12 x i8] c"reach_error\00"
define void @reach_error() {
%1 = tail call i32 @__assert_fail(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
int strlen(char const *);
int resultlen(const char *result) {
  const char *hpos = strchr(result, '-');
  if (hpos)
    return hpos - result;
  return strlen(result);
}


x86 assembly (clang, -O0):
<resultlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115c <resultlen+0x3c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1168 <resultlen+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resultlen>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1137 <resultlen+0x17>
sub    %ebx,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @resultlen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 45)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %2
br label %19
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = call i32 @strlen(i8* %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @resultlen(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 45)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
br label %11
9: ; preds = %1
%10 = tail call i32 @strlen(i8* %0)
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ %8, %4 ], [ %10, %9 ]
ret i32 %12
}
double coco_min_double(const double a, const double b) {
  if (a <= b) {
    return a;
  } else {
    return b;
  }
}


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

x86 assembly (clang, -O2):
<coco_min_double>:
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @coco_min_double(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
unsigned ZopfliGetDistExtraBitsValue(unsigned dist) {
  if (dist < 5) {
    return 0;
  }
  int l = 31 ^ __builtin_clz(dist - 1);
  return (dist - (1 + (1 << l))) & ((1 << (l - 1)) - 1);
}


x86 assembly (clang, -O0):
<ZopfliGetDistExtraBitsValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jae    111d <ZopfliGetDistExtraBitsValue+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115a <ZopfliGetDistExtraBitsValue+0x5a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    $0x1,%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZopfliGetDistExtraBitsValue>:
xor    %eax,%eax
cmp    $0x5,%edi
jb     112a <ZopfliGetDistExtraBitsValue+0x2a>
lea    -0x1(%rdi),%eax
bsr    %eax,%ecx
mov    $0xfffffffe,%edx
rol    %cl,%edx
mov    %ecx,%eax
xor    $0x1f,%eax
mov    $0x1e,%cl
sub    %al,%cl
mov    $0xffffffff,%eax
shl    %cl,%eax
add    %edi,%edx
not    %eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ZopfliGetDistExtraBitsValue(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, 5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %23
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub i32 %9, 1
%11 = call i32 @llvm.ctlz.i32(i32 %10, i1 true)
%12 = xor i32 31, %11
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = add nsw i32 1, %15
%17 = sub i32 %13, %16
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = shl i32 1, %19
%21 = sub nsw i32 %20, 1
%22 = and i32 %17, %21
store i32 %22, i32* %2
br label %23
23: ; preds = %8, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ZopfliGetDistExtraBitsValue(i32 %0) {
%2 = icmp ult i32 %0, 5
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = xor i32 %5, 31
%7 = shl nuw i32 1, %6
%8 = xor i32 %7, -1
%9 = add i32 %8, %0
%10 = sub nsw i32 30, %5
%11 = shl nsw i32 -1, %10
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
br label %14
14: ; preds = %1, %3
%15 = phi i32 [ %13, %3 ], [ 0, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help() {
  printf("author ltw:4/12/2008 d/m/Y\n");
  printf("Usage:\n\tltwbase64 -s string -t e\n\tltwbase64 -s string -t d\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"author ltw:4/12/2008 d/m/Y\0A\00"
@.str.1 = [60 x i8] c"Usage:\0A\09ltwbase64 -s string -t e\0A\09ltwbase64 -s string -t d\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [27 x i8] c"author ltw:4/12/2008 d/m/Y\00"
@str.2 = [59 x i8] c"Usage:\0A\09ltwbase64 -s string -t e\0A\09ltwbase64 -s string -t d\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ MD5(unsigned char const *, size_t, unsigned char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void saslc__crypto_md5_hash(const char *buf, size_t buflen,
                            unsigned char *digest) {
  assert(digest != NULL);
  if (digest != NULL)
    (void)MD5((const unsigned char *)buf, buflen, digest);
}


x86 assembly (clang, -O0):
<saslc__crypto_md5_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
je     1162 <saslc__crypto_md5_hash+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <MD5@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saslc__crypto_md5_hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %rdx,%rdx
setne  %dil
call   1030 <assert@plt>
test   %rbx,%rbx
je     1154 <saslc__crypto_md5_hash+0x34>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <MD5@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @saslc__crypto_md5_hash(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = load i8*, i8** %6
%17 = call i32 @MD5(i8* %14, i64 %15, i8* %16)
br label %18
18: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
define void @saslc__crypto_md5_hash(i8* %0, i64 %1, i8* %2) {
%4 = icmp ne i8* %2, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
br i1 %4, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @MD5(i8* %0, i64 %1, i8* %2)
br label %9
9: ; preds = %7, %3
ret void
}
void XSetOCValues() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void print_help(char **argv, int32_t num_of_measurements_default) {
  fprintf(stderr,
          "Usage:\n"
          "%s [-h|-?|-n MEASUREMENTS]\n\n"
          "-h              | Print this help message.\n"
          "-?              | Print this help message.\n"
          "-n MEASUREMENTS | Number of measurements.\n"
          "                | Default: %i.\n"
          "\n",
          argv[0], num_of_measurements_default);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0xc(%rbp),%ecx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    %esi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedb(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [196 x i8] c"Usage:\0A%s [-h|-?|-n MEASUREMENTS]\0A\0A-h | Print this help message.\0A-? | Print this help message.\0A-n MEASUREMENTS | Number of measurements.\0A | Default: %i.\0A\0A\00"
define void @print_help(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = load i32, i32* %4
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [196 x i8] c"Usage:\0A%s [-h|-?|-n MEASUREMENTS]\0A\0A-h | Print this help message.\0A-? | Print this help message.\0A-n MEASUREMENTS | Number of measurements.\0A | Default: %i.\0A\0A\00"
define void @print_help(i8** nocapture %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %0
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %1)
ret void
}
void lgdt(void *ptr) { __asm__ __volatile__("lgdt (%0)" : : "r"(ptr)); }


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

x86 assembly (clang, -O2):
<lgdt>:
lgdt   (%rdi)
ret

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

LLVM IR (-O2):
define void @lgdt(i8* %0) {
tail call void asm sideeffect "lgdt ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}