xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { fprintf(stderr, "Usage: mkinitrd <image>\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: mkinitrd <image>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: mkinitrd <image>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getenv(char *);
char *tl_getenv(char *variable, char *value) {
  char *ret = getenv(variable);
  if (ret && *ret)
    return ret;
  else
    return value;
}


x86 assembly (clang, -O0):
<tl_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1155 <tl_getenv+0x45>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <tl_getenv+0x45>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <tl_getenv+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_getenv>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1125 <tl_getenv+0x15>
cmpb   $0x0,(%rax)
je     1125 <tl_getenv+0x15>
pop    %rbx
ret
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @tl_getenv(i8* nocapture %0, i8* readnone %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i8* [ %1, %8 ], [ %3, %5 ]
ret i8* %10
}
int fftw_iabs(int a) { return (int)(a < 0 ? -a : a); }


x86 assembly (clang, -O0):
<fftw_iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <fftw_iabs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <fftw_iabs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fftw_iabs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @fftw_iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
float exp(float);
void atlas_vexp(int *n, float *d) {
  int i;
  for (i = 0; i < *n; i++, d++)
    *d = exp(*d);
}


x86 assembly (clang, -O0):
<atlas_vexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1165 <atlas_vexp+0x55>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <exp@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <atlas_vexp+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atlas_vexp>:
push   %r15
push   %r14
push   %rbx
cmpl   $0x0,(%rdi)
jle    114a <atlas_vexp+0x3a>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%r15,%rbx,4),%xmm0
call   1030 <exp@plt>
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    (%r14),%ebx
jl     1130 <atlas_vexp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @atlas_vexp(i32* %0, float* %1) {
%3 = alloca i32*
%4 = alloca float*
%5 = alloca i32
store i32* %0, i32** %3
store float* %1, float** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load float*, float** %4
%13 = load float, float* %12
%14 = call float @exp(float %13)
%15 = load float*, float** %4
store float %14, float* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i32 1
store float* %20, float** %4
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @atlas_vexp(i32* nocapture %0, float* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 0, %2 ]
%7 = phi float* [ %11, %5 ], [ %1, %2 ]
%8 = load float, float* %7
%9 = tail call float @exp(float %8)
store float %9, float* %7
%10 = add nuw nsw i32 %6, 1
%11 = getelementptr inbounds float, float* %7, i64 1
%12 = load i32, i32* %0
%13 = icmp slt i32 %10, %12
br i1 %13, label %5, label %14
14: ; preds = %5, %2
ret void
}
int test2() { return 123 + 5 * 70; }


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

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

LLVM IR (-O0):
define i32 @test2() {
ret i32 473
}

LLVM IR (-O2):
define i32 @test2() {
ret i32 473
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
long file_exist(char *filename) {
  FILE *fp;
  if (!filename)
    return 0;
  fp = fopen(filename, "r");
  fclose(fp);
  return (long)fp;
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <file_exist+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1169 <file_exist+0x49>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rbx
test   %rdi,%rdi
je     113f <file_exist+0x1f>
lea    0xed3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <fclose@plt>
jmp    1141 <file_exist+0x21>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i64 @file_exist(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fclose(i32* %4)
%6 = ptrtoint i32* %4 to i64
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ 0, %1 ]
ret i64 %8
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit_program(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Connect(int fd, struct sockaddr_in *sa, int size) {
  if (connect(fd, (struct sockaddr *)sa, size) < 0) {
    fprintf(stderr, "connect error\n");
    exit_program(1);
  }
}


x86 assembly (clang, -O0):
<Connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <connect@plt>
cmp    $0x0,%rax
jge    117a <Connect+0x4a>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit_program@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Connect>:
push   %rax
call   1050 <connect@plt>
test   %rax,%rax
js     113d <Connect+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <exit_program@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [15 x i8] c"connect error\0A\00"
define void @Connect(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%9 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%10 = load i32, i32* %6
%11 = call i64 @connect(i32 %7, %struct.sockaddr* %9, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit_program(i32 1)
br label %17
17: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [15 x i8] c"connect error\0A\00"
define void @Connect(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%5 = tail call i64 @connect(i32 %0, %struct.sockaddr* %4, i32 %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit_program(i32 1)
br label %11
11: ; preds = %7, %3
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int hasWhiteSpace(char *s) {
  char c;
  while ((c = *s++) != 0)
    if (isspace(c))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<hasWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1160 <hasWhiteSpace+0x50>
movsbl -0x11(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115b <hasWhiteSpace+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1167 <hasWhiteSpace+0x57>
jmp    111c <hasWhiteSpace+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasWhiteSpace>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113f <hasWhiteSpace+0x2f>
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1120 <hasWhiteSpace+0x10>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hasWhiteSpace(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = tail call i64 @isspace(i8 signext %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %2, label %10
10: ; preds = %2, %6
%11 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %11
}
int main() { return 256; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x100,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 256
}
/* Variables and functions */
int /*<<< orphan*/ foo2(int);
int /*<<< orphan*/ putchar(char);
int foo3(int i) {
  foo2(i);
  putchar('a');
  return 0;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <foo2@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
push   %rax
call   1040 <foo2@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo2(i32 %3)
%5 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo3(i32 %0) {
%2 = tail call i32 @foo2(i32 %0)
%3 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Variables and functions */
char *strpbrk(char *, char *);
int fxmlGetTagNameLen(char *start) {
  char *e = strpbrk(start, " \n\r\t\v=>/");
  return e - start;
}


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

x86 assembly (clang, -O2):
<fxmlGetTagNameLen>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strpbrk@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c" \0A\0D\09\0B=>/\00"
define i32 @fxmlGetTagNameLen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strpbrk(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c" \0A\0D\09\0B=>/\00"
define i32 @fxmlGetTagNameLen(i8* %0) {
%2 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = ptrtoint i8* %2 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
void ConvertTimeToHM(int time, int *pHours, int *pMinutes) {
  *pHours = time / 60;
  *pMinutes = time % 60;
}


x86 assembly (clang, -O0):
<ConvertTimeToHM>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertTimeToHM>:
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
sar    $0x5,%ecx
add    %edi,%ecx
mov    %ecx,(%rsi)
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @ConvertTimeToHM(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = sdiv i32 %0, 60
store i32 %4, i32* %1
%5 = srem i32 %0, 60
store i32 %5, i32* %2
ret void
}
int isDelimiter(char d, char *de) {
  while (de != '\0') {
    if (*de == d)
      return 1;
    else
      de++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isDelimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <isDelimiter+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <isDelimiter+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1150 <isDelimiter+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <isDelimiter+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDelimiter>:
xor    %eax,%eax
test   %rsi,%rsi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isDelimiter(i8 signext %0, i8* %1) {
%3 = icmp ne i8* %1, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void putc_string(char **s, char c) { *(*s)++ = c; }


x86 assembly (clang, -O0):
<putc_string>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_string>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @putc_string(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %6
store i8 %5, i8* %7
ret void
}

LLVM IR (-O2):
define void @putc_string(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
store i8 %1, i8* %3
ret void
}
long long bit23() { return 0x0000000000800000LL; }


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

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

LLVM IR (-O0):
define i64 @bit23() {
ret i64 8388608
}

LLVM IR (-O2):
define i64 @bit23() {
ret i64 8388608
}
void RTTestIErrorInc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestIErrorInc() {
ret void
}
/* Variables and functions */
scalar_t__ atof(char *);
float stringToFloat(char *data) {
  float q = (float)atof(data);
  return q;
}


x86 assembly (clang, -O0):
<stringToFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToFloat>:
push   %rax
call   1030 <atof@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stringToFloat(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @atof(i8* %4)
%6 = sitofp i64 %5 to float
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @stringToFloat(i8* nocapture %0) {
%2 = tail call i64 @atof(i8* %0)
%3 = sitofp i64 %2 to float
ret float %3
}
int DynaOpen(const char **mod_name) {
  *mod_name = "";
  return (0);
}


x86 assembly (clang, -O0):
<DynaOpen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeed(%rip),%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DynaOpen>:
lea    0xef9(%rip),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @DynaOpen(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @DynaOpen(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %0
ret i32 0
}
/* Variables and functions */
float cosf(float);
float test(float f) { return cosf(f); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @test(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Variables and functions */
double cos(double);
double fun(double x) { return cos(x) - x * x * x; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <cos@plt>
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fun(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fneg double %7
%10 = call double @llvm.fmuladd.f64(double %9, double %8, double %4)
ret double %10
}

LLVM IR (-O2):
define double @fun(double %0) {
%2 = tail call double @cos(double %0)
%3 = fneg double %0
%4 = fmul double %3, %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %2)
ret double %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ftw(char *, int (*)(char const *, struct stat const *, int),
                       int);
int /*<<< orphan*/ getPath(char *, char *);
void attributeDATE() {
  int getDate(const char *filename, const struct stat *statptr, int flag);
  char searchPath[1000] = {'\0'};
  getPath(searchPath, "SEARCHDIR");
  ftw(searchPath, getDate, 5);
}


x86 assembly (clang, -O0):
<attributeDATE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    -0x3f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1030 <memset@plt>
lea    -0x3f0(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1040 <getPath@plt>
lea    -0x3f0(%rbp),%rdi
mov    0x2e71(%rip),%rsi
mov    $0x5,%edx
call   1050 <ftw@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attributeDATE>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    $0x3e8,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <getPath@plt>
mov    0x2e80(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1050 <ftw@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [10 x i8] c"SEARCHDIR\00"
define void @attributeDATE() {
%1 = alloca [1000 x i8]
%2 = bitcast [1000 x i8]* %1 to i8*
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = call i32 @getPath(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%6 = call i32 @ftw(i8* %5, i32 (i8*, %struct.stat*, i32)* @getDate, i32 5)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [10 x i8] c"SEARCHDIR\00"
define void @attributeDATE() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getPath(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @ftw(i8* %2, i32 (i8*, %struct.stat*, i32)* @getDate, i32 5)
ret void
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int epoll_ctl(int, int, int, struct epoll_event *);
int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev) {
  return epoll_ctl(epfd, op, fd, ev);
}


x86 assembly (clang, -O0):
<do_epoll_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <epoll_ctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_epoll_ctl>:
jmp    1030 <epoll_ctl@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @do_epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.epoll_event*, %struct.epoll_event** %8
%13 = call i32 @epoll_ctl(i32 %9, i32 %10, i32 %11, %struct.epoll_event* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @do_epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = tail call i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void constraintManagerShouldTreatAsOpaque(int rhs) {
  int i;
  scanf("%d", &i);
  if (i < rhs)
    return;
  if (i < rhs)
    *(volatile int *)0;
}


x86 assembly (clang, -O0):
<constraintManagerShouldTreatAsOpaque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <constraintManagerShouldTreatAsOpaque+0x2c>
jmp    114c <constraintManagerShouldTreatAsOpaque+0x3c>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114c <constraintManagerShouldTreatAsOpaque+0x3c>
xor    %eax,%eax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constraintManagerShouldTreatAsOpaque>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @constraintManagerShouldTreatAsOpaque(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
br label %15
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load volatile i32, i32* null
br label %15
15: ; preds = %8, %13, %9
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @constraintManagerShouldTreatAsOpaque(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_edge(struct graph *, int, int);
void add_edge_double(struct graph *g, int a, int b) {
  add_edge(g, a, b);
  add_edge(g, a, b);
}


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

x86 assembly (clang, -O2):
<add_edge_double>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <add_edge@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <add_edge@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @add_edge_double(%struct.graph* %0, i32 %1, i32 %2) {
%4 = alloca %struct.graph*
%5 = alloca i32
%6 = alloca i32
store %struct.graph* %0, %struct.graph** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.graph*, %struct.graph** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @add_edge(%struct.graph* %7, i32 %8, i32 %9)
%11 = load %struct.graph*, %struct.graph** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @add_edge(%struct.graph* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @add_edge_double(%struct.graph* %0, i32 %1, i32 %2) {
%4 = tail call i32 @add_edge(%struct.graph* %0, i32 %1, i32 %2)
%5 = tail call i32 @add_edge(%struct.graph* %0, i32 %1, i32 %2)
ret void
}
void InitDasmCOP411(void) {}


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

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

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

LLVM IR (-O2):
define void @InitDasmCOP411() {
ret void
}
/* Variables and functions */
char __rot13_char(int);
int strlen(char *);
char *__rot13(char *str) {
  int i;
  for (i = 0; i < strlen(str); i++) {
    str[i] = __rot13_char((int)str[i]);
  }
  return str;
}


x86 assembly (clang, -O0):
<__rot13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <__rot13+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <__rot13_char@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <__rot13+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rot13>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <__rot13+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <__rot13_char@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <__rot13+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @__rot13(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %24
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call signext i8 @__rot13_char(i32 %15)
%17 = load i8*, i8** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %4
24: ; preds = %4
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @__rot13(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call signext i8 @__rot13_char(i32 %8)
store i8 %9, i8* %6
%10 = add nuw nsw i64 %5, 1
%11 = tail call i32 @strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %4, label %14
14: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
scalar_t__ isblank(int);
int isspace(int c) {
  return isblank(c) || c == '\f' || c == '\n' || c == '\r' || c == '\v';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
push   %rbx
mov    %edi,%ebx
call   1030 <isblank@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <isspace+0x17>
pop    %rbx
ret
cmp    $0xd,%ebx
ja     1136 <isspace+0x26>
mov    $0x3400,%ecx
bt     %ebx,%ecx
jb     1125 <isspace+0x15>
xor    %eax,%eax
cmp    $0xb,%ebx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = tail call i64 @isblank(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 13, label %9
i32 12, label %9
i32 10, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 11
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int write(int, void *, int);
int fputc(int c, FILE *stream) { return write(((int)stream), (void *)&c, 1); }


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = ptrtoint i32* %5 to i32
%7 = bitcast i32* %3 to i8*
%8 = call i32 @write(i32 %6, i8* %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = ptrtoint i32* %1 to i64
%5 = trunc i64 %4 to i32
%6 = bitcast i32* %3 to i8*
%7 = call i32 @write(i32 %5, i8* %6, i32 1)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_ripemd160;
int jksengine_digests_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int jksengine_ripemd160_init(EVP_MD_CTX *ctx) {
  ;
  return (jksengine_digests_init(ctx, NID_ripemd160));
}


x86 assembly (clang, -O0):
<jksengine_ripemd160_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <jksengine_digests_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_ripemd160_init>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <jksengine_digests_init@plt>

LLVM IR (-O0):
@NID_ripemd160 = global i32 0
define i32 @jksengine_ripemd160_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_ripemd160
%5 = call i32 @jksengine_digests_init(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@NID_ripemd160 = global i32 0
define i32 @jksengine_ripemd160_init(i32* %0) {
%2 = load i32, i32* @NID_ripemd160
%3 = tail call i32 @jksengine_digests_init(i32* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Function1();
void Function2(void) { Function1(); }


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

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

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

LLVM IR (-O2):
define void @Function2() {
%1 = tail call i32 (...) @Function1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xab() {
  Assert_real((isdigit(171) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              860, ("isdigit should be 0 for 0xab"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xab>:
push   %rax
mov    $0xab,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x35c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xab\00"
define void @t_isdigit_0xab() {
%1 = call i64 @isdigit(i32 171)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xab\00"
define void @t_isdigit_0xab() {
%1 = tail call i64 @isdigit(i32 171)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_string_2(char *);
int main(void) {
  char *str;
  str = "0123456789\n";
  print_string_2(str);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"0123456789\0A\00"
define i32 @main() {
%1 = tail call i32 @print_string_2(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_70(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_70() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *igraph_i_strdup(const char *s) {
  size_t n = strlen(s) + 1;
  char *result = (char *)malloc(sizeof(char) * n);
  if (result) {
    memcpy(result, s, n);
  }
  return result;
}


x86 assembly (clang, -O0):
<igraph_i_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117d <igraph_i_strdup+0x4d>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igraph_i_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115e <igraph_i_strdup+0x2e>
movslq %ebp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @igraph_i_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %1
%17 = load i8*, i8** %4
%18 = load i8*, i8** %2
%19 = load i64, i64* %3
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
br label %21
21: ; preds = %16, %1
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @igraph_i_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = sext i32 %3 to i64
%9 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %8)
br label %10
10: ; preds = %7, %1
ret i8* %5
}
int getIndex(char key) { return key == 39 ? 26 : key - 'a'; }


x86 assembly (clang, -O0):
<getIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x27,%eax
jne    1124 <getIndex+0x24>
mov    $0x1a,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <getIndex+0x2e>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex>:
lea    -0x61(%rdi),%ecx
cmp    $0x27,%dil
mov    $0x1a,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getIndex(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, 39
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 97
br label %11
11: ; preds = %7, %6
%12 = phi i32 [ 26, %6 ], [ %10, %7 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @getIndex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp eq i8 %0, 39
%4 = add nsw i32 %2, -97
%5 = select i1 %3, i32 26, i32 %4
ret i32 %5
}
/* Variables and functions */
bool stack_dir1() {
  int a;
  int b;
  return ((uintptr_t)&b) > ((uintptr_t)&a);
}


x86 assembly (clang, -O0):
<stack_dir1>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
lea    -0x4(%rbp),%rcx
cmp    %rcx,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_dir1>:
lea    -0x4(%rsp),%rcx
lea    -0x8(%rsp),%rdx
xor    %eax,%eax
cmp    %rcx,%rdx
seta   %al
ret

LLVM IR (-O0):
define i32 @stack_dir1() {
%1 = alloca i32
%2 = alloca i32
%3 = ptrtoint i32* %2 to i64
%4 = ptrtoint i32* %1 to i64
%5 = icmp ugt i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @stack_dir1() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = icmp ugt i32* %2, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
void imv_window_wait_for_event(struct imv_window *window, double timeout) {
  (void)window;
  (void)timeout;
}


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

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

LLVM IR (-O0):
%struct.imv_window = type opaque
define void @imv_window_wait_for_event(%struct.imv_window* %0, double %1) {
%3 = alloca %struct.imv_window*
%4 = alloca double
store %struct.imv_window* %0, %struct.imv_window** %3
store double %1, double* %4
%5 = load %struct.imv_window*, %struct.imv_window** %3
%6 = load double, double* %4
ret void
}

LLVM IR (-O2):
%struct.imv_window = type opaque
define void @imv_window_wait_for_event(%struct.imv_window* nocapture %0, double %1) {
ret void
}