xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("Usage: 6c file.c");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Usage: 6c file.c\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Usage: 6c file.c\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ commnds();
int /*<<< orphan*/ init(int, char **);
int main(int argc, char *argv[]) {
  init(argc, argv);
  commnds();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <init@plt>
mov    $0x0,%al
call   1040 <commnds@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
%4 = tail call i32 (...) @commnds()
ret i32 0
}
/* Variables and functions */
scalar_t__ getint(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  if (getint(&i))
    printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getint@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <getint@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    0x4(%rsp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @getint(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
ret i32 0
}
unsigned short bam_swap_endian_2(unsigned short v) {
  return (unsigned short)(((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8));
}


x86 assembly (clang, -O0):
<bam_swap_endian_2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_swap_endian_2>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bam_swap_endian_2(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 16711935
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, -16711936
%10 = lshr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @bam_swap_endian_2(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int dramfreq_register_notifier(struct notifier_block *nb) { return 0; }


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @dramfreq_register_notifier(%struct.notifier_block* %0) {
%2 = alloca %struct.notifier_block*
store %struct.notifier_block* %0, %struct.notifier_block** %2
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @dramfreq_register_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dec_hex();
int /*<<< orphan*/ hex_dec();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char h;
  scanf("%c", &h);
  switch (h) {
  case 'd':
    dec_hex();
    break;
  case 'h':
    hex_dec();
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x64,%eax
je     1175 <main+0x45>
jmp    1164 <main+0x34>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
je     1181 <main+0x51>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1040 <dec_hex@plt>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1030 <hex_dec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
cmp    $0x68,%eax
je     115a <main+0x2a>
cmp    $0x64,%eax
jne    1161 <main+0x31>
xor    %eax,%eax
call   1040 <dec_hex@plt>
jmp    1161 <main+0x31>
xor    %eax,%eax
call   1030 <hex_dec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 100, label %6
i32 104, label %8
]
6: ; preds = %0
%7 = call i32 (...) @dec_hex()
br label %10
8: ; preds = %0
%9 = call i32 (...) @hex_dec()
br label %10
10: ; preds = %0, %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 100, label %5
i32 104, label %7
]
5: ; preds = %0
%6 = call i32 (...) @dec_hex()
br label %9
7: ; preds = %0
%8 = call i32 (...) @hex_dec()
br label %9
9: ; preds = %0, %7, %5
ret i32 0
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int A[], int l, int h) {
  if (l < h) {
    int p = partition(A, l, h);
    quickSort(A, l, p - 1);
    quickSort(A, p + 1, h);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void trunnel_set_uint16(void *p, uint16_t v) { memcpy(p, &v, 2); }


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

x86 assembly (clang, -O2):
<trunnel_set_uint16>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @trunnel_set_uint16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @memcpy(i8* %5, i32* %4, i32 2)
ret void
}

LLVM IR (-O2):
define void @trunnel_set_uint16(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 2)
ret void
}
void env_run(struct Env *e) {}


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

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

LLVM IR (-O0):
%struct.Env = type opaque
define void @env_run(%struct.Env* %0) {
%2 = alloca %struct.Env*
store %struct.Env* %0, %struct.Env** %2
ret void
}

LLVM IR (-O2):
%struct.Env = type opaque
define void @env_run(%struct.Env* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ updateOverflow(int, unsigned int *);
void tube_BASICTrans_Message(unsigned int *reg) { updateOverflow(1, reg); }


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

x86 assembly (clang, -O2):
<tube_BASICTrans_Message>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <updateOverflow@plt>

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

LLVM IR (-O2):
define void @tube_BASICTrans_Message(i32* %0) {
%2 = tail call i32 @updateOverflow(i32 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
void *thr_fn(void *arg) {
  printf("thread started...\n");
  pause();
  return 0;
}


x86 assembly (clang, -O0):
<thr_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"thread started...\0A\00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @pause()
ret i8* null
}

LLVM IR (-O2):
@str = [18 x i8] c"thread started...\00"
define noalias i8* @thr_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @pause()
ret i8* null
}
void INT_Excep_DEU_DEU1(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ LoadFunction(int /*<<< orphan*/ *);
int /*<<< orphan*/ LoadHeader(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void LoadChunk(FILE *D) {
  LoadHeader(D);
  while (1) {
    int c = getc(D);
    if (c == 'F')
      LoadFunction(D);
    else {
      ungetc(c, D);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<LoadChunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <LoadHeader@plt>
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x46,-0xc(%rbp)
jne    1179 <LoadChunk+0x39>
mov    -0x8(%rbp),%rdi
call   1040 <LoadFunction@plt>
jmp    118a <LoadChunk+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
jmp    118f <LoadChunk+0x4f>
jmp    1155 <LoadChunk+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadChunk>:
push   %rbx
mov    %rdi,%rbx
call   1050 <LoadHeader@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <getc@plt>
cmp    $0x46,%eax
jne    1167 <LoadChunk+0x27>
mov    %rbx,%rdi
call   1040 <LoadFunction@plt>
jmp    1150 <LoadChunk+0x10>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define void @LoadChunk(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @LoadHeader(i32* %4)
br label %6
6: ; preds = %1, %18
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 70
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i32*, i32** %2
%13 = call i32 @LoadFunction(i32* %12)
br label %18
14: ; preds = %6
%15 = load i32, i32* %3
%16 = load i32*, i32** %2
%17 = call i32 @ungetc(i32 %15, i32* %16)
br label %19
18: ; preds = %11
br label %6
19: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @LoadChunk(i32* %0) {
%2 = tail call i32 @LoadHeader(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = icmp eq i32 %3, 70
br i1 %4, label %5, label %9
5: ; preds = %1, %5
%6 = tail call i32 @LoadFunction(i32* %0)
%7 = tail call i32 @getc(i32* %0)
%8 = icmp eq i32 %7, 70
br i1 %8, label %5, label %9
9: ; preds = %5, %1
%10 = phi i32 [ %3, %1 ], [ %7, %5 ]
%11 = tail call i32 @ungetc(i32 %10, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ derp(char *);
int send(int, void *, size_t, int /*<<< orphan*/);
void tcp_send(int handle, void *buffer, size_t len) {
  if (send(handle, buffer, len, 0) == -1)
    derp("send");
}


x86 assembly (clang, -O0):
<tcp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    115a <tcp_send+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <derp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_send>:
push   %rax
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
je     112f <tcp_send+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <derp@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"send\00"
define void @tcp_send(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @derp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
__attribute__((no, noclone)) unsigned __int128 t103_4sub(signed char x) {
  unsigned short y = (6);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t103_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movw   $0x6,-0x14(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
movzwl -0x14(%rbp),%eax
sub    %rax,%rdx
mov    %r9,%rcx
sbb    $0x0,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    117e <t103_4sub+0x6e>
jmp    1185 <t103_4sub+0x75>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t103_4sub>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
mov    %r14,%rbx
sar    $0x3f,%rbx
add    $0xfffffffffffffffa,%r14
adc    $0xffffffffffffffff,%rbx
cmp    $0x5,%dil
jg     1133 <t103_4sub+0x23>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t103_4sub(i8 signext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i16
%5 = alloca i128
store i8 %0, i8* %3
store i16 6, i16* %4
%6 = load i8, i8* %3
%7 = load i16, i16* %4
%8 = sext i8 %6 to i129
%9 = zext i16 %7 to i129
%10 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %8, i129 %9)
%11 = extractvalue { i129, i1 } %10, 1
%12 = extractvalue { i129, i1 } %10, 0
%13 = trunc i129 %12 to i128
%14 = zext i128 %13 to i129
%15 = icmp ne i129 %12, %14
%16 = or i1 %11, %15
store i128 %13, i128* %5
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %1
%20 = load i128, i128* %5
store i128 %20, i128* %2
%21 = bitcast i128* %2 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t103_4sub(i8 signext %0) {
%2 = sext i8 %0 to i129
%3 = add nsw i129 %2, -6
%4 = icmp slt i8 %0, 6
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %5, %1
%8 = trunc i129 %3 to i64
%9 = lshr i129 %3, 64
%10 = trunc i129 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  unsigned char num = 179;
  unsigned char mask = 1;
  int count = 0;
  int index;
  for (index = 0; index < sizeof(num) * 8; index++) {
    if (num & mask == 1) {
      count += 1;
    }
    num = num >> 1;
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xb3,-0x5(%rbp)
movb   $0x1,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x8,%rax
jae    1183 <main+0x73>
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
cmp    $0x1,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     116b <main+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x5(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <main+0x25>
mov    -0xc(%rbp),%esi
lea    0xe73(%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
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8 -77, i8* %2
store i8 1, i8* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 8
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 1
%16 = zext i1 %15 to i32
%17 = and i32 %12, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %10
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %10
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %27
27: ; preds = %22
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
%31 = load i32, i32* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ctest_test_assert_add(int, char *);
int ctest_assert_false(int avalue, char *message) {
  if (avalue == 0) {
    ctest_test_assert_add(0, message);
    return 0;
  }
  ctest_test_assert_add(1, message);
  return -1;
}


x86 assembly (clang, -O0):
<ctest_assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1140 <ctest_assert_false+0x30>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <ctest_test_assert_add@plt>
movl   $0x0,-0x4(%rbp)
jmp    1155 <ctest_assert_false+0x45>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <ctest_test_assert_add@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_assert_false>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    %eax,%ebx
neg    %ebx
mov    %eax,%edi
call   1030 <ctest_test_assert_add@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ctest_assert_false(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = xor i1 %3, true
%7 = sext i1 %6 to i32
%8 = tail call i32 @ctest_test_assert_add(i32 %5, i8* %1)
ret i32 %7
}
int max(a, b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
float max(const float a, const float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int jac_chain_nm10_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 62;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm10_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm10_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm10_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm10_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm10_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x3e,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm10_work>:
test   %rdi,%rdi
je     110b <jac_chain_nm10_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm10_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm10_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm10_work+0x2c>
movl   $0x3e,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm10_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 62, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc24(void) {
  printf("Executing exitfunc"
         "24"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc24>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc24.\0A\00"
define void @exitfunc24() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc24.\00"
define void @exitfunc24() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *,
                            unsigned short);
int /*<<< orphan*/ unlink(char *);
void destroy_usock(unsigned short port) {
  char buf[512];
  snprintf(buf, sizeof(buf), "%s/%s.%u", "/tmp", ".s.carbon-c-relay", port);
  unlink(buf);
}


x86 assembly (clang, -O0):
<destroy_usock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x210(%rbp),%rdi
mov    $0x200,%esi
lea    0xebb(%rip),%rdx
lea    0xebd(%rip),%rcx
lea    0xebb(%rip),%r8
movzwl -0x2(%rbp),%r9d
call   1040 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_usock>:
push   %rbx
sub    $0x200,%rsp
mov    %edi,%r9d
lea    0xece(%rip),%rdx
lea    0xed0(%rip),%rcx
lea    0xece(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s/%s.%u\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [18 x i8] c".s.carbon-c-relay\00"
define void @destroy_usock(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [512 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i16, i16* %2
%6 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i16 zeroext %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @unlink(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s/%s.%u\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [18 x i8] c".s.carbon-c-relay\00"
define void @destroy_usock(i16 zeroext %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 512, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i16 zeroext %0)
%5 = call i32 @unlink(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erf(double);
int /*<<< orphan*/ erff(float);
int /*<<< orphan*/ erfl(long double);
void uninitvar_erf(void) {
  float f;
  (void)erff(f);
  double d;
  (void)erf(d);
  long double ld;
  (void)erfl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_erf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <erff@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <erf@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <erfl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_erf>:
sub    $0x18,%rsp
call   1030 <erff@plt>
call   1050 <erf@plt>
call   1040 <erfl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_erf() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @erff(float %4)
%6 = load double, double* %2
%7 = call i32 @erf(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @erfl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_erf() {
%1 = tail call i32 @erff(float undef)
%2 = tail call i32 @erf(double undef)
%3 = tail call i32 @erfl(x86_fp80 undef)
ret void
}
unsigned long get_fs(void) { return ((1)); }


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

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

LLVM IR (-O0):
define i64 @get_fs() {
ret i64 1
}

LLVM IR (-O2):
define i64 @get_fs() {
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ checkDisk1();
int /*<<< orphan*/ checkDisk2();
int /*<<< orphan*/ checkDisk3();
int /*<<< orphan*/ checkDisk4();
int /*<<< orphan*/ checkDisk5();
int /*<<< orphan*/ checkDisk6();
int /*<<< orphan*/ initClock();
int /*<<< orphan*/ initInterrupts();
int /*<<< orphan*/ printf(char *);
void main(void) {
  initInterrupts();
  initClock();
  checkDisk1();
  checkDisk2();
  checkDisk3();
  checkDisk4();
  checkDisk5();
  checkDisk6();
  printf("\nHalting...\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <initInterrupts@plt>
mov    $0x0,%al
call   10b0 <initClock@plt>
mov    $0x0,%al
call   1030 <checkDisk1@plt>
mov    $0x0,%al
call   1080 <checkDisk2@plt>
mov    $0x0,%al
call   1040 <checkDisk3@plt>
mov    $0x0,%al
call   1090 <checkDisk4@plt>
mov    $0x0,%al
call   1050 <checkDisk5@plt>
mov    $0x0,%al
call   10a0 <checkDisk6@plt>
lea    0xe2d(%rip),%rdi
call   1060 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <initInterrupts@plt>
xor    %eax,%eax
call   10b0 <initClock@plt>
xor    %eax,%eax
call   1030 <checkDisk1@plt>
xor    %eax,%eax
call   1080 <checkDisk2@plt>
xor    %eax,%eax
call   1040 <checkDisk3@plt>
xor    %eax,%eax
call   1090 <checkDisk4@plt>
xor    %eax,%eax
call   1050 <checkDisk5@plt>
xor    %eax,%eax
call   10a0 <checkDisk6@plt>
lea    0xe30(%rip),%rdi
pop    %rax
jmp    1060 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\0AHalting...\0A\00"
define void @main() {
%1 = call i32 (...) @initInterrupts()
%2 = call i32 (...) @initClock()
%3 = call i32 (...) @checkDisk1()
%4 = call i32 (...) @checkDisk2()
%5 = call i32 (...) @checkDisk3()
%6 = call i32 (...) @checkDisk4()
%7 = call i32 (...) @checkDisk5()
%8 = call i32 (...) @checkDisk6()
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"\0AHalting...\00"
define void @main() {
%1 = tail call i32 (...) @initInterrupts()
%2 = tail call i32 (...) @initClock()
%3 = tail call i32 (...) @checkDisk1()
%4 = tail call i32 (...) @checkDisk2()
%5 = tail call i32 (...) @checkDisk3()
%6 = tail call i32 (...) @checkDisk4()
%7 = tail call i32 (...) @checkDisk5()
%8 = tail call i32 (...) @checkDisk6()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int T9840_kad_validation(int encrypt_mode, int ukad, int akad) {
  if (ukad > 30 || akad > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<T9840_kad_validation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jg     1121 <T9840_kad_validation+0x21>
cmpl   $0x0,-0x10(%rbp)
jle    112d <T9840_kad_validation+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <T9840_kad_validation+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<T9840_kad_validation>:
cmp    $0x1f,%esi
setge  %al
test   %edx,%edx
setg   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @T9840_kad_validation(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 30
%5 = icmp sgt i32 %2, 0
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a;
  const int money = 32;
  a = 23 + 200;
  printf("%d\n", a);
  a = money + 100;
  printf("%d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 223)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 132)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int a = 3;
  int b = 2;
  printf("%.2f", (float)a / (float)b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float 1.500000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x50() {
  Assert_real((islower(80) == 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_islower.c",
              405, ("islower should be 0 for P"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x195,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for P\00"
define void @t_islower_0x50() {
%1 = call i64 @islower(i32 80)
%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 405, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for P\00"
define void @t_islower_0x50() {
%1 = tail call i64 @islower(i32 80)
%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 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void USART1_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<USART1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <USART1_IRQHandler+0x9>
jmp    1109 <USART1_IRQHandler+0x9>

x86 assembly (clang, -O2):
<USART1_IRQHandler>:
jmp    1100 <USART1_IRQHandler>

LLVM IR (-O0):
define void @USART1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @USART1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void f(int *p, int n) {
  *p = 1;
  exit(-1);
  --n;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<f>:
push   %rax
movl   $0x1,(%rdi)
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @f(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 1, i32* %5
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @f(i32* nocapture writeonly %0, i32 %1) {
store i32 1, i32* %0
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
long double abs(long double x) {
  if (x < 0)
    return (x - x) - (x);
  else
    return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    112f <abs+0x2f>
jmp    111e <abs+0x1e>
fldt   -0x20(%rbp)
fld    %st(0)
fsub   %st(1),%st
fsubp  %st,%st(1)
fstpt  -0x10(%rbp)
jmp    1135 <abs+0x35>
fldt   -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fsub   %st(1),%st
fsub   %st(1),%st
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @abs(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fcmp olt x86_fp80 %4, 0xK00000000000000000000
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load x86_fp80, x86_fp80* %3
%8 = load x86_fp80, x86_fp80* %3
%9 = fsub x86_fp80 %7, %8
%10 = load x86_fp80, x86_fp80* %3
%11 = fsub x86_fp80 %9, %10
store x86_fp80 %11, x86_fp80* %2
br label %14
12: ; preds = %1
%13 = load x86_fp80, x86_fp80* %3
store x86_fp80 %13, x86_fp80* %2
br label %14
14: ; preds = %12, %6
%15 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @abs(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fsub x86_fp80 %0, %0
%4 = fsub x86_fp80 %3, %0
%5 = select i1 %2, x86_fp80 %4, x86_fp80 %0
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ msgShowWindow();
void input_history(void) { msgShowWindow(); }


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

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

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

LLVM IR (-O2):
define void @input_history() {
%1 = tail call i32 (...) @msgShowWindow()
ret void
}
void NOR_SPI_TX_ISR(void) {}


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

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

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

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