xunge/DecIR huggingface dataset:
/* Variables and functions */
int SHA256_DIGEST_LENGTH;
int strncmp(char const *const, char const *const, int);
int compare_hmacs(const void *a, const void *b) {
  return strncmp((char const *const)a, (char const *const)b,
                 2 * SHA256_DIGEST_LENGTH);
}


x86 assembly (clang, -O0):
<compare_hmacs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
shl    $0x1,%edx
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_hmacs>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
add    %edx,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@SHA256_DIGEST_LENGTH = global i32 0
define i32 @compare_hmacs(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 = load i32, i32* @SHA256_DIGEST_LENGTH
%8 = mul nsw i32 2, %7
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@SHA256_DIGEST_LENGTH = global i32 0
define i32 @compare_hmacs(i8* %0, i8* %1) {
%3 = load i32, i32* @SHA256_DIGEST_LENGTH
%4 = shl nsw i32 %3, 1
%5 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %4)
ret i32 %5
}
void mpirun_done(int res) { return; }


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

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

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

LLVM IR (-O2):
define void @mpirun_done(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int return_namescore(char *);
int main() {
  printf("The score is %d", return_namescore("p022_names.txt"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"The score is %d\00"
@.str.1 = [15 x i8] c"p022_names.txt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @return_namescore(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"The score is %d\00"
@.str.1 = [15 x i8] c"p022_names.txt\00"
define i32 @main() {
%1 = tail call i32 @return_namescore(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
size_t getFilesize(const char *filename) {
  struct stat st;
  stat(filename, &st);
  return st.st_size;
}


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

x86 assembly (clang, -O2):
<getFilesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @getFilesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @getFilesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
void cfg_splitpath(filespec, pathpart, filepart) char *filespec;
char *pathpart;
char *filepart;
{
  char *marker;
  strcpy(pathpart, filespec);
  marker = strrchr(pathpart, '/');
  if (!marker) {
    strcpy(pathpart, ".");
    strcpy(filepart, filespec);
  } else {
    *marker = 0;
    strcpy(filepart, marker + 1);
  }
}


x86 assembly (clang, -O0):
<cfg_splitpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1180 <cfg_splitpath+0x60>
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1198 <cfg_splitpath+0x78>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_splitpath>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     115a <cfg_splitpath+0x3a>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %r14,%rdi
mov    %rax,%rsi
jmp    1165 <cfg_splitpath+0x45>
movw   $0x2e,(%rbx)
mov    %r14,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define void @cfg_splitpath(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i8* @strrchr(i8* %11, i32 47)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %21, label %15
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = call i8* @strcpy(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %6
%19 = load i8*, i8** %4
%20 = call i8* @strcpy(i8* %18, i8* %19)
br label %27
21: ; preds = %3
%22 = load i8*, i8** %7
store i8 0, i8* %22
%23 = load i8*, i8** %6
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = call i8* @strcpy(i8* %23, i8* %25)
br label %27
27: ; preds = %21, %15
ret void
}

LLVM IR (-O2):
define void @cfg_splitpath(i8* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i32 47)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = bitcast i8* %1 to i16*
store i16 46, i16* %8
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %2, i8* dereferenceable(1) %0)
br label %13
10: ; preds = %3
store i8 0, i8* %5
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = tail call i8* @strcpy(i8* dereferenceable(1) %2, i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}
/* Variables and functions */
void Sys_UnloadGame(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_UnloadGame() {
ret void
}
int ptr_cmp(const void *p, const void *q) { return (p != q); }


x86 assembly (clang, -O0):
<ptr_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_cmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @ptr_cmp(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 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ptr_cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "tcpconnect server port\n");
  fprintf(stderr, "tcpconnect client ip port count [nonblock] [tcpmd5]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"tcpconnect server port\0A\00"
@.str.1 = [53 x i8] c"tcpconnect client ip port count [nonblock] [tcpmd5]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"tcpconnect server port\0A\00"
@.str.1 = [53 x i8] c"tcpconnect client ip port count [nonblock] [tcpmd5]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
long int _f_lrintf(float x) {
  long int _result;
  asm("fistpl %0" : "=m"(_result) : "t"(x) : "st");
  return _result;
}


x86 assembly (clang, -O0):
<_f_lrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
flds   -0x14(%rbp)
fistpl -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_f_lrintf>:
movss  %xmm0,-0xc(%rsp)
flds   -0xc(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @_f_lrintf(float %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ report(char *, int);
int /*<<< orphan*/ stderr;
void fatal(char *logmsg, int errnum) {
  int debug;
  debug = 1;
  if (debug) {
    fputs("FATAL - ", stderr);
  }
  report(logmsg, errnum);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1165 <fatal+0x35>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xea0(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"FATAL - \00"
@stderr = global i32 0
define void @fatal(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @report(i8* %12, i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"FATAL - \00"
@stderr = global i32 0
define void @fatal(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @report(i8* %0, i32 %1)
%6 = tail call i32 @exit(i32 1)
unreachable
}
long pathconf(const char *path, int name) { return -1; }


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

x86 assembly (clang, -O2):
<pathconf>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @pathconf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i64 -1
}

LLVM IR (-O2):
define i64 @pathconf(i8* nocapture readnone %0, i32 %1) {
ret i64 -1
}
void foo_2_1_2_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_2_1_2_2() {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
size_t listdiratpath(char const *);
int runforpath(const char *path) {
  return listdiratpath(path) != (size_t)-1 ? EXIT_SUCCESS : EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<runforpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <listdiratpath@plt>
cmp    $0xffffffffffffffff,%rax
je     1140 <runforpath+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    114c <runforpath+0x3c>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runforpath>:
push   %rax
call   1030 <listdiratpath@plt>
cmp    $0xffffffffffffffff,%rax
jne    1125 <runforpath+0x15>
mov    0x2ebd(%rip),%rax
jmp    112c <runforpath+0x1c>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @runforpath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @listdiratpath(i8* %3)
%5 = icmp ne i64 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
br label %10
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @runforpath(i8* %0) {
%2 = tail call i64 @listdiratpath(i8* %0)
%3 = icmp eq i64 %2, -1
%4 = load i32, i32* @EXIT_SUCCESS
%5 = load i32, i32* @EXIT_FAILURE
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
long extract_nb(unsigned long insn, int dialect __attribute__((unused)),
                int *invalid __attribute__((unused))) {
  long ret;
  ret = (insn >> 11) & 0x1f;
  if (ret == 0)
    ret = 32;
  return ret;
}


x86 assembly (clang, -O0):
<extract_nb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xb,%rax
and    $0x1f,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1132 <extract_nb+0x32>
movq   $0x20,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_nb>:
shr    $0xb,%edi
and    $0x1f,%edi
mov    $0x20,%eax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_nb(i64 %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i64, i64* %4
%9 = lshr i64 %8, 11
%10 = and i64 %9, 31
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i64 32, i64* %7
br label %14
14: ; preds = %13, %3
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @extract_nb(i64 %0, i32 %1, i32* nocapture readnone %2) {
%4 = lshr i64 %0, 11
%5 = and i64 %4, 31
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i64 32, i64 %5
ret i64 %7
}
lower_case(str) char *str;
{
  int i;
  for (i = 0; str[i] != '\0'; i++)
    str[i] = tolower(str[i]);
}


x86 assembly (clang, -O0):
<lower_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <lower_case+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <lower_case+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lower_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 @tolower(i32 %8)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *longestCommonPrefix(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *result = longestCommonPrefix(argv + 1, argc - 1);
  printf("result=%s\n", result);
  free(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1040 <longestCommonPrefix@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x8(%rsi),%rax
lea    -0x1(%rdi),%esi
mov    %rax,%rdi
call   1040 <longestCommonPrefix@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"result=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i8* @longestCommonPrefix(i8** %8, i32 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"result=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -1
%5 = tail call i8* @longestCommonPrefix(i8** %3, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @free(i8* %5)
ret i32 0
}
__attribute__((weak)) int _kill(int pid, int sig) {
  pid = pid;
  sig = sig;
  return -1;
}


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

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

LLVM IR (-O0):
define weak i32 @_kill(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
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
void initSW2() {}


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

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

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

LLVM IR (-O2):
define void @initSW2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t rtl_time(time_t *part) { return time(part); }


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

x86 assembly (clang, -O2):
<rtl_time>:
jmp    1030 <time@plt>

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

LLVM IR (-O2):
define i32 @rtl_time(i32* %0) {
%2 = tail call i32 @time(i32* %0)
ret i32 %2
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void *ecalloc(size_t nitems, size_t size, char *errmsg) {
  void *val = calloc(nitems, size);
  if (val == NULL) {
    fprintf(stderr, "\n%s\n", errmsg);
    exit(12);
  }
  return val;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1183 <ecalloc+0x53>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xc,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rbx
mov    %rdx,%rbx
call   1030 <calloc@plt>
test   %rax,%rax
je     1140 <ecalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0xc,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
define i8* @ecalloc(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i8* @calloc(i64 %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 12)
unreachable
18: ; preds = %3
%19 = load i8*, i8** %7
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
define noalias i8* @ecalloc(i64 %0, i64 %1, i8* %2) {
%4 = tail call i8* @calloc(i64 %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = tail call i32 @exit(i32 12)
unreachable
10: ; preds = %3
ret i8* %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int geopm_region_id_hint_is_equal(uint64_t hint_type, uint64_t region_id) {
  return (region_id & hint_type) ? 1 : 0;
}


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

x86 assembly (clang, -O2):
<geopm_region_id_hint_is_equal>:
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @geopm_region_id_hint_is_equal(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 = load i32, i32* %3
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @geopm_region_id_hint_is_equal(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, world! \n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, world! \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello, world! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
signed short ClampShort(int i) {
  if (i < (short)0x8000) {
    return (short)0x8000;
  }
  if (i > 0x7fff) {
    return 0x7fff;
  }
  return i;
}


x86 assembly (clang, -O0):
<ClampShort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffff8000,-0x8(%rbp)
jge    111f <ClampShort+0x1f>
movw   $0x8000,-0x2(%rbp)
jmp    113e <ClampShort+0x3e>
cmpl   $0x7fff,-0x8(%rbp)
jle    1137 <ClampShort+0x37>
movw   $0x7fff,-0x2(%rbp)
jmp    113e <ClampShort+0x3e>
mov    -0x8(%rbp),%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClampShort>:
cmp    $0x7fff,%edi
mov    $0x7fff,%ecx
cmovl  %edi,%ecx
cmp    $0xffff8001,%ecx
mov    $0x8000,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @ClampShort(i32 %0) {
%2 = alloca i16
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, -32768
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 -32768, i16* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 32767
br i1 %9, label %10, label %11
10: ; preds = %7
store i16 32767, i16* %2
br label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i16
store i16 %13, i16* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @ClampShort(i32 %0) {
%2 = icmp slt i32 %0, 32767
%3 = select i1 %2, i32 %0, i32 32767
%4 = icmp sgt i32 %3, -32768
%5 = select i1 %4, i32 %3, i32 -32768
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ netWrite(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void sendVersion() {
  char sendText[251];
  snprintf(sendText, 23, "VERSION %s\n", "1.42");
  netWrite(sendText);
}


x86 assembly (clang, -O0):
<sendVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x17,%esi
lea    0xec2(%rip),%rdx
lea    0xec7(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x100(%rbp),%rdi
call   1040 <netWrite@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendVersion>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rdx
lea    0xed6(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x17,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <netWrite@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"VERSION %s\0A\00"
@.str.1 = [5 x i8] c"1.42\00"
define void @sendVersion() {
%1 = alloca [251 x i8]
%2 = getelementptr inbounds [251 x i8], [251 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [251 x i8], [251 x i8]* %1, i64 0, i64 0
%5 = call i32 @netWrite(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"VERSION %s\0A\00"
@.str.1 = [5 x i8] c"1.42\00"
define void @sendVersion() {
%1 = alloca [251 x i8]
%2 = getelementptr inbounds [251 x i8], [251 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @netWrite(i8* %2)
ret void
}
/* Variables and functions */
bool fspath_is_absolute(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_is_absolute(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int errno;
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int setpgid(pid_t a, pid_t b) {
  int ret = syscall(61, a, b, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<setpgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x3d,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115e <setpgid+0x4e>
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    0x2e90(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <setpgid+0x54>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setpgid>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3d,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <setpgid+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @setpgid(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 61, i32 %0, i32 %1, i32 0, i32 0, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 0, %3
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %8
}
long long GetVote(long long i) { return 999999999999999LL; }


x86 assembly (clang, -O0):
<GetVote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x38d7ea4c67fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetVote>:
movabs $0x38d7ea4c67fff,%rax
ret

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

LLVM IR (-O2):
define i64 @GetVote(i64 %0) {
ret i64 999999999999999
}
/* Variables and functions */
int /*<<< orphan*/ glNormal3iv(int *);
void Normal3iv(int v[3]) { glNormal3iv(v); }


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

x86 assembly (clang, -O2):
<Normal3iv>:
jmp    1030 <glNormal3iv@plt>

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

LLVM IR (-O2):
define void @Normal3iv(i32* %0) {
%2 = tail call i32 @glNormal3iv(i32* %0)
ret void
}
void ipv6_ext_hdr(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<ipv6_ext_hdr>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_ext_hdr>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.ipv6_ext_hdr = [13 x i8] c"ipv6_ext_hdr\00"
define void @ipv6_ext_hdr() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.ipv6_ext_hdr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.ipv6_ext_hdr = [13 x i8] c"ipv6_ext_hdr\00"
define void @ipv6_ext_hdr() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.ipv6_ext_hdr, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ io_read8(int /*<<< orphan*/);
uint8_t inb(uint16_t port) { return io_read8(port); }


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

x86 assembly (clang, -O2):
<inb>:
jmp    1030 <io_read8@plt>

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

LLVM IR (-O2):
define i32 @inb(i32 %0) {
%2 = tail call i32 @io_read8(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int cookie_gen(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len) {
  unsigned int i;
  for (i = 0; i < 20; i++, cookie++)
    *cookie = i;
  *cookie_len = 20;
  return 1;
}


x86 assembly (clang, -O0):
<cookie_gen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jae    1146 <cookie_gen+0x46>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <cookie_gen+0x17>
mov    -0x18(%rbp),%rax
movl   $0x14,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cookie_gen>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rsi)
movl   $0x13121110,0x10(%rsi)
movl   $0x14,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cookie_gen(i32* nocapture readnone %0, i8* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = bitcast i8* %1 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %4
%5 = getelementptr inbounds i8, i8* %1, i64 16
store i8 16, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 17
store i8 17, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 18
store i8 18, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 19
store i8 19, i8* %8
store i32 20, i32* %2
ret i32 1
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_datefunc3_mon(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_datefunc3_mon() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_datefunc3_mon() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int rand();
int getRand(int max) { return rand() % max; }


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getRand(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _servid_usage(void) {
  fputs("Usage: servid -P protocol service...\n", stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_servid_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_servid_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: servid -P protocol service...\0A\00"
@stderr = global i32 0
define i32 @_servid_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: servid -P protocol service...\0A\00"
@stderr = global i32 0
define i32 @_servid_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ info_rc4_cipher(unsigned char *, unsigned char *, size_t);
void info_cipher(unsigned char *data, unsigned char *key, size_t len) {
  info_rc4_cipher(data, key, len);
}


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

x86 assembly (clang, -O2):
<info_cipher>:
jmp    1030 <info_rc4_cipher@plt>

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

LLVM IR (-O2):
define void @info_cipher(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @info_rc4_cipher(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int factorf(int);
int findnexte(int M) {
  int N;
  N = M;
  while (factorf(N) != 1 || N % 2 != 0) {
    ++N;
  }
  return N;
}


x86 assembly (clang, -O0):
<findnexte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jne    114d <findnexte+0x3d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <findnexte+0x4d>
jmp    116b <findnexte+0x5b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <findnexte+0x11>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findnexte>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <factorf@plt>
mov    %ebx,%ecx
and    $0x1,%ecx
add    $0x1,%ebx
cmp    $0x1,%eax
jne    1120 <findnexte+0x10>
test   %ecx,%ecx
jne    1120 <findnexte+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @findnexte(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %9, %2 ]
%4 = tail call i32 @factorf(i32 %3)
%5 = icmp eq i32 %4, 1
%6 = and i32 %3, 1
%7 = icmp eq i32 %6, 0
%8 = and i1 %5, %7
%9 = add nsw i32 %3, 1
br i1 %8, label %10, label %2
10: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xdd() {
  Assert_real((isascii(221) == 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_isascii.c",
              1110, ("isascii should be 0 for 0xdd"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xdd>:
push   %rax
mov    $0xdd,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x456,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xdd\00"
define void @t_isascii_0xdd() {
%1 = call i64 @isascii(i32 221)
%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 1110, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xdd\00"
define void @t_isascii_0xdd() {
%1 = tail call i64 @isascii(i32 221)
%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 1110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xec() {
  Assert_real((ispunct(236) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1185, ("ispunct should be 0 for 0xec"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xec\00"
define void @t_ispunct_0xec() {
%1 = call i64 @ispunct(i32 236)
%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 1185, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xec\00"
define void @t_ispunct_0xec() {
%1 = tail call i64 @ispunct(i32 236)
%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 1185, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}