xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ generics();
int /*<<< orphan*/ iterators();
int /*<<< orphan*/ observers();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  generics();
  observers();
  iterators();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <generics@plt>
xor    %eax,%eax
call   1050 <observers@plt>
xor    %eax,%eax
call   1060 <iterators@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @generics()
%8 = call i32 (...) @observers()
%9 = call i32 (...) @iterators()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @generics()
%5 = tail call i32 (...) @observers()
%6 = tail call i32 (...) @iterators()
ret i32 0
}
void fun_call2() { return; }


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

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

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

LLVM IR (-O2):
define void @fun_call2() {
ret void
}
int cmpStr(const void *pa, const void *pb) {
  char *p1 = (char *)pa;
  char *p2 = (char *)pb;
  return *p1 - *p2;
}


x86 assembly (clang, -O0):
<cmpStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpStr>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpStr(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void DaoObjectLogger_SwitchBuffer() {}


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

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

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

LLVM IR (-O2):
define void @DaoObjectLogger_SwitchBuffer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_s16(scalar_t__);
scalar_t__ plcvm_lpm_u16();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_s2_cs16(void) {
  plcvm_push(plcvm_get_s16(plcvm_pop() * 2 + plcvm_lpm_u16()));
}


x86 assembly (clang, -O0):
<cb_ldm_s2_cs16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
shl    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <plcvm_lpm_u16@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1060 <plcvm_get_s16@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_s2_cs16>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
add    %eax,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1040 <plcvm_lpm_u16@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1060 <plcvm_get_s16@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_s2_cs16() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 2
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_s16(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_s2_cs16() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 1
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_s16(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
void func4(void) {
  typedef long IDENT;
  IDENT l;
}


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

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

LLVM IR (-O0):
define void @func4() {
%1 = alloca i64
ret void
}

LLVM IR (-O2):
define void @func4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PWM2_3_DriverIRQHandler();
__attribute__((weak)) void PWM2_3_IRQHandler(void) {
  PWM2_3_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM2_3_IRQHandler() {
%1 = call i32 (...) @PWM2_3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM2_3_IRQHandler() {
%1 = tail call i32 (...) @PWM2_3_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int strlen(int /*<<< orphan*/);
int myreadlink(const char *symlink, char *p, int size) {
  FILE *fp = fopen("testcase", "r");
  if (!fp)
    exit(1);
  return strlen(fgets(p, size, fp));
}


x86 assembly (clang, -O0):
<myreadlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xea6(%rip),%rdi
lea    0xea8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117f <myreadlink+0x3f>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fgets@plt>
mov    %eax,%edi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myreadlink>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
lea    0xeb1(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     117a <myreadlink+0x3a>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strlen@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"testcase\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @myreadlink(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = icmp ne i32* %9, null
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = load i32*, i32** %7
%17 = call i32 @fgets(i8* %14, i32 %15, i32* %16)
%18 = call i32 @strlen(i32 %17)
ret i32 %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"testcase\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @myreadlink(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
%9 = tail call i32 @fgets(i8* %1, i32 %2, i32* %4)
%10 = tail call i32 @strlen(i32 %9)
ret i32 %10
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *helper(int *, int *, int /*<<< orphan*/, int /*<<< orphan*/,
                        int);
struct TreeNode *buildTree(int *preorder, int preorderSize, int *inorder,
                           int inorderSize) {
  if (!preorder || !inorder)
    return NULL;
  return helper(preorder, inorder, 0, 0, preorderSize = inorderSize - 1);
}


x86 assembly (clang, -O0):
<buildTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <buildTree+0x2c>
cmpq   $0x0,-0x20(%rbp)
jne    1149 <buildTree+0x39>
movq   $0x0,-0x8(%rbp)
jmp    116a <buildTree+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%r8d
sub    $0x1,%r8d
mov    %r8d,-0x14(%rbp)
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <helper@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildTree>:
test   %rdi,%rdi
je     112d <buildTree+0x1d>
test   %rdx,%rdx
je     112d <buildTree+0x1d>
mov    %ecx,%r8d
add    $0xffffffff,%r8d
mov    %rdx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <helper@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @buildTree(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca %struct.TreeNode*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%10 = load i32*, i32** %6
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32*, i32** %8
%14 = icmp ne i32* %13, null
br i1 %14, label %16, label %15
15: ; preds = %12, %4
store %struct.TreeNode* null, %struct.TreeNode** %5
br label %22
16: ; preds = %12
%17 = load i32*, i32** %6
%18 = load i32*, i32** %8
%19 = load i32, i32* %9
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %7
%21 = call %struct.TreeNode* @helper(i32* %17, i32* %18, i32 0, i32 0, i32 %20)
store %struct.TreeNode* %21, %struct.TreeNode** %5
br label %22
22: ; preds = %16, %15
%23 = load %struct.TreeNode*, %struct.TreeNode** %5
ret %struct.TreeNode* %23
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @buildTree(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = icmp ne i32* %0, null
%6 = icmp ne i32* %2, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = add nsw i32 %3, -1
%10 = tail call %struct.TreeNode* @helper(i32* %0, i32* %2, i32 0, i32 0, i32 %9)
br label %11
11: ; preds = %4, %8
%12 = phi %struct.TreeNode* [ %10, %8 ], [ null, %4 ]
ret %struct.TreeNode* %12
}
void swap(int *x, int *y) {
  int aux;
  aux = *x;
  *x = *y;
  *y = aux;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int __BNF_input_string(char *);
int article(void) {
  int state;
  state = __BNF_input_string("the");
  return state;
}


x86 assembly (clang, -O0):
<article>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <__BNF_input_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"the\00"
define i32 @article() {
%1 = alloca i32
%2 = call i32 @__BNF_input_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"the\00"
define i32 @article() {
%1 = tail call i32 @__BNF_input_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void rop3_17_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | S;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_17_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_17_0_1>:
xor    (%rdi),%dl
or     %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_17_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = and i32 %20, %22
%24 = load i8, i8* %7
%25 = zext i8 %24 to i32
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
%30 = or i32 %23, %29
%31 = load i8, i8* %6
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = and i32 %36, %39
%41 = or i32 %30, %40
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
store i8 %42, i8* %43
ret void
}

LLVM IR (-O2):
define void @rop3_17_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c(char *);
int /*<<< orphan*/ resolve_back();
void Loop() {
  c("(loop)");
  resolve_back();
}


x86 assembly (clang, -O0):
<Loop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <c@plt>
mov    $0x0,%al
call   1040 <resolve_back@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Loop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <c@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <resolve_back@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(loop)\00"
define void @Loop() {
%1 = call i32 @c(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @resolve_back()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"(loop)\00"
define void @Loop() {
%1 = tail call i32 @c(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @resolve_back()
ret void
}
/* Type definitions */
struct t_list {
  int dummy;
};

/* Variables and functions */
struct t_list *add_back(struct t_list *, int *, int);
struct t_list *add_back_int(struct t_list *plist, int num) {
  return plist = add_back(plist, &num, sizeof(int));
}


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

x86 assembly (clang, -O2):
<add_back_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <add_back@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_list = type { i32 }
define %struct.t_list* @add_back_int(%struct.t_list* %0, i32 %1) {
%3 = alloca %struct.t_list*
%4 = alloca i32
store %struct.t_list* %0, %struct.t_list** %3
store i32 %1, i32* %4
%5 = load %struct.t_list*, %struct.t_list** %3
%6 = call %struct.t_list* @add_back(%struct.t_list* %5, i32* %4, i32 4)
store %struct.t_list* %6, %struct.t_list** %3
ret %struct.t_list* %6
}

LLVM IR (-O2):
%struct.t_list = type { i32 }
define %struct.t_list* @add_back_int(%struct.t_list* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call %struct.t_list* @add_back(%struct.t_list* %0, i32* %3, i32 4)
ret %struct.t_list* %4
}
/* Variables and functions */
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void handler(int sig) {
  void *array[10];
  size_t size;
  size = backtrace(array, 10);
  fprintf(stderr, "Error: signal %d:\n", sig);
  backtrace_symbols_fd(array, size, 2);
  exit(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rax,-0x68(%rbp)
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rax,%rbx
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    %ebp,%edx
call   1050 <fprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8*]
%4 = alloca i64
store i32 %0, i32* %2
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%6 = call i64 @backtrace(i8** %5, i32 10)
store i64 %6, i64* %4
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%11 = load i64, i64* %4
%12 = call i32 @backtrace_symbols_fd(i8** %10, i64 %11, i32 2)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
define void @handler(i32 %0) {
%2 = alloca [10 x i8*]
%3 = bitcast [10 x i8*]* %2 to i8*
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%5 = call i64 @backtrace(i8** %4, i32 10)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @backtrace_symbols_fd(i8** %4, i64 %5, i32 2)
%9 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memory_pressure_clr();
int /*<<< orphan*/ memory_pressure_set();
void cfs_memory_pressure_restore(int old) {
  if (old)
    memory_pressure_set();
  else
    memory_pressure_clr();
  return;
}


x86 assembly (clang, -O0):
<cfs_memory_pressure_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <cfs_memory_pressure_restore+0x21>
mov    $0x0,%al
call   1030 <memory_pressure_set@plt>
jmp    1148 <cfs_memory_pressure_restore+0x28>
mov    $0x0,%al
call   1040 <memory_pressure_clr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_memory_pressure_restore>:
xor    %eax,%eax
test   %edi,%edi
je     112b <cfs_memory_pressure_restore+0xb>
jmp    1030 <memory_pressure_set@plt>
jmp    1040 <memory_pressure_clr@plt>

LLVM IR (-O0):
define void @cfs_memory_pressure_restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @memory_pressure_set()
br label %9
7: ; preds = %1
%8 = call i32 (...) @memory_pressure_clr()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @cfs_memory_pressure_restore(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @memory_pressure_set()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_pressure_clr()
br label %7
7: ; preds = %5, %3
ret void
}
double fibFP(double n) {
  if (n < 2.0) {
    return 1.0;
  }
  return fibFP(n - 2.0) + fibFP(n - 1.0);
}


x86 assembly (clang, -O0):
<fibFP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1142 <fibFP+0x32>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <fibFP+0x74>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fibFP@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fibFP@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibFP>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  0xee8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1133 <fibFP+0x23>
movsd  0xed2(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0xed5(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1030 <fibFP@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xeba(%rip),%xmm0
call   1030 <fibFP@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fibFP(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 2.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %15
7: ; preds = %1
%8 = load double, double* %3
%9 = fsub double %8, 2.000000e+00
%10 = call double @fibFP(double %9)
%11 = load double, double* %3
%12 = fsub double %11, 1.000000e+00
%13 = call double @fibFP(double %12)
%14 = fadd double %10, %13
store double %14, double* %2
br label %15
15: ; preds = %7, %6
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @fibFP(double %0) {
%2 = fcmp olt double %0, 2.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %10, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -2.000000e+00
%7 = tail call double @fibFP(double %6)
%8 = fadd double %0, -1.000000e+00
%9 = tail call double @fibFP(double %8)
%10 = fadd double %7, %9
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_rtclock_from_wallclock() {
  printf("NOT IMPLEMENTED:"
         "pa_rtclock_from_wallclock"
         "\n");
}


x86 assembly (clang, -O0):
<pa_rtclock_from_wallclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_rtclock_from_wallclock\0A\00"
define i32 @pa_rtclock_from_wallclock() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_rtclock_from_wallclock\00"
define i32 @pa_rtclock_from_wallclock() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
float sine(int);
float square(float input) {
  if (sine(input) > 0.0f)
    return 1.0f;
  else if (sine(input < 0.0f))
    return -1.0f;
  else
    return 0.0f;
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%edi
call   1030 <sine@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1145 <square+0x35>
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118a <square+0x7a>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <sine@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1170 <square+0x60>
jp     1170 <square+0x60>
jmp    1182 <square+0x72>
movss  0xe88(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118a <square+0x7a>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rax
movss  %xmm0,0x4(%rsp)
cvttss2si %xmm0,%edi
call   1030 <sine@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1132 <square+0x22>
movss  0xed0(%rip),%xmm0
pop    %rax
ret
xor    %edi,%edi
ucomiss 0x4(%rsp),%xmm1
seta   %dil
call   1030 <sine@plt>
movaps %xmm0,%xmm1
cmpneqss 0xeba(%rip),%xmm1
movss  0xeae(%rip),%xmm0
andps  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @square(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
%6 = call float @sine(i32 %5)
%7 = fcmp ogt float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store float 1.000000e+00, float* %2
br label %17
9: ; preds = %1
%10 = load float, float* %3
%11 = fcmp olt float %10, 0.000000e+00
%12 = zext i1 %11 to i32
%13 = call float @sine(i32 %12)
%14 = fcmp une float %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %9
store float -1.000000e+00, float* %2
br label %17
16: ; preds = %9
store float 0.000000e+00, float* %2
br label %17
17: ; preds = %16, %15, %8
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @square(float %0) {
%2 = fptosi float %0 to i32
%3 = tail call float @sine(i32 %2)
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = fcmp olt float %0, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = tail call float @sine(i32 %7)
%9 = fcmp une float %8, 0.000000e+00
%10 = select i1 %9, float -1.000000e+00, float 0.000000e+00
br label %11
11: ; preds = %5, %1
%12 = phi float [ 1.000000e+00, %1 ], [ %10, %5 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void display_help(const char *argv0) {
  printf("usage: %s [ --list | --scan FILE | FILE ]\n", argv0);
}


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

x86 assembly (clang, -O2):
<display_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"usage: %s [ --list | --scan FILE | FILE ]\0A\00"
define void @display_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"usage: %s [ --list | --scan FILE | FILE ]\0A\00"
define void @display_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isletter(char c) {
  return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}


x86 assembly (clang, -O0):
<isletter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <isletter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isletter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isletter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isletter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isletter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char getc();
char *gets(char buf[]) {
  char c, *ptr = buf;
  while ((c = getc()) != '\r') {
    *ptr++ = c;
  }
  *ptr = '\0';
  return (buf);
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xd,%eax
je     1153 <gets+0x43>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1124 <gets+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getc@plt>
mov    %r14,%rbx
cmp    $0xd,%al
je     1141 <gets+0x31>
mov    %r14,%rbx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rbx)
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <getc@plt>
cmp    $0xd,%al
jne    1130 <gets+0x20>
movb   $0x0,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @gets(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %10, %1
%7 = call signext i8 (...) @getc()
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 13
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %3
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
store i8 %11, i8* %12
br label %6
14: ; preds = %6
%15 = load i8*, i8** %4
store i8 0, i8* %15
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @gets(i8* returned writeonly %0) {
%2 = tail call signext i8 (...) @getc()
%3 = icmp eq i8 %2, 13
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %6
%8 = tail call signext i8 (...) @getc()
%9 = icmp eq i8 %8, 13
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i8* [ %0, %1 ], [ %7, %4 ]
store i8 0, i8* %11
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
scalar_t__ zero_or_ten(int /*<<< orphan*/);
void alloc_may_be_negative_Bad() { malloc(zero_or_ten(0) - 5); }


x86 assembly (clang, -O0):
<alloc_may_be_negative_Bad>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <zero_or_ten@plt>
mov    %rax,%rdi
sub    $0x5,%rdi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_may_be_negative_Bad>:
push   %rax
xor    %edi,%edi
call   1040 <zero_or_ten@plt>
lea    -0x5(%rax),%rdi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @alloc_may_be_negative_Bad() {
%1 = call i64 @zero_or_ten(i32 0)
%2 = sub nsw i64 %1, 5
%3 = call i32 @malloc(i64 %2)
ret void
}

LLVM IR (-O2):
define void @alloc_may_be_negative_Bad() {
%1 = tail call i64 @zero_or_ten(i32 0)
%2 = add nsw i64 %1, -5
%3 = tail call i32 @malloc(i64 %2)
ret void
}
/* Variables and functions */
int fib1();
int fib2(int param1) {
  int g29;
  int g3;
  int local5;
  if (param1 <= 1) {
    local5 = param1;
  } else {
    fib1();
    g3 = fib1();
    local5 = g29 + g3;
  }
  return local5;
}


x86 assembly (clang, -O0):
<fib2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     1130 <fib2+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114a <fib2+0x3a>
mov    $0x0,%al
call   1030 <fib1@plt>
mov    $0x0,%al
call   1030 <fib1@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib2>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1126 <fib2+0x16>
xor    %eax,%eax
call   1030 <fib1@plt>
xor    %eax,%eax
call   1030 <fib1@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fib2(i32 returned %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @fib1()
%5 = tail call i32 (...) @fib1()
br label %6
6: ; preds = %1, %3
ret i32 %0
}
void gdk_region_offset() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_offset() {
ret void
}
/* Variables and functions */
void *se_new();
__attribute__((visibility("default"))) void *sp_env(void) { return se_new(); }


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

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

LLVM IR (-O0):
define i8* @sp_env() {
%1 = call i8* (...) @se_new()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sp_env() {
%1 = tail call i8* (...) @se_new()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ Cvar_SetByName(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, float);
void Cvar_SetValueByName(char *var_name, float value) {
  char val[32];
  snprintf(val, sizeof(val), "%.8g", value);
  Cvar_SetByName(var_name, val);
}


x86 assembly (clang, -O0):
<Cvar_SetValueByName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    $0x20,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <Cvar_SetByName@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_SetValueByName>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Cvar_SetByName@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.8g\00"
define void @Cvar_SetValueByName(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store float %1, float* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load float, float* %4
%8 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @Cvar_SetByName(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.8g\00"
define void @Cvar_SetValueByName(i8* %0, float %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %1)
%6 = call i32 @Cvar_SetByName(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int range(int, int, int);
int is_WS(int c) { return (c == 32) | range(c, 9, 13); }


x86 assembly (clang, -O0):
<is_WS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9,%esi
mov    $0xd,%edx
call   1030 <range@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_WS>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x20,%edi
sete   %bl
mov    $0x9,%esi
mov    $0xd,%edx
call   1030 <range@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_WS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = call i32 @range(i32 %6, i32 9, i32 13)
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_WS(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
%4 = tail call i32 @range(i32 %0, i32 9, i32 13)
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ floats_copy(float const *, float *, int);
void floats_xyt_copy(const float xyt[3], float r[3]) { floats_copy(xyt, r, 3); }


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

x86 assembly (clang, -O2):
<floats_xyt_copy>:
mov    $0x3,%edx
jmp    1030 <floats_copy@plt>

LLVM IR (-O0):
define void @floats_xyt_copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @floats_copy(float* %5, float* %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @floats_xyt_copy(float* %0, float* %1) {
%3 = tail call i32 @floats_copy(float* %0, float* %1, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkperiod() {
  blinkdot();
  blinkdash();
  blinkdot();
  blinkdash();
  blinkdot();
  blinkdash();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkperiod>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
movsd  0xe9a(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkperiod>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
movsd  0xe9d(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkperiod() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdash()
%3 = call i32 (...) @blinkdot()
%4 = call i32 (...) @blinkdash()
%5 = call i32 (...) @blinkdot()
%6 = call i32 (...) @blinkdash()
%7 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkperiod() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 (...) @blinkdash()
%5 = tail call i32 (...) @blinkdot()
%6 = tail call i32 (...) @blinkdash()
%7 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void glIsTexture(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glIsTexture() {
ret void
}
void setup_kexec_cpu_down_xics(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_kexec_cpu_down_xics() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x07() {
  Assert_real((isprint(7) == 0),
              "/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_isprint.c",
              40, ("isprint should be 0 for 0x07"));
}


x86 assembly (clang, -O0):
<t_isprint_0x07>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x07>:
push   %rax
mov    $0x7,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28,%edx
pop    %rax
jmp    1040 <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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x07\00"
define void @t_isprint_0x07() {
%1 = call i64 @isprint(i32 7)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 40, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x07\00"
define void @t_isprint_0x07() {
%1 = tail call i64 @isprint(i32 7)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;
typedef int /*<<< orphan*/ uint;
typedef int /*<<< orphan*/ XSetWindowAttributes;
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Drawable;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void XScreenSaverSetAttributes(Display *dpy, Drawable drawable, int x, int y,
                               uint width, uint height, uint border_width,
                               int depth, uint class, Visual *visual,
                               ulong valuemask,
                               XSetWindowAttributes *attributes) {}


x86 assembly (clang, -O0):
<XScreenSaverSetAttributes>:
push   %rbp
mov    %rsp,%rbp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @XScreenSaverSetAttributes(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32* %9, i32 %10, i32* %11) {
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32*
%23 = alloca i32
%24 = alloca i32*
store i32* %0, i32** %13
store i32 %1, i32* %14
store i32 %2, i32* %15
store i32 %3, i32* %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32* %9, i32** %22
store i32 %10, i32* %23
store i32* %11, i32** %24
ret void
}

LLVM IR (-O2):
define void @XScreenSaverSetAttributes(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32* nocapture %9, i32 %10, i32* nocapture %11) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
int main(void) {
  int a;
  float b;
  a = 13 % 2;
  b = 2.0 / (1.0 + 2 - (a + 1));
  printf("El valor de a es %d y el valor de b es %f\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"El valor de a es %d y el valor de b es %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = fsub double 3.000000e+00, %6
%8 = fdiv double 2.000000e+00, %7
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load i32, i32* %2
%11 = load float, float* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %10, float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"El valor de a es %d y el valor de b es %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 1, float 2.000000e+00)
ret i32 0
}