xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int t;
  for (t = 0; t < 5; t++) {
    printf("Durga\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Durga\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void set_nonblock(int fd) {
  int ret = fcntl(fd, F_GETFL);
  if (ret < 0)
    return;
  fcntl(fd, F_SETFL, ret | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <set_nonblock+0x30>
jmp    115f <set_nonblock+0x4f>
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e92(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1145 <set_nonblock+0x35>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %17
10: ; preds = %1
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i32 (i32, i32, ...) @fcntl(i32 %11, i32 %12, i32 %15)
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void hdd_precache_data(uint64_t chunkid, uint32_t offset, uint32_t size) {
  (void)chunkid;
  (void)offset;
  (void)size;
}


x86 assembly (clang, -O0):
<hdd_precache_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @hdd_precache_data(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
ret void
}

LLVM IR (-O2):
define void @hdd_precache_data(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct TokenStream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *token_delimit(int /*<<< orphan*/ *);
struct TokenStream *token_split(int /*<<< orphan*/ *);
struct TokenStream *tokenize(wchar_t *data) {
  wchar_t *delimited = token_delimit(data);
  struct TokenStream *ts = token_split(delimited);
  free(delimited);
  return ts;
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <token_delimit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <token_split@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
push   %r14
push   %rbx
push   %rax
call   1050 <token_delimit@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <token_split@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TokenStream = type { i32 }
define %struct.TokenStream* @tokenize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca %struct.TokenStream*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32* @token_delimit(i32* %5)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call %struct.TokenStream* @token_split(i32* %7)
store %struct.TokenStream* %8, %struct.TokenStream** %4
%9 = load i32*, i32** %3
%10 = call i32 @free(i32* %9)
%11 = load %struct.TokenStream*, %struct.TokenStream** %4
ret %struct.TokenStream* %11
}

LLVM IR (-O2):
%struct.TokenStream = type { i32 }
define %struct.TokenStream* @tokenize(i32* %0) {
%2 = tail call i32* @token_delimit(i32* %0)
%3 = tail call %struct.TokenStream* @token_split(i32* %2)
%4 = tail call i32 @free(i32* %2)
ret %struct.TokenStream* %3
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Number:");
  scanf("%d", &number);
  printf("%d", exact_square(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Number:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @exact_square(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int genrand_int32();
long genrand_int31() { return ((long)(genrand_int32() >> 1)); }


x86 assembly (clang, -O0):
<genrand_int31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
sar    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_int31>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @genrand_int31() {
%1 = call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @genrand_int31() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ write(int, int *, int);
void cull(int p) {
  int n;
  for (;;) {
    read(0, &n, sizeof(n));
    if (n % p != 0)
      write(1, &n, sizeof(n));
  }
}


x86 assembly (clang, -O0):
<cull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
je     115e <cull+0x3e>
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
jmp    112b <cull+0xb>

x86 assembly (clang, -O2):
<cull>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    0x4(%rsp),%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1130 <cull+0x10>
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
jmp    1130 <cull+0x10>

LLVM IR (-O0):
define void @cull(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %12, %1
%5 = call i32 @read(i32 0, i32* %3, i32 4)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @write(i32 1, i32* %3, i32 4)
br label %12
12: ; preds = %10, %4
br label %4
}

LLVM IR (-O2):
define void @cull(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %11, %1
%5 = call i32 @read(i32 0, i32* %2, i32 4)
%6 = load i32, i32* %2
%7 = srem i32 %6, %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i32 @write(i32 1, i32* %2, i32 4)
br label %11
11: ; preds = %9, %4
br label %4
}
int test_int() {
  int i;
  int sums[2] = {0};
#pragma acc parallel loop
  for (i = 0; i < 8192; i++) {
#pragma acc atomic
    sums[0]++;
#pragma acc atomic
    ++sums[1];
  }
  for (i = 0; i < 2; i++) {
    if (sums[i] != (8192)) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2000,-0x8(%rbp)
jge    115c <test_int+0x4c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <test_int+0x1f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a0 <test_int+0x90>
movslq -0x8(%rbp),%rax
cmpl   $0x2000,-0x10(%rbp,%rax,4)
je     118d <test_int+0x7d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a7 <test_int+0x97>
jmp    1192 <test_int+0x82>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <test_int+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_int() {
ret i32 0
}
/* Variables and functions */
int atof(char *);
int const optind;
int get_argv_float(char **argv, const int index) {
  return atof(argv[index + optind]);
}


x86 assembly (clang, -O0):
<get_argv_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    0x2ebb(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_argv_float>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
jmp    1030 <atof@plt>

LLVM IR (-O0):
@optind = constant i32 0
define i32 @get_argv_float(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @optind
%8 = add nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %5, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @atof(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@optind = constant i32 0
define i32 @get_argv_float(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 @atof(i8* %5)
ret i32 %6
}
/* Variables and functions */
double atof(char *);
char *get_next_argp(char ***, char *);
double get_next_argpd(char ***argv, char *arg) {
  char *tmp = get_next_argp(argv, arg);
  return atof(tmp);
}


x86 assembly (clang, -O0):
<get_next_argpd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_next_argp@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_argpd>:
push   %rax
call   1040 <get_next_argp@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @get_next_argpd(i8*** %0, i8* %1) {
%3 = alloca i8***
%4 = alloca i8*
%5 = alloca i8*
store i8*** %0, i8**** %3
store i8* %1, i8** %4
%6 = load i8***, i8**** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_next_argp(i8*** %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call double @atof(i8* %9)
ret double %10
}

LLVM IR (-O2):
define double @get_next_argpd(i8*** %0, i8* %1) {
%3 = tail call i8* @get_next_argp(i8*** %0, i8* %1)
%4 = tail call double @atof(i8* %3)
ret double %4
}
number(x) {
  if (x < 0) {
    xwrite('-');
    x = -x;
  }
  printn(x);
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1149 <number+0x29>
mov    $0x2d,%edi
mov    $0x0,%al
call   1040 <xwrite@plt>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <printn@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1135 <number+0x15>
mov    $0x2d,%edi
xor    %eax,%eax
call   1040 <xwrite@plt>
neg    %ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printn@plt>

LLVM IR (-O0):
define i32 @number(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 45)
%8 = load i32, i32* %3
%9 = sub nsw i32 0, %8
store i32 %9, i32* %3
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = call i32 (i32, ...) bitcast (i32 (...)* @printn to i32 (i32, ...)*)(i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @number(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @printn to i32 (i32, ...)*)(i32 %7)
ret i32 undef
}
int output_frames_src_48_to_8(int input_frames) {
  if ((input_frames % 6) != 0 || input_frames > 960)
    return -1;
  return input_frames / 6;
}


x86 assembly (clang, -O0):
<output_frames_src_48_to_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1128 <output_frames_src_48_to_8+0x28>
cmpl   $0x3c0,-0x8(%rbp)
jle    1134 <output_frames_src_48_to_8+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <output_frames_src_48_to_8+0x42>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_frames_src_48_to_8>:
movslq %edi,%rcx
imul   $0x2aaaaaab,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,2),%edx
cmp    %edx,%ecx
mov    $0xffffffff,%edx
cmovne %edx,%eax
cmp    $0x3c1,%ecx
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @output_frames_src_48_to_8(i32 %0) {
%2 = srem i32 %0, 6
%3 = icmp ne i32 %2, 0
%4 = icmp sgt i32 %0, 960
%5 = or i1 %4, %3
%6 = sdiv i32 %0, 6
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int nC(int s2) {
  int nC_return;
  do {
    nC_return = __VERIFIER_nondet_int();
  } while (nC_return == s2 || nC_return == 0);
  return nC_return;
}


x86 assembly (clang, -O0):
<nC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1140 <nC+0x30>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    111b <nC+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nC>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    %ebx,%eax
je     1120 <nC+0x10>
test   %eax,%eax
je     1120 <nC+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nC(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %13, %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %4
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %7, %8
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br label %13
13: ; preds = %10, %6
%14 = phi i1 [ true, %6 ], [ %12, %10 ]
br i1 %14, label %4, label %15
15: ; preds = %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @nC(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = icmp eq i32 %3, %0
%5 = icmp eq i32 %3, 0
%6 = or i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, ...);
void report(char *module, int errors, int tests) {
  if (errors) {
    printf("%s: FAILED %i OF %i TESTS\n", module, errors, tests);
  } else {
    printf("%s: passed all of %i tests\n", module, tests);
  }
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <report+0x39>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <report+0x4e>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
test   %edx,%edx
je     1129 <report+0x19>
lea    0xede(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s: FAILED %i OF %i TESTS\0A\00"
@.str.1 = [28 x i8] c"%s: passed all of %i tests\0A\00"
define void @report(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12)
br label %18
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16)
br label %18
18: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s: FAILED %i OF %i TESTS\0A\00"
@.str.1 = [28 x i8] c"%s: passed all of %i tests\0A\00"
define void @report(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %2)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *createCopy(char *str) {
  char *tmp;
  tmp = malloc(sizeof(char) * (strlen(str) + 1));
  strcpy(tmp, str);
  return tmp;
}


x86 assembly (clang, -O0):
<createCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createCopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @createCopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @createCopy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void mus_set_little_endian_int(unsigned char *j, int x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[3];
  j[1] = ox[2];
  j[2] = ox[1];
  j[3] = ox[0];
}


x86 assembly (clang, -O0):
<mus_set_little_endian_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_set_little_endian_int>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mus_set_little_endian_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast i32* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @mus_set_little_endian_int(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = lshr i32 %1, 24
%9 = trunc i32 %8 to i8
store i8 %9, i8* %0
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  puts("%x %x %x %x %x");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x48,%esi
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
@.str.2 = [15 x i8] c"%x %x %x %x %x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
@.str.2 = [15 x i8] c"%x %x %x %x %x\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_3d_facets(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(584, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_3d_facets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x248,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_3d_facets>:
mov    $0x248,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_3d_facets() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 584, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_3d_facets() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 584, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void test3() {
  printf("\t*** %s ***\n", __func__);
  small_string_test("1,,2");
  printf("\t*** %s: done ***\n", __func__);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <small_string_test@plt>
lea    0xeca(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <small_string_test@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test3 = [6 x i8] c"test3\00"
@.str.1 = [5 x i8] c"1,,2\00"
@.str.2 = [19 x i8] c"\09*** %s: done ***\0A\00"
define void @test3() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test3, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test3 = [6 x i8] c"test3\00"
@.str.1 = [5 x i8] c"1,,2\00"
@.str.2 = [19 x i8] c"\09*** %s: done ***\0A\00"
define void @test3() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test3, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test3, i64 0, i64 0))
ret void
}
unsigned b_strlen(const char *x) {
  unsigned i = 0;
  while (x[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<b_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <b_strlen+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <b_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <b_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @b_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char foo[10];
  strcpy(foo, "1234567890");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"1234567890\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cnfImpn(char *const, int, int, char *);
int /*<<< orphan*/ hdsFlush(char *, int *);
void hds_flush_(char *const group, int *status, int group_length) {
  char group_c[15 + 1];
  cnfImpn(group, group_length, 15, group_c);
  hdsFlush(group_c, status);
}


x86 assembly (clang, -O0):
<hds_flush_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0xf,%edx
call   1030 <cnfImpn@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <hdsFlush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hds_flush_>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %edx,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   1030 <cnfImpn@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <hdsFlush@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @hds_flush_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%11 = call i32 @cnfImpn(i8* %8, i32 %9, i32 15, i8* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = call i32 @hdsFlush(i8* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @hds_flush_(i8* %0, i32* %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @cnfImpn(i8* %0, i32 %2, i32 15, i8* %5)
%7 = call i32 @hdsFlush(i8* %5, i32* %1)
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t len) {
  size_t i;
  for (i = 0; i < len && s[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    1162 <strnlen+0x62>
jmp    1151 <strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double clock_mono_us() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return 1.0e6 * (ts.tv_sec + (ts.tv_nsec * 1e-9));
}


x86 assembly (clang, -O0):
<clock_mono_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_mono_us>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl (%rsp),%xmm1
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xec7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @clock_mono_us() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
%11 = fmul double 1.000000e+06, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @clock_mono_us() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
%12 = fmul double %11, 1.000000e+06
ret double %12
}
/* Variables and functions */
char *my_strcpy(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (2 > argc) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  char *value = argv[1];
  printf("%s ", my_strcpy(value));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jle    115e <main+0x3e>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1184 <main+0x64>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <my_strcpy@plt>
mov    %rax,%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1149 <main+0x19>
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
jmp    1165 <main+0x35>
mov    0x8(%rsi),%rdi
call   1030 <my_strcpy@plt>
lea    0xea7(%rip),%rdi
xor    %ebx,%ebx
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nombre de parametres insuffisants\0A\00"
@.str.1 = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 2, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %18
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i8* @my_strcpy(i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%s \00"
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i8* @my_strcpy(i8* %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ dragon(char *, double);
int /*<<< orphan*/ printf(char *, ...);
void test_fp(double f) {
  char buf[30];
  printf("Float printf: %f.\n", f);
  dragon(buf, f);
  printf("Dragon: %s\n", buf);
}


x86 assembly (clang, -O0):
<test_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
call   1040 <dragon@plt>
lea    -0x30(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fp>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <dragon@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Float printf: %f.\0A\00"
@.str.1 = [12 x i8] c"Dragon: %s\0A\00"
define void @test_fp(double %0) {
%2 = alloca double
%3 = alloca [30 x i8]
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %4)
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%7 = load double, double* %2
%8 = call i32 @dragon(i8* %6, double %7)
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Float printf: %f.\0A\00"
@.str.1 = [12 x i8] c"Dragon: %s\0A\00"
define void @test_fp(double %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %0)
%5 = call i32 @dragon(i8* %3, double %0)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}