xunge/DecIR huggingface dataset:
unsigned long insert_spr(unsigned long insn, long value, const char **errmsg) {
  return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
}


x86 assembly (clang, -O0):
<insert_spr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
and    $0x3e0,%rcx
shl    $0x6,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_spr>:
mov    %esi,%eax
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
shl    $0x6,%esi
and    $0xf800,%esi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @insert_spr(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %8, 31
%10 = shl i64 %9, 16
%11 = or i64 %7, %10
%12 = load i64, i64* %5
%13 = and i64 %12, 992
%14 = shl i64 %13, 6
%15 = or i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @insert_spr(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = shl i64 %1, 16
%5 = and i64 %4, 2031616
%6 = or i64 %5, %0
%7 = shl i64 %1, 6
%8 = and i64 %7, 63488
%9 = or i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x[10];
  int y[10];
  int u;
  y[7] = 1234;
  x[0] = y[7];
  u = x[0];
  print_int(u);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x4d2,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%edi
call   1040 <print_int@plt>
lea    0xeb6(%rip),%rdi
call   1030 <print_string@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4d2,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
store i32 1234, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%6 = load i32, i32* %5
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 %6, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = load i32, i32* %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @print_int(i32 %10)
%12 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i32 1234)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIO_clearEventDio(int /*<<< orphan*/);
void IOCIntClear(uint32_t ui32IOId) {
  ;
  GPIO_clearEventDio(ui32IOId);
}


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

x86 assembly (clang, -O2):
<IOCIntClear>:
jmp    1030 <GPIO_clearEventDio@plt>

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

LLVM IR (-O2):
define void @IOCIntClear(i32 %0) {
%2 = tail call i32 @GPIO_clearEventDio(i32 %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int /*<<< orphan*/ printf(char *, int);
int sysconf(int /*<<< orphan*/);
int main(void) {
  int nofcpus;
  nofcpus = sysconf(_SC_NPROCESSORS_ONLN);
  printf("%d core(s) found\n", nofcpus);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [18 x i8] c"%d core(s) found\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @_SC_NPROCESSORS_ONLN
%4 = call i32 @sysconf(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [18 x i8] c"%d core(s) found\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
unsigned long find_thp_addr(unsigned long start, unsigned long size) {
  unsigned long thp_align_addr =
      (start + (0x200000UL - 1)) & ~((unsigned long)(0x200000UL - 1));
  if ((thp_align_addr >= start) &&
      ((thp_align_addr + 0x200000UL) < (start + size)))
    return thp_align_addr;
  return 0;
}


x86 assembly (clang, -O0):
<find_thp_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1fffff,%rax
and    $0xffffffffffe00000,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1156 <find_thp_addr+0x56>
mov    -0x20(%rbp),%rax
add    $0x200000,%rax
mov    -0x10(%rbp),%rcx
add    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jae    1156 <find_thp_addr+0x56>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <find_thp_addr+0x5e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_thp_addr>:
lea    0x1fffff(%rdi),%rax
and    $0xffffffffffe00000,%rax
cmp    %rdi,%rax
jb     1121 <find_thp_addr+0x21>
lea    0x200000(%rax),%rcx
add    %rdi,%rsi
cmp    %rsi,%rcx
jb     1123 <find_thp_addr+0x23>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @find_thp_addr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = add i64 %7, 2097151
%9 = and i64 %8, -2097152
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = load i64, i64* %4
%12 = icmp uge i64 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %2
%14 = load i64, i64* %6
%15 = add i64 %14, 2097152
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = add i64 %16, %17
%19 = icmp ult i64 %15, %18
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = load i64, i64* %6
store i64 %21, i64* %3
br label %23
22: ; preds = %13, %2
store i64 0, i64* %3
br label %23
23: ; preds = %22, %20
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @find_thp_addr(i64 %0, i64 %1) {
%3 = add i64 %0, 2097151
%4 = and i64 %3, -2097152
%5 = icmp ult i64 %4, %0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = add i64 %4, 2097152
%8 = add i64 %1, %0
%9 = icmp ult i64 %7, %8
br i1 %9, label %11, label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %6, %10
%12 = phi i64 [ 0, %10 ], [ %4, %6 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void tide_panic(const char *text) {
  fprintf(stderr, "panic: %s\n", text);
  abort();
}


x86 assembly (clang, -O0):
<tide_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<tide_panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @tide_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @tide_panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
void RTStrPrevCp(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrPrevCp() {
ret void
}
/* Type definitions */
struct crypt_data {
  int dummy;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
char *crypt_r(char const *, char const *, struct crypt_data *);
int /*<<< orphan*/ memset(struct crypt_data *, int /*<<< orphan*/, int);
int main(void) {
  static const char passwd[] = "somerandomtext";
  static const char salt[] = "examplesalt";
  char *crypted;
  static struct crypt_data data;
  (void)memset(&data, 0, sizeof(data));
  crypted = crypt_r(passwd, salt, &data);
  (void)crypted;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2efe(%rip),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xeb7(%rip),%rdi
lea    0xebf(%rip),%rsi
lea    0x2edd(%rip),%rdx
call   1030 <crypt_r@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x2f0c(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xec2(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
call   1030 <crypt_r@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.crypt_data = type { i32 }
@main.passwd = internal constant [15 x i8] c"somerandomtext\00"
@main.salt = internal constant [12 x i8] c"examplesalt\00"
@main.data = internal global %struct.crypt_data zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @memset(%struct.crypt_data* @main.data, i32 0, i32 4)
%4 = call i8* @crypt_r(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @main.passwd, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @main.salt, i64 0, i64 0), %struct.crypt_data* @main.data)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
%struct.crypt_data = type { i32 }
@main.passwd = internal constant [15 x i8] c"somerandomtext\00"
@main.salt = internal constant [12 x i8] c"examplesalt\00"
@main.data = internal global %struct.crypt_data zeroinitializer
define i32 @main() {
%1 = tail call i32 @memset(%struct.crypt_data* @main.data, i32 0, i32 4)
%2 = tail call i8* @crypt_r(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @main.passwd, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @main.salt, i64 0, i64 0), %struct.crypt_data* @main.data)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main() {
#pragma omp parallel
  {
    puts("Hello");
    puts("World!");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [7 x i8] c"World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [7 x i8] c"World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long ___hash(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<___hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <___hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <___hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <___hash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <___hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @___hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
char *getStatusText(int const);
int /*<<< orphan*/ printf(char *, char *, char *);
int removeFile(char *);
int removeFile_log(char filename[]) {
  const int status = removeFile(filename);
  printf("REMOVE FILE \"%s\": %s\n", filename, getStatusText(status));
  return status;
}


x86 assembly (clang, -O0):
<removeFile_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <removeFile@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <getStatusText@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeFile_log>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <removeFile@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <getStatusText@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"REMOVE FILE \22%s\22: %s\0A\00"
define i32 @removeFile_log(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @removeFile(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @getStatusText(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [22 x i8] c"REMOVE FILE \22%s\22: %s\0A\00"
define i32 @removeFile_log(i8* %0) {
%2 = tail call i32 @removeFile(i8* %0)
%3 = tail call i8* @getStatusText(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret i32 %2
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
void child(int childId) {
  sleep(1);
  printf("child %d\n", childId);
  printf("child pid: %d, parent pid: %d\n", getpid(), getppid());
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x4(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"child %d\0A\00"
@.str.1 = [31 x i8] c"child pid: %d, parent pid: %d\0A\00"
define void @child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sleep(i32 1)
%4 = load i32, i32* %2
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getpid()
%7 = call i32 (...) @getppid()
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"child %d\0A\00"
@.str.1 = [31 x i8] c"child pid: %d, parent pid: %d\0A\00"
define void @child(i32 %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (...) @getppid()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *safe_calloc(size_t nmemb, size_t size) {
  void *ret = calloc(nmemb, size);
  if (ret == NULL) {
    fprintf(stderr, "Out of memory in calloc()\n");
    exit(99);
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <safe_calloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x63,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <safe_calloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x63,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Out of memory in calloc()\0A\00"
define noalias i8* @safe_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 99)
unreachable
9: ; preds = %2
ret i8* %3
}
void U444ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @U444ToARGB() {
ret void
}
/* Variables and functions */
int get_BZ_triplets_at_q(int **, int const, int **, int const *, int const *,
                         int const *);
int kpt_get_BZ_triplets_at_q(int triplets[][3], const int grid_point,
                             int bz_grid_address[][3], const int bz_map[],
                             const int weights[], const int mesh[3]) {
  return get_BZ_triplets_at_q(triplets, grid_point, bz_grid_address, bz_map,
                              weights, mesh);
}


x86 assembly (clang, -O0):
<kpt_get_BZ_triplets_at_q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <get_BZ_triplets_at_q@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kpt_get_BZ_triplets_at_q>:
jmp    1030 <get_BZ_triplets_at_q@plt>

LLVM IR (-O0):
define i32 @kpt_get_BZ_triplets_at_q([3 x i32]* %0, i32 %1, [3 x i32]* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca [3 x i32]*
%8 = alloca i32
%9 = alloca [3 x i32]*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store [3 x i32]* %0, [3 x i32]** %7
store i32 %1, i32* %8
store [3 x i32]* %2, [3 x i32]** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load [3 x i32]*, [3 x i32]** %7
%14 = bitcast [3 x i32]* %13 to i32**
%15 = load i32, i32* %8
%16 = load [3 x i32]*, [3 x i32]** %9
%17 = bitcast [3 x i32]* %16 to i32**
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = call i32 @get_BZ_triplets_at_q(i32** %14, i32 %15, i32** %17, i32* %18, i32* %19, i32* %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @kpt_get_BZ_triplets_at_q([3 x i32]* %0, i32 %1, [3 x i32]* %2, i32* %3, i32* %4, i32* %5) {
%7 = bitcast [3 x i32]* %0 to i32**
%8 = bitcast [3 x i32]* %2 to i32**
%9 = tail call i32 @get_BZ_triplets_at_q(i32** %7, i32 %1, i32** %8, i32* %3, i32* %4, i32* %5)
ret i32 %9
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *somePath(struct sqlConnection *, int, char *);
char *bioImageFullSizePath(struct sqlConnection *conn, int id) {
  return somePath(conn, id, "fullLocation");
}


x86 assembly (clang, -O0):
<bioImageFullSizePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <somePath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bioImageFullSizePath>:
lea    0xee9(%rip),%rdx
jmp    1030 <somePath@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"fullLocation\00"
define i8* @bioImageFullSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @somePath(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"fullLocation\00"
define i8* @bioImageFullSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @somePath(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
unsigned kol_thread_start(unsigned start, unsigned stack) {
  asm volatile("int $0x40" ::"a"(51), "b"(1), "c"(start), "d"(stack));
}


x86 assembly (clang, -O0):
<kol_thread_start>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%edx
mov    $0x33,%eax
mov    $0x1,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_thread_start>:
push   %rbx
mov    %esi,%edx
mov    %edi,%ecx
mov    $0x33,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_thread_start(i32 %0, i32 %1) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 51, i32 1, i32 %0, i32 %1)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ real_pwrite(int, void *, size_t, int /*<<< orphan*/);
scalar_t__ smbw_fd(int);
int /*<<< orphan*/ smbw_pwrite(int, void *, size_t, int /*<<< orphan*/);
ssize_t pwrite(int fd, void *buf, size_t size, off_t ofs) {
  if (smbw_fd(fd)) {
    return smbw_pwrite(fd, buf, size, ofs);
  }
  return real_pwrite(fd, buf, size, ofs);
}


x86 assembly (clang, -O0):
<pwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <smbw_fd@plt>
cmp    $0x0,%rax
je     1173 <pwrite+0x43>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <smbw_pwrite@plt>
mov    %eax,-0x4(%rbp)
jmp    1189 <pwrite+0x59>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <real_pwrite@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwrite>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
call   1050 <smbw_fd@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
test   %rax,%rax
je     1166 <pwrite+0x36>
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <smbw_pwrite@plt>
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <real_pwrite@plt>

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

LLVM IR (-O2):
define i32 @pwrite(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i64 @smbw_fd(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @smbw_pwrite(i32 %0, i8* %1, i64 %2, i32 %3)
br label %11
9: ; preds = %4
%10 = tail call i32 @real_pwrite(i32 %0, i8* %1, i64 %2, i32 %3)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void tio_set_text_highlight(void) {
  printf("\033[0m");
  printf("\033[3%im", 5);
  printf("\033[1m");
}


x86 assembly (clang, -O0):
<tio_set_text_highlight>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_set_text_highlight>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
@.str.1 = [7 x i8] c"\1B[3%im\00"
@.str.2 = [5 x i8] c"\1B[1m\00"
define void @tio_set_text_highlight() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 5)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@.str.1 = [7 x i8] c"\1B[3%im\00"
@.str.2 = [5 x i8] c"\1B[1m\00"
define void @tio_set_text_highlight() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void freematrix(int rows, int **m) {
  while (--rows > -1) {
    free(m[rows]);
  }
  free(m);
}


x86 assembly (clang, -O0):
<freematrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jle    1147 <freematrix+0x37>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <freematrix+0xf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freematrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
jle    1146 <freematrix+0x36>
mov    %edi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <freematrix+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freematrix(i32 %0, i32** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i32*, i32** %1, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = bitcast i32** %1 to i8*
tail call void @free(i8* %15)
ret void
}
void glUniform4iv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform4iv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prims(int **, int);
int **read(int *);
int main() {
  int numberOfNodes;
  int **adjMatrix = read(&numberOfNodes);
  prims(adjMatrix, numberOfNodes);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <read@plt>
mov    0x4(%rsp),%esi
mov    %rax,%rdi
call   1040 <prims@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32** @read(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @prims(i32** %3, i32 %4)
ret i32 0
}
int fun200() { return 200; }


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

x86 assembly (clang, -O2):
mov    $0xc8,%eax
ret

LLVM IR (-O0):
define i32 @fun200() {
ret i32 200
}

LLVM IR (-O2):
define i32 @fun200() {
ret i32 200
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_newsspooldir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_newsspooldir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_newsspooldir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_newsspooldir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int copysign(int, double const);
bool samesign(double const x, double const y) {
  return copysign(1, x) * copysign(1, y) > 0;
}


x86 assembly (clang, -O0):
<samesign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <copysign@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <copysign@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<samesign>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
mov    $0x1,%edi
call   1030 <copysign@plt>
mov    %eax,%ebx
mov    $0x1,%edi
movsd  0x8(%rsp),%xmm0
call   1030 <copysign@plt>
imul   %ebx,%eax
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @samesign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @copysign(i32 1, double %5)
%7 = load double, double* %4
%8 = call i32 @copysign(i32 1, double %7)
%9 = mul nsw i32 %6, %8
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @samesign(double %0, double %1) {
%3 = tail call i32 @copysign(i32 1, double %0)
%4 = tail call i32 @copysign(i32 1, double %1)
%5 = mul nsw i32 %4, %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
long hash(char *word) {
  int sum = 42, count;
  for (count = 0; word[count] != '0'; count++)
    sum = sum + (word[count]) * (count + 1);
  return sum;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     1156 <hash+0x56>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
mov    -0x10(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash+0x16>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
mov    $0x2a,%eax
cmp    $0x30,%cl
je     1137 <hash+0x37>
mov    $0x2a,%eax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
movsbl %cl,%ecx
imul   %edx,%ecx
add    %ecx,%eax
movzbl (%rdi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    $0x30,%cl
jne    1120 <hash+0x20>
cltq
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 42, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %25, %1
%6 = load i8*, i8** %2
%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, 48
br i1 %12, label %13, label %28
13: ; preds = %5
%14 = load i32, i32* %3
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
%23 = mul nsw i32 %20, %22
%24 = add nsw i32 %14, %23
store i32 %24, i32* %3
br label %25
25: ; preds = %13
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %5
28: ; preds = %5
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
ret i64 %30
}

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %12, %4 ], [ 42, %1 ]
%8 = sext i8 %6 to i32
%9 = add nuw nsw i64 %5, 1
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, %8
%12 = add nsw i32 %11, %7
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 48
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = sext i32 %12 to i64
br label %18
18: ; preds = %16, %1
%19 = phi i64 [ 42, %1 ], [ %17, %16 ]
ret i64 %19
}
/* Variables and functions */
int detectPresence(char *);
int speakertestPresent() {
  static int lSpeakertestPresent = -1;
  if (lSpeakertestPresent < 0) {
    lSpeakertestPresent = detectPresence("speaker-test");
  }
  return lSpeakertestPresent;
}


x86 assembly (clang, -O0):
<speakertestPresent>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    1133 <speakertestPresent+0x23>
lea    0xed8(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<speakertestPresent>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <speakertestPresent+0xd>
pop    %rcx
ret
lea    0xedc(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef9(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@speakertestPresent.lSpeakertestPresent = internal global i32 -1
@.str = [13 x i8] c"speaker-test\00"
define i32 @speakertestPresent() {
%1 = load i32, i32* @speakertestPresent.lSpeakertestPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @speakertestPresent.lSpeakertestPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @speakertestPresent.lSpeakertestPresent
ret i32 %6
}

LLVM IR (-O2):
@speakertestPresent.lSpeakertestPresent = internal unnamed_addr global i32 -1
@.str = [13 x i8] c"speaker-test\00"
define i32 @speakertestPresent() {
%1 = load i32, i32* @speakertestPresent.lSpeakertestPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @speakertestPresent.lSpeakertestPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
atraso() { Delay_ms(500); }


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

x86 assembly (clang, -O2):
<atraso>:
mov    $0x1f4,%edi
jmp    1030 <Delay_ms@plt>

LLVM IR (-O0):
define i32 @atraso() {
%1 = alloca i32
%2 = call i32 @Delay_ms(i32 500)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @atraso() {
%1 = tail call i32 @Delay_ms(i32 500)
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int longcmp(const void *a, const void *b) {
  return ((int)(*(int32_t *)a - *(int32_t *)b));
}


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

x86 assembly (clang, -O2):
<longcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @longcmp(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 i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @longcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
unsigned int setgraphbufsize(unsigned int bufsize) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setgraphbufsize(i32 %0) {
ret i32 0
}
int isInteger(char *str) {
  if (*str == '\0') {
    return 0;
  }
  for (; *str != '\0'; str++) {
    if (*str < 48 || *str > 57) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1124 <isInteger+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1182 <isInteger+0x82>
jmp    1129 <isInteger+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117b <isInteger+0x7b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1159 <isInteger+0x59>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1165 <isInteger+0x65>
movl   $0x0,-0x4(%rbp)
jmp    1182 <isInteger+0x82>
jmp    116a <isInteger+0x6a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <isInteger+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInteger>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1128 <isInteger+0x28>
add    $0x1,%rdi
nopl   0x0(%rax)
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     1128 <isInteger+0x28>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isInteger+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isInteger(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8* [ %10, %9 ], [ %0, %1 ]
%6 = phi i8 [ %11, %9 ], [ %2, %1 ]
%7 = add i8 %6, -58
%8 = icmp ult i8 %7, -10
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %9 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xdestroywindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xdestroywindow_type(void *_p) {
  return (int)((XEvent *)_p)->xdestroywindow.type;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xdestroywindow_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xdestroywindow_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xdestroywindow_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}