xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ drawtriangle(int, int /*<<< orphan*/, int,
                                int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
void icosahedron(GLdouble p0[3], GLdouble radius, GLenum shadeType) {
  int i;
  for (i = 0; i < 20; i++)
    drawtriangle(i, 0, 1, p0, radius, shadeType, 0);
}


x86 assembly (clang, -O0):
<icosahedron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1163 <icosahedron+0x53>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
xor    %esi,%esi
mov    $0x1,%edx
movl   $0x0,(%rsp)
call   1030 <drawtriangle@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <icosahedron+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icosahedron>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movl   $0x0,(%rsp)
mov    %ebp,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <drawtriangle@plt>
add    $0x1,%ebp
cmp    $0x14,%ebp
jne    1130 <icosahedron+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @icosahedron(i32* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %4
%5 = phi i32 [ 0, %3 ], [ %7, %4 ]
%6 = tail call i32 @drawtriangle(i32 %5, i32 0, i32 1, i32* %0, i32 %1, i32 %2, i32 0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 20
br i1 %8, label %9, label %4
9: ; preds = %4
ret void
}
/* Variables and functions */
scalar_t__ dlsym(void *, char const *);
void *Sys_Library_ProcAddress(void *lib, const char *apifuncname) {
  return (void *)dlsym(lib, apifuncname);
}


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

x86 assembly (clang, -O2):
<Sys_Library_ProcAddress>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @Sys_Library_ProcAddress(i8* %0, i8* %1) {
%3 = tail call i64 @dlsym(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
unsigned short NumberOnly();
int /*<<< orphan*/ WriteInstruction(char *);
int /*<<< orphan*/ WriteNumber(unsigned short);
void CR_FillLeft(void) {
  unsigned short int nNum = NumberOnly();
  WriteInstruction("ld b,");
  WriteNumber(nNum);
  WriteInstruction("call filll");
}


x86 assembly (clang, -O0):
<CR_FillLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <NumberOnly@plt>
mov    %ax,-0x2(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl -0x2(%rbp),%edi
call   1030 <WriteNumber@plt>
lea    0xea7(%rip),%rdi
call   1040 <WriteInstruction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_FillLeft>:
push   %rbx
xor    %eax,%eax
call   1050 <NumberOnly@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl %bx,%edi
call   1030 <WriteNumber@plt>
lea    0xeb1(%rip),%rdi
pop    %rbx
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ld b,\00"
@.str.1 = [11 x i8] c"call filll\00"
define void @CR_FillLeft() {
%1 = alloca i16
%2 = call zeroext i16 (...) @NumberOnly()
store i16 %2, i16* %1
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %1
%5 = call i32 @WriteNumber(i16 zeroext %4)
%6 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ld b,\00"
@.str.1 = [11 x i8] c"call filll\00"
define void @CR_FillLeft() {
%1 = tail call zeroext i16 (...) @NumberOnly()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteNumber(i16 zeroext %1)
%4 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __attribute__((weak)) cleanup(void) {}


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

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

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

LLVM IR (-O2):
define weak void @cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ciao_free(void *pointer) { free(pointer); }


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

x86 assembly (clang, -O2):
<ciao_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ciao_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initPointers();
int /*<<< orphan*/ openFiles(char *, char *, char *);
int /*<<< orphan*/ setDefaults();
void project_open(char *f1, char *f2, char *f3) {
  initPointers();
  setDefaults();
  openFiles(f1, f2, f3);
}


x86 assembly (clang, -O0):
<project_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <initPointers@plt>
mov    $0x0,%al
call   1050 <setDefaults@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <openFiles@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<project_open>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <initPointers@plt>
xor    %eax,%eax
call   1050 <setDefaults@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <openFiles@plt>

LLVM IR (-O0):
define void @project_open(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 (...) @initPointers()
%8 = call i32 (...) @setDefaults()
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @openFiles(i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @project_open(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (...) @initPointers()
%5 = tail call i32 (...) @setDefaults()
%6 = tail call i32 @openFiles(i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
void resourceLeak_socket(void) { int s = socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<resourceLeak_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resourceLeak_socket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define void @resourceLeak_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
ret void
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define void @resourceLeak_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret void
}
float ldexpf(float x, int exp) { return x * (1 << exp); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sitofp i32 %7 to float
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sitofp i32 %3 to float
%5 = fmul float %4, %0
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void fclosep(FILE **f) {
  if (*f)
    fclose(*f);
}


x86 assembly (clang, -O0):
<fclosep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <fclosep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclosep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <fclosep+0xd>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @fclosep(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
char *qfile_get_name(const char *filepath) {
  char *path = strdup(filepath);
  char *bname = basename(path);
  char *filename = strdup(bname);
  free(path);
  return filename;
}


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

x86 assembly (clang, -O2):
<qfile_get_name>:
push   %r14
push   %rbx
push   %rax
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@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):
define i8* @qfile_get_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @basename(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i8* @strdup(i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @qfile_get_name(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i8* @strdup(i8* %3)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
int main(void) {
  void *p;
  return (int)p;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ cl_mem;
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clReleaseMemObject(cl_mem memobj) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)memobj;
  return (cl_int)syscall(325, 1019, sys_args);
}


x86 assembly (clang, -O0):
<clReleaseMemObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x3fb,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseMemObject>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x3fb,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clReleaseMemObject(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1019, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clReleaseMemObject(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1019, i32* %5)
ret i32 %6
}
unsigned int string_hash(char *str) {
  unsigned int hash = 0;
  while (*str) {
    hash = (*str++) + (hash << 6) + (hash << 16) - hash;
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <string_hash+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <string_hash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 65599
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void BN_GF2m_mod_solve_quad(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_solve_quad() {
ret void
}
void ff_hevc_put_hevc_epel_h24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h24_10_avx2() {
ret void
}
int get_sum_of_2_numbers(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<get_sum_of_2_numbers>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @get_sum_of_2_numbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 3;
  while (i) {
    printf("looping\n");
    i = i - 1;
  }
  i = 3;
  while (i) {
    i = i - 1;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1169 <main+0x59>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <main+0x41>
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>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"looping\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void isr_int_INTO() {}


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

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

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

LLVM IR (-O2):
define void @isr_int_INTO() {
ret void
}
int get_global_id(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_global_id(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __path_search(char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
                  int try_tmpdir) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__path_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__path_search>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__path_search(i8* %0, i64 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__path_search(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
void changeVolume(struct playerHandles *ph, int mod) {}


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

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

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

LLVM IR (-O2):
%struct.playerHandles = type opaque
define void @changeVolume(%struct.playerHandles* nocapture %0, i32 %1) {
ret void
}
unsigned int f92(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) + (x >> ((-1) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f92>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f92(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f92(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int is_variadic_argument(const char *buf) {
  if (0 == strncmp(buf, "...", 3)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_variadic_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114b <is_variadic_argument+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <is_variadic_argument+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_variadic_argument>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"...\00"
define i32 @is_variadic_argument(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1() { printf("Test 1: Objects on stack are preserved.\n"); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"Test 1: Objects on stack are preserved.\0A\00"
define void @test1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Test 1: Objects on stack are preserved.\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ GEN_EMAIL;
int set_altname(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
                int /*<<< orphan*/);
int set_altname_email(X509 *crt, const char *name) {
  return set_altname(crt, GEN_EMAIL, name, 0);
}


x86 assembly (clang, -O0):
<set_altname_email>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <set_altname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_altname_email>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <set_altname@plt>

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

LLVM IR (-O2):
@GEN_EMAIL = global i32 0
define i32 @set_altname_email(i32* %0, i8* %1) {
%3 = load i32, i32* @GEN_EMAIL
%4 = tail call i32 @set_altname(i32* %0, i32 %3, i8* %1, i32 0)
ret i32 %4
}
short short_fetch_ior_release(short *ptr, int value) {
  return __atomic_fetch_or(ptr, value, 3);
}


x86 assembly (clang, -O0):
<short_fetch_ior_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    %cx,-0xe(%rbp)
mov    -0xe(%rbp),%cx
mov    %cx,-0x14(%rbp)
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x2c(%rbp)
or     %esi,%edx
mov    %edx,-0x28(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x22(%rbp)
test   $0x1,%cl
mov    %ax,-0x12(%rbp)
jne    1161 <short_fetch_ior_release+0x61>
jmp    1129 <short_fetch_ior_release+0x29>
mov    -0x22(%rbp),%ax
mov    %ax,-0x10(%rbp)
movswl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_fetch_ior_release>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
or     %esi,%ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <short_fetch_ior_release+0x10>
ret

LLVM IR (-O0):
define signext i16 @short_fetch_ior_release(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i16* %0, i16** %3
store i32 %1, i32* %4
%7 = load i16*, i16** %3
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i16, i16* %5
%11 = atomicrmw or i16* %7, i16 %10 release
store i16 %11, i16* %6
%12 = load i16, i16* %6
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @short_fetch_ior_release(i16* nocapture %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = atomicrmw or i16* %0, i16 %3 release
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ close_tty();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printconsole(char *);
void interrupt(int signo) {
  printconsole("Exit-ing...\n");
  close_tty();
  exit(0);
}


x86 assembly (clang, -O0):
<interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printconsole@plt>
mov    $0x0,%al
call   1040 <close_tty@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<interrupt>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printconsole@plt>
xor    %eax,%eax
call   1040 <close_tty@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Exit-ing...\0A\00"
define void @interrupt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printconsole(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @close_tty()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Exit-ing...\0A\00"
define void @interrupt(i32 %0) {
%2 = tail call i32 @printconsole(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @close_tty()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("\n");
  printf("Usage: change_titles [file-name-or-run-number]\n");
  printf("When prompted, enter replacement fields as <field name> value(s)\n");
  printf("or one of the commands: exit, quit, show, help.\n");
  printf("\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xf55(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
lea    0xf33(%rip),%rdi
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xef1(%rip),%rdi
call   1040 <puts@plt>
lea    0xf26(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [48 x i8] c"Usage: change_titles [file-name-or-run-number]\0A\00"
@.str.2 = [66 x i8] c"When prompted, enter replacement fields as <field name> value(s)\0A\00"
@.str.3 = [49 x i8] c"or one of the commands: exit, quit, show, help.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"Usage: change_titles [file-name-or-run-number]\00"
@str.4 = [65 x i8] c"When prompted, enter replacement fields as <field name> value(s)\00"
@str.5 = [48 x i8] c"or one of the commands: exit, quit, show, help.\00"
define void @usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_is_method_error(void *m, const char *name) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_is_method_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_is_method_error>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_is_method_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_is_method_error(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *);
void fgetwd(char *buffer) { syscall(0x4677, buffer); }


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

x86 assembly (clang, -O2):
<fgetwd>:
mov    %rdi,%rsi
mov    $0x4677,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @fgetwd(i8* %0) {
%2 = tail call i32 @syscall(i32 18039, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pinHigh(int);
int /*<<< orphan*/ pinModeIn(int);
int /*<<< orphan*/ pinModeOut(int);
int /*<<< orphan*/ pinPUD(int, int);
int max6675_init(int sclk, int cs, int miso) {
  pinModeOut(cs);
  pinModeOut(sclk);
  pinModeIn(miso);
  pinPUD(miso, 2);
  pinHigh(cs);
  return 1;
}


x86 assembly (clang, -O0):
<max6675_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <pinModeOut@plt>
mov    -0x4(%rbp),%edi
call   1050 <pinModeOut@plt>
mov    -0xc(%rbp),%edi
call   1060 <pinModeIn@plt>
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1040 <pinPUD@plt>
mov    -0x8(%rbp),%edi
call   1030 <pinHigh@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max6675_init>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %esi,%edi
call   1050 <pinModeOut@plt>
mov    %r14d,%edi
call   1050 <pinModeOut@plt>
mov    %ebx,%edi
call   1060 <pinModeIn@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <pinPUD@plt>
mov    %ebp,%edi
call   1030 <pinHigh@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @max6675_init(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* %5
%8 = call i32 @pinModeOut(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @pinModeOut(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @pinModeIn(i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @pinPUD(i32 %13, i32 2)
%15 = load i32, i32* %5
%16 = call i32 @pinHigh(i32 %15)
ret i32 1
}

LLVM IR (-O2):
define i32 @max6675_init(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pinModeOut(i32 %1)
%5 = tail call i32 @pinModeOut(i32 %0)
%6 = tail call i32 @pinModeIn(i32 %2)
%7 = tail call i32 @pinPUD(i32 %2, i32 2)
%8 = tail call i32 @pinHigh(i32 %1)
ret i32 1
}
/* Variables and functions */
char *strrchr(char const *, int);
char *dirname(const char *filename) {
  char *s;
  s = strrchr(filename, (int)'/');
  if (s && *s)
    *s = '\0';
  return s;
}


x86 assembly (clang, -O0):
<dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <dirname+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <dirname+0x40>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirname>:
push   %rax
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1128 <dirname+0x18>
cmpb   $0x0,(%rax)
je     1128 <dirname+0x18>
movb   $0x0,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @dirname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i8 0, i8* %2
br label %8
8: ; preds = %7, %4, %1
ret i8* %2
}
/* Type definitions */
struct guestRequest {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eFree(struct guestRequest *);
void guestRequestDelete(struct guestRequest *r) { eFree(r); }


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

x86 assembly (clang, -O2):
<guestRequestDelete>:
jmp    1030 <eFree@plt>

LLVM IR (-O0):
%struct.guestRequest = type { i32 }
define void @guestRequestDelete(%struct.guestRequest* %0) {
%2 = alloca %struct.guestRequest*
store %struct.guestRequest* %0, %struct.guestRequest** %2
%3 = load %struct.guestRequest*, %struct.guestRequest** %2
%4 = call i32 @eFree(%struct.guestRequest* %3)
ret void
}

LLVM IR (-O2):
%struct.guestRequest = type { i32 }
define void @guestRequestDelete(%struct.guestRequest* %0) {
%2 = tail call i32 @eFree(%struct.guestRequest* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __Init_Data();
int /*<<< orphan*/ main();
void Reset_Handler(void) {
  __Init_Data();
  main();
}


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

x86 assembly (clang, -O2):
<Reset_Handler>:
push   %rax
xor    %eax,%eax
call   1030 <__Init_Data@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <main@plt>

LLVM IR (-O0):
define void @Reset_Handler() {
%1 = call i32 (...) @__Init_Data()
%2 = call i32 (...) @main()
ret void
}

LLVM IR (-O2):
define void @Reset_Handler() {
%1 = tail call i32 (...) @__Init_Data()
%2 = tail call i32 (...) @main()
ret void
}
void stem_print(int close, int dist, int ndigits) {
  if ((close / 10 == 0) && (dist < 0))
    printf("  %*s | ", ndigits, "-0");
  else
    printf("  %*d | ", ndigits, close / 10);
}


x86 assembly (clang, -O0):
<stem_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    115c <stem_print+0x4c>
cmpl   $0x0,-0x8(%rbp)
jge    115c <stem_print+0x4c>
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
lea    0xeb9(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117a <stem_print+0x6a>
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stem_print>:
lea    0x9(%rdi),%eax
cmp    $0x12,%eax
ja     1136 <stem_print+0x26>
test   %esi,%esi
jns    1136 <stem_print+0x26>
lea    0xedd(%rip),%rdi
lea    0xedf(%rip),%rax
mov    %edx,%esi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    0xeb8(%rip),%rdi
mov    %edx,%esi
mov    %eax,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" %*s | \00"
@.str.1 = [3 x i8] c"-0\00"
@.str.2 = [9 x i8] c" %*d | \00"
define void @stem_print(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, 10
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %21
16: ; preds = %10, %3
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %19)
br label %21
21: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" %*s | \00"
@.str.1 = [3 x i8] c"-0\00"
@.str.2 = [9 x i8] c" %*d | \00"
define void @stem_print(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 9
%5 = icmp ult i32 %4, 19
%6 = icmp slt i32 %1, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %13
10: ; preds = %3
%11 = sdiv i32 %0, 10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %11)
br label %13
13: ; preds = %10, %8
ret void
}
long fib(long n) { return n <= 2 ? ((n >> 1) & 1) : fib(n - 1) + fib(n - 2); }


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x2,-0x8(%rbp)
jg     113c <fib+0x2c>
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
and    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <fib+0x58>
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
xor    %r14d,%r14d
cmp    $0x3,%rdi
jl     114c <fib+0x3c>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rbx),%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
lea    -0x2(%rbx),%rax
add    %rcx,%r14
cmp    $0x5,%rbx
mov    %rax,%rbx
jae    1130 <fib+0x20>
shr    %eax
and    $0x1,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fib(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = ashr i64 %6, 1
%8 = and i64 %7, 1
br label %17
9: ; preds = %1
%10 = load i64, i64* %2
%11 = sub nsw i64 %10, 1
%12 = call i64 @fib(i64 %11)
%13 = load i64, i64* %2
%14 = sub nsw i64 %13, 2
%15 = call i64 @fib(i64 %14)
%16 = add nsw i64 %12, %15
br label %17
17: ; preds = %9, %5
%18 = phi i64 [ %8, %5 ], [ %16, %9 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = icmp slt i64 %0, 3
br i1 %2, label %3, label %9
3: ; preds = %9, %1
%4 = phi i64 [ 0, %1 ], [ %15, %9 ]
%5 = phi i64 [ %0, %1 ], [ %14, %9 ]
%6 = lshr i64 %5, 1
%7 = and i64 %6, 1
%8 = add nsw i64 %7, %4
ret i64 %8
9: ; preds = %1, %9
%10 = phi i64 [ %14, %9 ], [ %0, %1 ]
%11 = phi i64 [ %15, %9 ], [ 0, %1 ]
%12 = add nsw i64 %10, -1
%13 = tail call i64 @fib(i64 %12)
%14 = add nsw i64 %10, -2
%15 = add nsw i64 %13, %11
%16 = icmp ult i64 %10, 5
br i1 %16, label %3, label %9
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmp_p(const void *p1, const void *p2) {
  return strcmp(*(const char **)p1, *(const char **)p2);
}


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

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

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

LLVM IR (-O2):
define i32 @strcmp_p(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int test_basic() {
  int i;
  int red_0 = 0;
  int red_1 = 0;
#pragma acc parallel loop copy(red_0, red_1)
  for (i = 0; i < 4096; i++) {
#pragma acc atomic
    red_0--;
#pragma acc atomic update
    --red_1;
  }
  if (red_0 != -(4096)) {
    return 1;
  }
  if (red_1 != -(4096)) {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_basic>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1146 <test_basic+0x46>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <test_basic+0x19>
cmpl   $0xfffff000,-0xc(%rbp)
je     115f <test_basic+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    117f <test_basic+0x7f>
cmpl   $0xfffff000,-0x10(%rbp)
je     1178 <test_basic+0x78>
movl   $0x2,-0x4(%rbp)
jmp    117f <test_basic+0x7f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_basic() {
ret i32 0
}
__attribute__((always_)) void __WFE(void) {}


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

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

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

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