xunge/DecIR huggingface dataset:
int cmovdiff(int x, int y) {
  int tval = y - x;
  int rval = x - y;
  int test = x < y;
  if (test)
    rval = tval;
  return rval;
}


x86 assembly (clang, -O0):
<cmovdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113d <cmovdiff+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmovdiff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cmovdiff(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONUniProbL(const struct feature_pair *pair,
                       const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniProbL(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniProbL(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
int do_708() { return 708; }


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

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

LLVM IR (-O0):
define i32 @do_708() {
ret i32 708
}

LLVM IR (-O2):
define i32 @do_708() {
ret i32 708
}
int ui_init_swarmcmds(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ui_init_swarmcmds() {
ret i32 0
}
extern __attribute__((visibility("default"))) int call_i(int (*func)(int),
                                                         int arg) {
  return func(arg);
}


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

x86 assembly (clang, -O2):
<call_i>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @call_i(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
/* Type definitions */
struct xml_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _xml_dump_tree(struct xml_node *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ xml_malloc(int);
int xml_tree_size(struct xml_node *);
char *xml_dump_tree(struct xml_node *root) {
  int xml_size;
  char *xml_buf;
  xml_size = xml_tree_size(root);
  xml_buf = (char *)xml_malloc(xml_size + 1);
  memset(xml_buf, 0, xml_size + 1);
  _xml_dump_tree(root, xml_buf);
  return xml_buf;
}


x86 assembly (clang, -O0):
<xml_dump_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xml_tree_size@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <xml_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <_xml_dump_tree@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_dump_tree>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <xml_tree_size@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1040 <xml_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <_xml_dump_tree@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.xml_node = type { i32 }
define i8* @xml_dump_tree(%struct.xml_node* %0) {
%2 = alloca %struct.xml_node*
%3 = alloca i32
%4 = alloca i8*
store %struct.xml_node* %0, %struct.xml_node** %2
%5 = load %struct.xml_node*, %struct.xml_node** %2
%6 = call i32 @xml_tree_size(%struct.xml_node* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i64 @xml_malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = call i32 @memset(i8* %11, i32 0, i32 %13)
%15 = load %struct.xml_node*, %struct.xml_node** %2
%16 = load i8*, i8** %4
%17 = call i32 @_xml_dump_tree(%struct.xml_node* %15, i8* %16)
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
%struct.xml_node = type { i32 }
define i8* @xml_dump_tree(%struct.xml_node* %0) {
%2 = tail call i32 @xml_tree_size(%struct.xml_node* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @xml_malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memset(i8* %5, i32 0, i32 %3)
%7 = tail call i32 @_xml_dump_tree(%struct.xml_node* %0, i8* %5)
ret i8* %5
}
unsigned long bswap(unsigned long a) {
  return (((a & 0xff0000) >> 8) + ((a & 0xff00) << 8) + (a << 24) + (a >> 24));
}


x86 assembly (clang, -O0):
<bswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff0000,%rax
shr    $0x8,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap>:
mov    %rdi,%rax
shr    $0x8,%rax
and    $0xff00,%eax
mov    %edi,%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %rax,%rcx
mov    %rdi,%rax
shl    $0x18,%rax
shr    $0x18,%rdi
add    %rdi,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @bswap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 16711680
%5 = lshr i64 %4, 8
%6 = load i64, i64* %2
%7 = and i64 %6, 65280
%8 = shl i64 %7, 8
%9 = add i64 %5, %8
%10 = load i64, i64* %2
%11 = shl i64 %10, 24
%12 = add i64 %9, %11
%13 = load i64, i64* %2
%14 = lshr i64 %13, 24
%15 = add i64 %12, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @bswap(i64 %0) {
%2 = lshr i64 %0, 8
%3 = and i64 %2, 65280
%4 = shl i64 %0, 8
%5 = and i64 %4, 16711680
%6 = or i64 %3, %5
%7 = shl i64 %0, 24
%8 = lshr i64 %0, 24
%9 = add i64 %8, %7
%10 = add i64 %9, %6
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x56() {
  Assert_real((ispunct(86) == 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_ispunct.c",
              435, ("ispunct should be 0 for V"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x56>:
push   %rax
mov    $0x56,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1b3,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for V\00"
define void @t_ispunct_0x56() {
%1 = call i64 @ispunct(i32 86)
%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 435, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for V\00"
define void @t_ispunct_0x56() {
%1 = tail call i64 @ispunct(i32 86)
%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 435, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int a = 0;
  int b = 1;
  int c = 2;
  while (1) {
    printf("a=%d b=%d c=%d *c=%d=%08x\n", a, b, c, &c, &c);
    c++;
    bar();
    foo();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe8c(%rip),%rdi
lea    -0x10(%rbp),%r9
mov    %r9,%r8
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <sleep@plt>
jmp    1164 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x2,0x4(%rsp)
mov    $0x2,%ecx
lea    0xea8(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %rbx,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x1,0x4(%rsp)
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1050 <foo@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
mov    0x4(%rsp),%ecx
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [27 x i8] c"a=%d b=%d c=%d *c=%d=%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %0, %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32* %4, i32* %4)
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = call i32 (...) @bar()
%13 = call i32 (...) @foo()
%14 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
br label %5
}

LLVM IR (-O2):
@.str = [27 x i8] c"a=%d b=%d c=%d *c=%d=%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ %11, %3 ], [ 2, %0 ]
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 %4, i32* %1, i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = call i32 (...) @bar()
%9 = call i32 (...) @foo()
%10 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%11 = load i32, i32* %1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void check(char *msg, int c) {
  if (c < 0) {
    perror(msg);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1149 <check+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %esi,%esi
js     1125 <check+0x5>
ret
push   %rax
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @check(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
ret void
}
void av_codec_get_max_lowres() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_get_max_lowres() {
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pthread_exit(void *);
void thrd_exit(int res) {
  void *pres = malloc(sizeof(int));
  if (pres != (void *)0) {
    *(int *)pres = res;
  }
  pthread_exit(pres);
}


x86 assembly (clang, -O0):
<thrd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <thrd_exit+0x2d>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrd_exit>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1134 <thrd_exit+0x14>
mov    %ebx,(%rax)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @thrd_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
%13 = call i32 @pthread_exit(i8* %12)
ret void
}

LLVM IR (-O2):
define void @thrd_exit(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast i8* %2 to i32*
store i32 %0, i32* %5
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @pthread_exit(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_func1();
int /*<<< orphan*/ printf(char *);
void func1(void) {
  printf("\n Inside func1 \n");
  int i = 0;
  for (; i < 0xffffffff; i++)
    ;
  new_func1();
  return;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jae    1158 <func1+0x38>
jmp    114a <func1+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <func1+0x1b>
mov    $0x0,%al
call   1030 <new_func1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A Inside func1 \0A\00"
define void @func1() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
%11 = call i32 (...) @new_func1()
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"\0A Inside func1 \00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
float ctss_fast_cos(float);
float ctss_fast_sin(const float x) {
  return ctss_fast_cos((0.5f * 3.1415926535897932384626433832795029f) - x);
}


x86 assembly (clang, -O0):
<ctss_fast_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
call   1030 <ctss_fast_cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_fast_sin>:
movss  0xee8(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
jmp    1030 <ctss_fast_cos@plt>

LLVM IR (-O0):
define float @ctss_fast_sin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 0x3FF921FB60000000, %3
%5 = call float @ctss_fast_cos(float %4)
ret float %5
}

LLVM IR (-O2):
define float @ctss_fast_sin(float %0) {
%2 = fsub float 0x3FF921FB60000000, %0
%3 = tail call float @ctss_fast_cos(float %2)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int internal_export_list_keys(int /*<<< orphan*/, void **);
int /*<<< orphan*/ pidstr(int /*<<< orphan*/);
int keyzen_process_list_keys(pid_t pid, void **list) {
  return internal_export_list_keys(pidstr(pid), list);
}


x86 assembly (clang, -O0):
<keyzen_process_list_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pidstr@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <internal_export_list_keys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyzen_process_list_keys>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pidstr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <internal_export_list_keys@plt>

LLVM IR (-O0):
define i32 @keyzen_process_list_keys(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 = call i32 @pidstr(i32 %5)
%7 = load i8**, i8*** %4
%8 = call i32 @internal_export_list_keys(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @keyzen_process_list_keys(i32 %0, i8** %1) {
%3 = tail call i32 @pidstr(i32 %0)
%4 = tail call i32 @internal_export_list_keys(i32 %3, i8** %1)
ret i32 %4
}
int main(void) {
  int counter;
  for (counter = 0; counter < 5; counter++) {
    if (4 == counter) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1142 <main+0x42>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    112f <main+0x2f>
jmp    1142 <main+0x42>
jmp    1134 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int raise(int signo) { return kill(getpid(), signo); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
signed long signedlong_ignoring_longdouble(signed long x, long double y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlong_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @signedlong_ignoring_longdouble(i64 %0, x86_fp80 %1) {
%3 = alloca i64
%4 = alloca x86_fp80
store i64 %0, i64* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
int convert(int src) {
  if (src == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <convert+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <convert+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @convert(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gh_term_putc(char);
void gh_term_puts(const char *s) {
  char c;
  while ((c = *s++) != '\0') {
    gh_term_putc(c);
  }
}


x86 assembly (clang, -O0):
<gh_term_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <gh_term_puts+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <gh_term_putc@plt>
jmp    111c <gh_term_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gh_term_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <gh_term_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <gh_term_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <gh_term_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gh_term_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @gh_term_putc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int add_fd(int fd, fd_set *set, int nfds) {
  if (fd > 0) {
    FD_SET(fd, set);
    return fd > nfds ? fd : nfds;
  } else
    return nfds;
}


x86 assembly (clang, -O0):
<add_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1160 <add_fd+0x50>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <FD_SET@plt>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    114f <add_fd+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <add_fd+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <add_fd+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
test   %edi,%edi
jle    1125 <add_fd+0x15>
mov    %edi,%ebp
call   1030 <FD_SET@plt>
cmp    %ebx,%ebp
cmovg  %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @add_fd(i32 %0, i32* %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = tail call i32 @FD_SET(i32 %0, i32* %1)
%7 = icmp sgt i32 %0, %2
%8 = select i1 %7, i32 %0, i32 %2
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %8, %5 ], [ %2, %3 ]
ret i32 %10
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t times(struct tms *buffer) { return 0; }


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
ret i32 0
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int);
int getopt_long_only(int argc, char *const *argv, const char *options,
                     const struct option *long_options, int *opt_index) {
  return _getopt_internal(argc, argv, options, long_options, opt_index, 1);
}


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

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

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

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int mp_snprint_recursion(char *, int, char const **, int);
int mp_snprint(char *buf, int size, const char *data) {
  return mp_snprint_recursion(buf, size, &data, 32);
}


x86 assembly (clang, -O0):
<mp_snprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdx
mov    $0x20,%ecx
call   1030 <mp_snprint_recursion@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_snprint>:
push   %rax
mov    %rdx,(%rsp)
mov    %rsp,%rdx
mov    $0x20,%ecx
call   1030 <mp_snprint_recursion@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mp_snprint(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @mp_snprint_recursion(i8* %7, i32 %8, i8** %6, i32 32)
ret i32 %9
}

LLVM IR (-O2):
define i32 @mp_snprint(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
store i8* %2, i8** %4
%5 = call i32 @mp_snprint_recursion(i8* %0, i32 %1, i8** %4, i32 32)
ret i32 %5
}
void airtime_policy_update_deinit(struct hostapd_iface *iface) {}


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

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

LLVM IR (-O0):
%struct.hostapd_iface = type opaque
define void @airtime_policy_update_deinit(%struct.hostapd_iface* %0) {
%2 = alloca %struct.hostapd_iface*
store %struct.hostapd_iface* %0, %struct.hostapd_iface** %2
ret void
}

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @airtime_policy_update_deinit(%struct.hostapd_iface* nocapture %0) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i != 0) {
    if (i > -5 && i < 5) {
      if (i < 0) {
        i = i + 1;
      }
      if (i > 0) {
        i = i - 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 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1177 <main+0x67>
cmpl   $0xfffffffb,-0x8(%rbp)
jle    1172 <main+0x62>
cmpl   $0x5,-0x8(%rbp)
jge    1172 <main+0x62>
cmpl   $0x0,-0x8(%rbp)
jge    115a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    116d <main+0x5d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <main+0x62>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quicksort_index_recursive(int *, int *, int /*<<< orphan*/,
                                             int, int);
void quicksort_index_ascending(int *array, int *idx, int length) {
  quicksort_index_recursive(array, idx, 0, length, 1);
}


x86 assembly (clang, -O0):
<quicksort_index_ascending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %edx,%edx
mov    $0x1,%r8d
call   1030 <quicksort_index_recursive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_index_ascending>:
mov    %edx,%ecx
xor    %edx,%edx
mov    $0x1,%r8d
jmp    1030 <quicksort_index_recursive@plt>

LLVM IR (-O0):
define void @quicksort_index_ascending(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @quicksort_index_recursive(i32* %7, i32* %8, i32 0, i32 %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @quicksort_index_ascending(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @quicksort_index_recursive(i32* %0, i32* %1, i32 0, i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cycle_brent(int *, int /*<<< orphan*/, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char *argv[1]) {
  int seq[] = {3, 4, 8, 0, 11, 9, 7, 2, 5, 6, 10, 1, 49, 49, 49, 49};
  int lam, mu;
  cycle_brent(seq, 0, &lam, &mu);
  printf("lam: %d, mu: %d\n", lam, mu);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
lea    -0x54(%rbp),%rdx
lea    -0x58(%rbp),%rcx
call   1050 <cycle_brent@plt>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %esi,%esi
call   1040 <cycle_brent@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.seq = [16 x i32] [i32 3, i32 4, i32 8, i32 0, i32 11, i32 9, i32 7, i32 2, i32 5, i32 6, i32 10, i32 1, i32 49, i32 49, i32 49, i32 49]
@.str = [17 x i8] c"lam: %d, mu: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [16 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = bitcast [16 x i32]* %5 to i8*
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%10 = call i32 @cycle_brent(i32* %9, i32 0, i32* %6, i32* %7)
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.seq = [16 x i32] [i32 3, i32 4, i32 8, i32 0, i32 11, i32 9, i32 7, i32 2, i32 5, i32 6, i32 10, i32 1, i32 49, i32 49, i32 49, i32 49]
@.str = [17 x i8] c"lam: %d, mu: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [16 x i32]* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%10 = call i32 @cycle_brent(i32* %9, i32 0, i32* %4, i32* %5)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}
puts(ss) char *ss;
{
  int i;
  char t;
  i = 0;
  while (t = *ss++) {
    if (t >= 'a' && t <= 'z')
      t = +'A' - 'a';
    putchar(t);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x15(%rbp)
cmp    $0x0,%al
je     116d <puts+0x5d>
movsbl -0x15(%rbp),%eax
cmp    $0x61,%eax
jl     115d <puts+0x4d>
movsbl -0x15(%rbp),%eax
cmp    $0x7a,%eax
jg     115d <puts+0x4d>
movb   $0xe0,-0x15(%rbp)
movsbl -0x15(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1123 <puts+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1151 <puts+0x41>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0xe0,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x61(%rax),%ecx
cmp    $0x1a,%cl
movzbl %al,%eax
cmovb  %ebp,%eax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %20, %1
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
store i8 %9, i8* %5
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %20
19: ; preds = %15
store i8 -32, i8* %5
br label %20
20: ; preds = %19, %15, %11
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %22)
br label %6
24: ; preds = %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i8 %5, -97
%9 = icmp ult i8 %8, 26
%10 = select i1 %9, i8 -32, i8 %5
%11 = sext i8 %10 to i32
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %11)
%13 = load i8, i8* %7
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ log_write(char *, char *, int /*<<< orphan*/, int);
int log_warning(char *msg, char *sensor) { log_write(msg, sensor, 0, 1); }


x86 assembly (clang, -O0):
<log_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <log_write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_warning>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <log_write@plt>

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

LLVM IR (-O2):
define i32 @log_warning(i8* %0, i8* %1) {
%3 = tail call i32 @log_write(i8* %0, i8* %1, i32 0, i32 1)
ret i32 undef
}
int foo(int a) { return a ? 1 : 5; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x5,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 5
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 5, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
void file_source_close(void *handle) { fclose(handle); }


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

x86 assembly (clang, -O2):
<file_source_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @file_source_close(i8* nocapture %0) {
%2 = tail call i32 @fclose(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M401_f(char *s) {
  debug("M401_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M401_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    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"M401_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M401_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 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 = [47 x i8] c"M401_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M401_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 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
}
void foo_1_2_2_1_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_2_1_2_1_2() {
ret void
}
void write_long(unsigned long data, unsigned long addr) {
  *(volatile unsigned long *)addr = data;
}


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

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

LLVM IR (-O0):
define void @write_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @write_long(i64 %0, i64 %1) {
%3 = inttoptr i64 %1 to i64*
store volatile i64 %0, i64* %3
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void DESConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  ui32Config |=
      ((*((volatile unsigned long *)(ui32Base + 0x00000020))) & 0x80000000);
  (*((volatile unsigned long *)(ui32Base + 0x00000020))) = ui32Config;
}


x86 assembly (clang, -O0):
<DESConfigSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
movabs $0x80000000,%rax
and    %rax,%rcx
mov    -0x10(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESConfigSet>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x8(%rsp),%rax
mov    0x20(%rax),%rax
and    $0x80000000,%eax
or     %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
mov    %rax,0x20(%rcx)
ret

LLVM IR (-O0):
define void @DESConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = add i64 %5, 32
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 2147483648
%10 = load volatile i64, i64* %4
%11 = or i64 %10, %9
store volatile i64 %11, i64* %4
%12 = load volatile i64, i64* %4
%13 = load volatile i64, i64* %3
%14 = add i64 %13, 32
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
ret void
}

LLVM IR (-O2):
define void @DESConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = add i64 %5, 32
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 2147483648
%10 = load volatile i64, i64* %4
%11 = or i64 %10, %9
store volatile i64 %11, i64* %4
%12 = load volatile i64, i64* %4
%13 = load volatile i64, i64* %3
%14 = add i64 %13, 32
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
ret void
}