xunge/DecIR huggingface dataset:
unsigned char *cpuidGetId() { return (unsigned char *)(0x1FFFF7E8); }


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

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

LLVM IR (-O0):
define i8* @cpuidGetId() {
ret i8* inttoptr (i64 536868840 to i8*)
}

LLVM IR (-O2):
define i8* @cpuidGetId() {
ret i8* inttoptr (i64 536868840 to i8*)
}
/* Variables and functions */
int ss2qsr();
int ss2qsr_() { return ss2qsr(); }


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

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

LLVM IR (-O0):
define i32 @ss2qsr_() {
%1 = call i32 (...) @ss2qsr()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ss2qsr_() {
%1 = tail call i32 (...) @ss2qsr()
ret i32 %1
}
/* Variables and functions */
int isxdigit(int);
int ishexnumber(int c) { return isxdigit(c); }


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

x86 assembly (clang, -O2):
<ishexnumber>:
jmp    1030 <isxdigit@plt>

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

LLVM IR (-O2):
define i32 @ishexnumber(i32 %0) {
%2 = tail call i32 @isxdigit(i32 %0)
ret i32 %2
}
void DMA_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void lisp_defvar(const char *name, int value) {
  printf("(defvar *%s* %d)\n", name, value);
}


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

x86 assembly (clang, -O2):
<lisp_defvar>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"(defvar *%s* %d)\0A\00"
define void @lisp_defvar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"(defvar *%s* %d)\0A\00"
define void @lisp_defvar(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
unsigned long djb2(char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <djb2+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void strip(char *str, int size) {
  char c;
  size--;
  while (((c = str[--size]) == ' ' || c == '\t') && size >= 0) {
    str[size] = 0;
  }
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0x20,%eax
je     1148 <strip+0x48>
movsbl -0xd(%rbp),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0xe(%rbp)
jne    1152 <strip+0x52>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    1162 <strip+0x62>
jmp    1173 <strip+0x73>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1114 <strip+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
movslq %esi,%rax
mov    -0x2(%rdi,%rax,1),%cl
cmp    $0x20,%cl
setne  %dl
cmp    $0x9,%cl
setne  %cl
test   %cl,%dl
jne    1145 <strip+0x45>
cmp    $0x2,%esi
jl     1145 <strip+0x45>
add    $0xfffffffffffffffe,%rax
movb   $0x0,(%rdi,%rax,1)
movzbl -0x1(%rdi,%rax,1),%ecx
cmp    $0x20,%cl
setne  %dl
cmp    $0x9,%cl
setne  %cl
test   %cl,%dl
jne    1145 <strip+0x45>
lea    -0x1(%rax),%rcx
test   %rax,%rax
mov    %rcx,%rax
jg     1120 <strip+0x20>
ret

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

LLVM IR (-O2):
define void @strip(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
%8 = icmp eq i8 %6, 9
%9 = or i1 %7, %8
%10 = icmp sgt i32 %1, 1
%11 = and i1 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %2, %12
%13 = phi i64 [ %15, %12 ], [ %4, %2 ]
%14 = phi i8* [ %16, %12 ], [ %5, %2 ]
store i8 0, i8* %14
%15 = add nsw i64 %13, -1
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 32
%19 = icmp eq i8 %17, 9
%20 = or i1 %18, %19
%21 = icmp sgt i64 %13, 0
%22 = select i1 %20, i1 %21, i1 false
br i1 %22, label %12, label %23
23: ; preds = %12, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintPointerMap(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_pointer_map(void) {
  PrintPointerMap(stdout);
  return;
}


x86 assembly (clang, -O0):
<print_pointer_map>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <PrintPointerMap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pointer_map>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <PrintPointerMap@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_pointer_map() {
%1 = load i32, i32* @stdout
%2 = call i32 @PrintPointerMap(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_pointer_map() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @PrintPointerMap(i32 %1)
ret void
}
void ASN1_tag2str(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_tag2str() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
unsigned char *cvector(int nl, int nh) {
  unsigned char *v;
  v = (unsigned char *)malloc(
      (size_t)((nh - nl + 1 + 1) * sizeof(unsigned char)));
  if (!v)
    nrerror("allocation failure in cvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<cvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <cvector+0x41>
lea    0xea4(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
add    $0x2,%esi
movslq %esi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <cvector+0x26>
lea    0xebf(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
sub    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in cvector()\00"
define i8* @cvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 1
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load i8*, i8** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i8, i8* %20, i64 %23
%25 = getelementptr inbounds i8, i8* %24, i64 1
ret i8* %25
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in cvector()\00"
define i8* @cvector(i32 %0, i32 %1) {
%3 = sub i32 2, %0
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i8*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = getelementptr inbounds i8, i8* %14, i64 1
ret i8* %15
}
/* Variables and functions */
int compute_fst(char const *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  if (argc < 2)
    return 1;
  printf("%d\n", compute_fst(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <compute_fst@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1148 <main+0x28>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <compute_fst@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @compute_fst(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 0, i32* %3
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @compute_fst(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__4__GeneralIO__clr();
void CC2420ReceiveP__CSN__clr(void) { Msp430GpioC__4__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ReceiveP__CSN__clr() {
%1 = tail call i32 (...) @Msp430GpioC__4__GeneralIO__clr()
ret void
}
void RGB24ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @RGB24ToARGB() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
long duration(struct timeval *st, struct timeval *ed) {
  return (((ed->tv_sec * 1000000) + ed->tv_usec) -
          ((st->tv_sec * 1000000) + st->tv_usec)) /
         1000;
}


x86 assembly (clang, -O0):
<duration>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0xf4240,(%rax),%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   $0xf4240,(%rcx),%ecx
mov    -0x8(%rbp),%rdx
add    0x4(%rdx),%ecx
sub    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<duration>:
mov    (%rsi),%eax
mov    0x4(%rsi),%ecx
sub    (%rdi),%eax
sub    0x4(%rdi),%ecx
imul   $0xf4240,%eax,%eax
add    %eax,%ecx
movslq %ecx,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @duration(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = load %struct.timeval*, %struct.timeval** %4
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, 1000000
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = add nsw i32 %16, %19
%21 = sub nsw i32 %12, %20
%22 = sdiv i32 %21, 1000
%23 = sext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @duration(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sub i32 %4, %8
%12 = mul i32 %11, 1000000
%13 = sub i32 %6, %10
%14 = add i32 %13, %12
%15 = sdiv i32 %14, 1000
%16 = sext i32 %15 to i64
ret i64 %16
}
float posAfterNoMax(float s, float start, float speed) {
  return start + speed * s;
}


x86 assembly (clang, -O0):
<posAfterNoMax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<posAfterNoMax>:
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @posAfterNoMax(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %6
%9 = load float, float* %4
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float %7)
ret float %10
}

LLVM IR (-O2):
define float @posAfterNoMax(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %1)
ret float %4
}
/* Variables and functions */
int __VERIFIER_nondet_bool();
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  bool selector = __VERIFIER_nondet_bool();
  int *ptr;
  if (!selector) {
    ptr = malloc(sizeof(int));
  }
  if (!selector) {
    *ptr = 666;
    free(ptr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_bool@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1161 <main+0x31>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    117e <main+0x4e>
mov    -0x10(%rbp),%rax
movl   $0x29a,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_bool@plt>
test   %eax,%eax
jne    1154 <main+0x24>
mov    $0x4,%edi
call   1050 <malloc@plt>
movl   $0x29a,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_bool()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32* @malloc(i32 4)
store i32* %8, i32** %3
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = load i32*, i32** %3
store i32 666, i32* %13
%14 = load i32*, i32** %3
%15 = call i32 @free(i32* %14)
br label %16
16: ; preds = %12, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_bool()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32* @malloc(i32 4)
store i32 666, i32* %4
%5 = tail call i32 @free(i32* %4)
br label %6
6: ; preds = %0, %3
ret i32 0
}
void something_else() {}


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

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

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

LLVM IR (-O2):
define void @something_else() {
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
double powerof2(uint64_t n) {
  union {
    double f;
    uint64_t u;
  } x;
  x.u = 0x3ff0000000000000LL;
  x.u += n * (1ULL << 52);
  return x.f;
}


x86 assembly (clang, -O0):
<powerof2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x34,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerof2>:
shl    $0x34,%rdi
movabs $0x3ff0000000000000,%rax
add    %rdi,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @powerof2(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = bitcast %union.anon* %3 to i64*
store i64 4607182418800017408, i64* %4
%5 = load i64, i64* %2
%6 = mul i64 %5, 4503599627370496
%7 = bitcast %union.anon* %3 to i64*
%8 = load i64, i64* %7
%9 = add i64 %8, %6
store i64 %9, i64* %7
%10 = bitcast %union.anon* %3 to double*
%11 = load double, double* %10
ret double %11
}

LLVM IR (-O2):
define double @powerof2(i64 %0) {
%2 = shl i64 %0, 52
%3 = add i64 %2, 4607182418800017408
%4 = bitcast i64 %3 to double
ret double %4
}
int f(int x) { return x; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int EBUSY;
int /*<<< orphan*/ abort();
int pthread_rwlock_trywrlock(int /*<<< orphan*/ *);
int __safe_p_rwlock_trywrlock(pthread_rwlock_t *rw) {
  int en = pthread_rwlock_trywrlock(rw);
  if (en != 0 && en != EBUSY) {
    abort();
  }
  return en;
}


x86 assembly (clang, -O0):
<__safe_p_rwlock_trywrlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_rwlock_trywrlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <__safe_p_rwlock_trywrlock+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
je     115b <__safe_p_rwlock_trywrlock+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_rwlock_trywrlock>:
push   %rax
call   1040 <pthread_rwlock_trywrlock@plt>
test   %eax,%eax
je     1135 <__safe_p_rwlock_trywrlock+0x15>
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
jne    1137 <__safe_p_rwlock_trywrlock+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@EBUSY = global i32 0
define i32 @__safe_p_rwlock_trywrlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_rwlock_trywrlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* @EBUSY
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EBUSY = global i32 0
define i32 @__safe_p_rwlock_trywrlock(i32* %0) {
%2 = tail call i32 @pthread_rwlock_trywrlock(i32* %0)
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @EBUSY
%5 = icmp eq i32 %2, %4
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i32 %2
}
/* Variables and functions */
scalar_t__ CallBack3(int, void *, char *, void *);
int CleanupName(int beLiberal, char *name, int maxNameChars) {
  return (int)CallBack3(152, (void *)beLiberal, name, (void *)maxNameChars);
}


x86 assembly (clang, -O0):
<CleanupName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rcx
mov    $0x98,%edi
call   1030 <CallBack3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CleanupName>:
mov    %rsi,%rax
movslq %edi,%rsi
movslq %edx,%rcx
mov    $0x98,%edi
mov    %rax,%rdx
jmp    1030 <CallBack3@plt>

LLVM IR (-O0):
define i32 @CleanupName(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = call i64 @CallBack3(i32 152, i8* %9, i8* %10, i8* %13)
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @CleanupName(i32 %0, i8* %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i8*
%6 = sext i32 %2 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i64 @CallBack3(i32 152, i8* %5, i8* %1, i8* %7)
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x06() {
  Assert_real((isascii(6)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              35, ("isascii should be 1 for 0x06"));
}


x86 assembly (clang, -O0):
<t_isascii_0x06>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x06>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x23,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x06\00"
define void @t_isascii_0x06() {
%1 = call i32 @isascii(i32 6)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x06\00"
define void @t_isascii_0x06() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G54_f(char *s) {
  debug("G54_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G54_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G54_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G54_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G54_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G54_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G54_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
struct dnaSeq {
  int dummy;
};

/* Variables and functions */
struct dnaSeq *faReadSeq(char *, int /*<<< orphan*/);
struct dnaSeq *faReadAa(char *fileName) {
  return faReadSeq(fileName, 0);
}


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

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

LLVM IR (-O0):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAa(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.dnaSeq* @faReadSeq(i8* %3, i32 0)
ret %struct.dnaSeq* %4
}

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAa(i8* %0) {
%2 = tail call %struct.dnaSeq* @faReadSeq(i8* %0, i32 0)
ret %struct.dnaSeq* %2
}
/* Type definitions */
typedef int u_int8_t;
typedef int u_int16_t;

/* Variables and functions */
u_int8_t emultiply(u_int8_t a, u_int8_t b) {
  u_int16_t p = a * b;
  return p >> 8;
}


x86 assembly (clang, -O0):
<emultiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emultiply>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @emultiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 8
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long visualid;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
void set_XVisualInfo_visualid(void *_p, unsigned long _v) {
  ((XVisualInfo *)_p)->visualid = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XVisualInfo_visualid>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XVisualInfo_visualid(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XVisualInfo_visualid(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void panic(char *str) {
  fprintf(stderr, "Caught panic: %s", str);
  _exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Caught panic: %s\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @_exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Caught panic: %s\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @_exit(i32 2)
unreachable
}
/* Variables and functions */
int f(int);
int i(int, int);
int /*<<< orphan*/ k(int);
int j(int x) {
  int z, u;
  k(3);
  z = f(x - 1);
  u = i(z, z + x);
  return z - u;
}


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
call   1050 <k@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x4(%rbp),%esi
call   1040 <i@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x3,%edi
call   1050 <k@plt>
lea    -0x1(%rbx),%edi
call   1030 <f@plt>
mov    %eax,%ebp
add    %eax,%ebx
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <i@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @j(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @k(i32 3)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @f(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
%13 = call i32 @i(i32 %9, i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @j(i32 %0) {
%2 = tail call i32 @k(i32 3)
%3 = add nsw i32 %0, -1
%4 = tail call i32 @f(i32 %3)
%5 = add nsw i32 %4, %0
%6 = tail call i32 @i(i32 %4, i32 %5)
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void nested(int *x) {
  int i, j;
outer:
  for (i = 0; i < 10; i++) {
  inner:
    for (j = 0; j < 10; j++) {
      *x += i;
      *x += j;
    }
  }
}


x86 assembly (clang, -O0):
<nested>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1166 <nested+0x66>
jmp    111e <nested+0x1e>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1153 <nested+0x53>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <nested+0x25>
jmp    1158 <nested+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <nested+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nested>:
addl   $0x384,(%rdi)
ret

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

LLVM IR (-O2):
define void @nested(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 900
store i32 %3, i32* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ nitems;
};
typedef TYPE_1__ XTextProperty;

/* Variables and functions */
unsigned long get_XTextProperty_nitems(void *_p) {
  return (unsigned long)((XTextProperty *)_p)->nitems;
}


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

x86 assembly (clang, -O2):
<get_XTextProperty_nitems>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XTextProperty_nitems(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XTextProperty_nitems(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ send_http_error(int, char *, char const *);
void send_403_forbidden_msg(int clientsock, const char *msg) {
  send_http_error(clientsock, "403 Forbidden", msg);
}


x86 assembly (clang, -O0):
<send_403_forbidden_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <send_http_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_403_forbidden_msg>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <send_http_error@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"403 Forbidden\00"
define void @send_403_forbidden_msg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @send_http_error(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"403 Forbidden\00"
define void @send_403_forbidden_msg(i32 %0, i8* %1) {
%3 = tail call i32 @send_http_error(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
signed char C_Utils_max_sbyte(const signed char item1,
                              const signed char item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_sbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <C_Utils_max_sbyte+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <C_Utils_max_sbyte+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @C_Utils_max_sbyte(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ test_multi();
int /*<<< orphan*/ test_wide();
int main() {
  test_multi();
  test_wide();
  sleep(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_multi@plt>
xor    %eax,%eax
call   1040 <test_wide@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_multi()
%2 = tail call i32 (...) @test_wide()
%3 = tail call i32 @sleep(i32 1)
ret i32 0
}
int at_client_ready() { return 0; }


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

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

LLVM IR (-O0):
define i32 @at_client_ready() {
ret i32 0
}

LLVM IR (-O2):
define i32 @at_client_ready() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("%d", a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, void const *,
                               int /*<<< orphan*/);
void sig_blockset(const void *set) { sigprocmask(SIG_SETMASK, set, 0); }


x86 assembly (clang, -O0):
<sig_blockset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_blockset>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <sigprocmask@plt>

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

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @sig_blockset(i8* %0) {
%2 = load i32, i32* @SIG_SETMASK
%3 = tail call i32 @sigprocmask(i32 %2, i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_shared(void) { printf("test_shared called\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"test_shared called\0A\00"
define void @test_shared() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"test_shared called\00"
define void @test_shared() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_C0int8_reg(signed char val) {
  return ((val) & (-0xC0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C0int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -192
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}