xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ diag(char *, char const *, char const *);
int /*<<< orphan*/ ok(int, char *);
scalar_t__ strcmp(char const *, char const *);
void is_str(const char *got, const char *expect, char *name) {
  if (strcmp(got, expect) == 0)
    ok(1, name);
  else {
    ok(0, name);
    diag("got '%s' expected '%s'", got, expect);
  }
}


x86 assembly (clang, -O0):
<is_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    116e <is_str+0x3e>
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
call   1030 <ok@plt>
jmp    118d <is_str+0x5d>
mov    -0x18(%rbp),%rsi
xor    %edi,%edi
call   1030 <ok@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe78(%rip),%rdi
call   1040 <diag@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <strcmp@plt>
test   %rax,%rax
je     1169 <is_str+0x39>
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <ok@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <diag@plt>
mov    $0x1,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ok@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"got '%s' expected '%s'\00"
define void @is_str(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = call i32 @ok(i32 1, i8* %12)
br label %20
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = call i32 @ok(i32 0, i8* %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18)
br label %20
20: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"got '%s' expected '%s'\00"
define void @is_str(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ok(i32 1, i8* %2)
br label %11
8: ; preds = %3
%9 = tail call i32 @ok(i32 0, i8* %2)
%10 = tail call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %11
11: ; preds = %8, %6
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *system_alloc(void *allocator_data, size_t size) {
  (void)allocator_data;
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<system_alloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @system_alloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
void func_a() { *((volatile char *)0x0) = 0x123; }


x86 assembly (clang, -O0):
<func_a>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movb   $0x23,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_a>:
movb   $0x23,0x0
23
ret

LLVM IR (-O0):
define void @func_a() {
store volatile i8 35, i8* null
ret void
}

LLVM IR (-O2):
define void @func_a() {
store volatile i8 35, i8* null
ret void
}
int test005_rtp(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test005_rtp() {
ret i32 0
}
int test_imm_3Bint8_reg(signed char val) {
  return ((val) & (0x3B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Bint8_reg>:
test   $0x3b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Bint8_reg(i8 signext %0) {
%2 = and i8 %0, 59
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fct(int *);
int main(int argc, char **argv) {
  int value1 = 42;
  int buffer[5];
  int value2 = 42;
  fct(buffer);
  return value1 != 42 || value2 != 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2a,-0x14(%rbp)
movl   $0x2a,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <fct@plt>
mov    $0x1,%al
cmpl   $0x2a,-0x14(%rbp)
mov    %al,-0x35(%rbp)
jne    1156 <main+0x46>
cmpl   $0x2a,-0x34(%rbp)
setne  %al
mov    %al,-0x35(%rbp)
mov    -0x35(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <fct@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [5 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 42, i32* %6
store i32 42, i32* %8
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%10 = call i32 @fct(i32* %9)
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 42
br i1 %12, label %16, label %13
13: ; preds = %2
%14 = load i32, i32* %8
%15 = icmp ne i32 %14, 42
br label %16
16: ; preds = %13, %2
%17 = phi i1 [ true, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @fct(i32* %5)
ret i32 0
}
int fsm_char(int in) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fsm_char(i32 %0) {
ret i32 0
}
/* Variables and functions */
int getpid();
int gettid();
int /*<<< orphan*/ printf(char *, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *start_routine(void *arg) {
  int x = *(int *)arg;
  printf("x = %c, PID = %d, TID = %d, PTHID = %lu\n", x, getpid(), gettid(),
         pthread_self());
  sleep(5);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<start_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1070 <pthread_self@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    %eax,%r8d
lea    0xe57(%rip),%rdi
call   1050 <printf@plt>
mov    $0x5,%edi
call   1080 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_routine>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%r14d
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <gettid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <pthread_self@plt>
lea    0xe79(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1050 <printf@plt>
mov    $0x5,%edi
call   1080 <sleep@plt>
xor    %edi,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"x = %c, PID = %d, TID = %d, PTHID = %lu\0A\00"
define i8* @start_routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (...) @getpid()
%10 = call i32 (...) @gettid()
%11 = call i32 (...) @pthread_self()
%12 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11)
%13 = call i32 @sleep(i32 5)
%14 = call i32 @pthread_exit(i32* null)
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [41 x i8] c"x = %c, PID = %d, TID = %d, PTHID = %lu\0A\00"
define noalias i8* @start_routine(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (...) @gettid()
%6 = tail call i32 (...) @pthread_self()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
%8 = tail call i32 @sleep(i32 5)
%9 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ echo(int);
main() { echo(0x1FFFFFFFF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @echo(i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @echo(i32 -1)
ret i32 0
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
const wchar_t *find_tag_char(const wchar_t *start_pos) {
  const wchar_t *current_pos = start_pos;
  while (*current_pos != L'\0') {
    if (*current_pos == L'@')
      return current_pos;
    ++current_pos;
  }
  return current_pos;
}


x86 assembly (clang, -O0):
<find_tag_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1148 <find_tag_char+0x48>
mov    -0x18(%rbp),%rax
cmpl   $0x40,(%rax)
jne    1137 <find_tag_char+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <find_tag_char+0x50>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <find_tag_char+0x10>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_tag_char>:
mov    %rdi,%rax
testl  $0xffffffbf,(%rax)
je     111c <find_tag_char+0x1c>
nopl   0x0(%rax,%rax,1)
add    $0x4,%rax
testl  $0xffffffbf,(%rax)
jne    1110 <find_tag_char+0x10>
ret

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

LLVM IR (-O2):
define i32* @find_tag_char(i32* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i32* [ %0, %1 ], [ %6, %5 ]
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 0, label %7
i32 64, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i32* %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool ace_fs_does_directory_exist(const char *path) {
  struct stat sb;
  return stat(path, &sb) == 0 && S_ISDIR(sb.st_mode);
}


x86 assembly (clang, -O0):
<ace_fs_does_directory_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <ace_fs_does_directory_exist+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ace_fs_does_directory_exist>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <ace_fs_does_directory_exist+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @ace_fs_does_directory_exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
scalar_t__ _ttime_number(char **, int *);
int _ttime_year(char **p, time_t *time) {
  time_t res;
  if (_ttime_number(p, &res) != 0)
    return 1;
  *time = res * 60 * 60 * 24 * 365;
  return 0;
}


x86 assembly (clang, -O0):
<_ttime_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <_ttime_number@plt>
cmp    $0x0,%rax
je     1143 <_ttime_year+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1160 <_ttime_year+0x50>
imul   $0x3c,-0x1c(%rbp),%eax
imul   $0x3c,%eax,%eax
imul   $0x18,%eax,%eax
imul   $0x16d,%eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ttime_year>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
call   1030 <_ttime_number@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    113b <_ttime_year+0x2b>
imul   $0x1e13380,0xc(%rsp),%eax
01
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_ttime_year(i8** %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
store i8** %0, i8*** %4
store i32* %1, i32** %5
%7 = load i8**, i8*** %4
%8 = call i64 @_ttime_number(i8** %7, i32* %6)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 60
%14 = mul nsw i32 %13, 60
%15 = mul nsw i32 %14, 24
%16 = mul nsw i32 %15, 365
%17 = load i32*, i32** %5
store i32 %16, i32* %17
store i32 0, i32* %3
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @_ttime_year(i8** %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @_ttime_number(i8** %0, i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = mul i32 %8, 31536000
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
void *zmalloc(size_t);
void *sds_malloc(size_t size) { return zmalloc(size); }


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

x86 assembly (clang, -O2):
<sds_malloc>:
jmp    1030 <zmalloc@plt>

LLVM IR (-O0):
define i8* @sds_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @zmalloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @sds_malloc(i64 %0) {
%2 = tail call i8* @zmalloc(i64 %0)
ret i8* %2
}
int udisk_mount_vir(char *devname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @udisk_mount_vir(i8* nocapture readnone %0) {
ret i32 0
}
int pinmux_validate_map(const struct pinctrl_map *map, int i) { return 0; }


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

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

LLVM IR (-O0):
%struct.pinctrl_map = type opaque
define i32 @pinmux_validate_map(%struct.pinctrl_map* %0, i32 %1) {
%3 = alloca %struct.pinctrl_map*
%4 = alloca i32
store %struct.pinctrl_map* %0, %struct.pinctrl_map** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl_map = type opaque
define i32 @pinmux_validate_map(%struct.pinctrl_map* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
void *ht_search_ind_a(struct hashtable *, char *, int /*<<< orphan*/);
void *ht_search_a(struct hashtable *ht, char *altkey) {
  return ht_search_ind_a(ht, altkey, 0);
}


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

x86 assembly (clang, -O2):
<ht_search_a>:
xor    %edx,%edx
jmp    1030 <ht_search_ind_a@plt>

LLVM IR (-O0):
%struct.hashtable = type { i32 }
define i8* @ht_search_a(%struct.hashtable* %0, i8* %1) {
%3 = alloca %struct.hashtable*
%4 = alloca i8*
store %struct.hashtable* %0, %struct.hashtable** %3
store i8* %1, i8** %4
%5 = load %struct.hashtable*, %struct.hashtable** %3
%6 = load i8*, i8** %4
%7 = call i8* @ht_search_ind_a(%struct.hashtable* %5, i8* %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define i8* @ht_search_a(%struct.hashtable* %0, i8* %1) {
%3 = tail call i8* @ht_search_ind_a(%struct.hashtable* %0, i8* %1, i32 0)
ret i8* %3
}
int __attribute__((target("sse4.2,arch=sandybridge"))) mangle(void) {
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @mangle() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ alignbits();
int /*<<< orphan*/ putbits(int, int);
void putseqend() {
  alignbits();
  putbits(0x1B7L, 32);
}


x86 assembly (clang, -O0):
<putseqend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <alignbits@plt>
mov    $0x1b7,%edi
mov    $0x20,%esi
call   1040 <putbits@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<putseqend>:
push   %rax
xor    %eax,%eax
call   1030 <alignbits@plt>
mov    $0x1b7,%edi
mov    $0x20,%esi
pop    %rax
jmp    1040 <putbits@plt>

LLVM IR (-O0):
define void @putseqend() {
%1 = call i32 (...) @alignbits()
%2 = call i32 @putbits(i32 439, i32 32)
ret void
}

LLVM IR (-O2):
define void @putseqend() {
%1 = tail call i32 (...) @alignbits()
%2 = tail call i32 @putbits(i32 439, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int menu_validateanswer(int ans, int max) {
  if (ans > 0 && ans <= max)
    return 1;
  printf("\n>> ERROR: Respuesta invalida!");
  return 0;
}


x86 assembly (clang, -O0):
<menu_validateanswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1140 <menu_validateanswer+0x30>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1140 <menu_validateanswer+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1153 <menu_validateanswer+0x43>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_validateanswer>:
test   %edi,%edi
jle    111e <menu_validateanswer+0xe>
mov    $0x1,%eax
cmp    %esi,%edi
jg     111e <menu_validateanswer+0xe>
ret
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0A>> ERROR: Respuesta invalida!\00"
define i32 @menu_validateanswer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %3
br label %15
13: ; preds = %8, %2
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A>> ERROR: Respuesta invalida!\00"
define i32 @menu_validateanswer(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp sgt i32 %0, %1
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ hdsEwild(int *, int *);
void hds_ewild_(int *iwld, int *status) { hdsEwild(iwld, status); }


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

x86 assembly (clang, -O2):
<hds_ewild_>:
jmp    1030 <hdsEwild@plt>

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

LLVM IR (-O2):
define void @hds_ewild_(i32* %0, i32* %1) {
%3 = tail call i32 @hdsEwild(i32* %0, i32* %1)
ret void
}
int IsBDigit(char C) { return (C == '0' || C == '1'); }


x86 assembly (clang, -O0):
<IsBDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
je     1129 <IsBDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsBDigit>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsBDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 48
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 49
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsBDigit(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
char *reserver() {
  char *buffer = (char *)malloc(1000 * sizeof(char));
  return buffer;
}


x86 assembly (clang, -O0):
<reserver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3e8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @reserver() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 1000)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
define i8* @reserver() {
%1 = tail call i64 @malloc(i32 1000)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ get_memory_statistics(char *, int /*<<< orphan*/);
vm_subsystem_present() {
  char mem_stats[128];
  get_memory_statistics(mem_stats, 0);
  if (*(long *)&mem_stats[0] == 1)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<vm_subsystem_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
call   1030 <get_memory_statistics@plt>
cmpq   $0x1,-0x90(%rbp)
01
jne    1143 <vm_subsystem_present+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <vm_subsystem_present+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_subsystem_present>:
sub    $0x88,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <get_memory_statistics@plt>
xor    %eax,%eax
cmpq   $0x1,(%rsp)
sete   %al
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @vm_subsystem_present() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_memory_statistics(i8* %3, i32 0)
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @vm_subsystem_present() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_memory_statistics(i8* %2, i32 0)
%4 = bitcast [128 x i8]* %1 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int fputs(const char *s, FILE *file) {
  while (*s) {
    fputc(*s++, file);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <fputs+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
jmp    1120 <fputs+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <fputs+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <fputs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @fputc(i32 %9, i32* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
unsigned int dictIdentityHashFunction(unsigned int key) { return key; }


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

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

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

LLVM IR (-O2):
define i32 @dictIdentityHashFunction(i32 returned %0) {
ret i32 %0
}
int condense(struct genome_struct **old_gens, int old_ngenes,
             struct genome_struct **new_gens, int new_ngenes) {
  int retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<condense>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.genome_struct = type opaque
define i32 @condense(%struct.genome_struct** %0, i32 %1, %struct.genome_struct** %2, i32 %3) {
%5 = alloca %struct.genome_struct**
%6 = alloca i32
%7 = alloca %struct.genome_struct**
%8 = alloca i32
%9 = alloca i32
store %struct.genome_struct** %0, %struct.genome_struct*** %5
store i32 %1, i32* %6
store %struct.genome_struct** %2, %struct.genome_struct*** %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.genome_struct = type opaque
define i32 @condense(%struct.genome_struct** nocapture readnone %0, i32 %1, %struct.genome_struct** nocapture readnone %2, i32 %3) {
ret i32 0
}
void batadv_nc_init_orig(struct batadv_orig_node *orig_node) { return; }


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

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

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

LLVM IR (-O2):
%struct.batadv_orig_node = type opaque
define void @batadv_nc_init_orig(%struct.batadv_orig_node* nocapture %0) {
ret void
}
int setgid(int gid) {}


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

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

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

LLVM IR (-O2):
define i32 @setgid(i32 %0) {
ret i32 undef
}
AX0I1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (((float *)10000000)[x0]) = 33; }


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movss  0xebe(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edi,%rax
movl   $0x42040000,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @AX0I1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %17
store float 3.300000e+01, float* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @AX0I1(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %7
store float 3.300000e+01, float* %8
ret i32 undef
}
/* Variables and functions */
size_t CHAR_BIT;
int get_bit(const char bit_array[], size_t i) {
  const size_t index = i / CHAR_BIT;
  const size_t offset = i % CHAR_BIT;
  return (bit_array[index] >> offset) & 1;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec9(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb5(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %rsi,%rax
mov    0x2ed6(%rip),%rcx
mov    (%rcx),%rcx
mov    %rsi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1123 <get_bit+0x23>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
jmp    1129 <get_bit+0x29>
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
movsbl (%rdi,%rax,1),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i64 0
define i32 @get_bit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* @CHAR_BIT
%9 = udiv i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = load i64, i64* @CHAR_BIT
%12 = urem i64 %10, %11
store i64 %12, i64* %6
%13 = load i8*, i8** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i64, i64* %6
%19 = trunc i64 %18 to i32
%20 = ashr i32 %17, %19
%21 = and i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
@CHAR_BIT = global i64 0
define i32 @get_bit(i8* nocapture %0, i64 %1) {
%3 = load i64, i64* @CHAR_BIT
%4 = udiv i64 %1, %3
%5 = urem i64 %1, %3
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = trunc i64 %5 to i32
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
ret i32 %11
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double seconds() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((double)tv.tv_sec) + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %8, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
int sprintf(char *, char *, int, int);
int write(int, char *, int);
int endloop(int fp) {
  char LocalBuff[200];
  int LocalLength, Lcount;
  LocalLength = sprintf(LocalBuff, "%c%c", 0x04, 0x82);
  Lcount = write(fp, LocalBuff, LocalLength);
  return 0;
}


x86 assembly (clang, -O0):
<endloop>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x4,%edx
mov    $0x82,%ecx
call   1040 <sprintf@plt>
mov    %eax,-0xd4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xd0(%rbp),%rsi
mov    -0xd4(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0xd8(%rbp)
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endloop>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %edi,%ebx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x4,%edx
mov    $0x82,%ecx
call   1040 <sprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%c%c\00"
define i32 @endloop(i32 %0) {
%2 = alloca i32
%3 = alloca [200 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 130)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %5
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define i32 @endloop(i32 %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 130)
%5 = call i32 @write(i32 %0, i8* %3, i32 %4)
ret i32 0
}
void input(y) int *y;
{ *y += 100; }


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x64,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @input(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 100
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @input(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 100
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
void add_recv_bytes(u_int64_t num) {}


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

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

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

LLVM IR (-O2):
define void @add_recv_bytes(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_check_stability(float *, float *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  float a[] = {1.000000000000000, -2.000000000000000, 1.968750000000000,
               -2.000000000000000, 1.000000000000000};
  float b[] = {0, 0, 0, 0, 0};
  assert(__ESBMC_check_stability(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <__ESBMC_check_stability@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <__ESBMC_check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x float] [float 1.000000e+00, float -2.000000e+00, float 1.968750e+00, float -2.000000e+00, float 1.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x float]
%3 = alloca [5 x float]
store i32 0, i32* %1
%4 = bitcast [5 x float]* %2 to i8*
%5 = bitcast [5 x float]* %3 to i8*
%6 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 0
%8 = call i32 @__ESBMC_check_stability(float* %6, float* %7)
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x float] [float 1.000000e+00, float -2.000000e+00, float 1.968750e+00, float -2.000000e+00, float 1.000000e+00]
define i32 @main() {
%1 = alloca [5 x float]
%2 = alloca [5 x float]
%3 = bitcast [5 x float]* %1 to i8*
%4 = bitcast [5 x float]* %2 to i8*
%5 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
%7 = call i32 @__ESBMC_check_stability(float* %5, float* %6)
%8 = call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long LPCConfigGet(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  return (((*((volatile unsigned long *)(ulBase + 0x00000000))) & 0x00000100));
}


x86 assembly (clang, -O0):
<LPCConfigGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x100,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCConfigGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40080000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    (%rbx),%rax
and    $0x100,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @LPCConfigGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074266112
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 0
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 256
ret i64 %11
}

LLVM IR (-O2):
define i64 @LPCConfigGet(i64 %0) {
%2 = icmp eq i64 %0, 1074266112
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = inttoptr i64 %0 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 256
ret i64 %7
}
void MultiplyPolyn(struct node *head1, struct node *head2) {}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define void @MultiplyPolyn(%struct.node* %0, %struct.node* %1) {
%3 = alloca %struct.node*
%4 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
store %struct.node* %1, %struct.node** %4
ret void
}

LLVM IR (-O2):
%struct.node = type opaque
define void @MultiplyPolyn(%struct.node* nocapture %0, %struct.node* nocapture %1) {
ret void
}
double ul2d(unsigned long long a) { return (unsigned long long)a; }


x86 assembly (clang, -O0):
<ul2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xef1(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xef0(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ul2d>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ul2d(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @ul2d(i64 %0) {
%2 = uitofp i64 %0 to double
ret double %2
}
double fr(double x, double k) { return ((k * k) / x); }


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

x86 assembly (clang, -O2):
<fr>:
mulsd  %xmm1,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fr(double %0, double %1) {
%3 = fmul double %1, %1
%4 = fdiv double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_char(unsigned char);
void print_emerg_char(unsigned char byte) { console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_emerg_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_emerg_char>:
jmp    1030 <console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_emerg_char(i8 zeroext %0) {
%2 = tail call i32 @console_tx_char(i8 zeroext %0)
ret void
}