xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int64_t delay_ms(const struct timeval *t1, const struct timeval *t2) {
  return (int64_t)(t2->tv_sec - t1->tv_sec) * 1000 +
         (t2->tv_usec - t1->tv_usec) / 1000;
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
mov    (%rsi),%eax
mov    0x8(%rsi),%ecx
sub    0x8(%rdi),%ecx
imul   $0x3e8,%ecx,%ecx
sub    (%rdi),%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @delay_ms(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
%13 = mul nsw i32 %12, 1000
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = sub nsw i32 %16, %19
%21 = sdiv i32 %20, 1000
%22 = add nsw i32 %13, %21
ret i32 %22
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @delay_ms(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%13 = load i32, i32* %12
%14 = sub nsw i32 %11, %13
%15 = sdiv i32 %14, 1000
%16 = add nsw i32 %15, %9
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int setsockopt(int, int /*<<< orphan*/, int, int *, int);
int fnet_set_reuse_port(int fd) {
  (void)fd;
  int optval = 0x1;
  return setsockopt(fd, SOL_SOCKET, 15, &optval, sizeof(int));
}


x86 assembly (clang, -O0):
<fnet_set_reuse_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    $0xf,%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnet_set_reuse_port>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rcx
mov    $0xf,%edx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
define i32 @fnet_set_reuse_port(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = call i32 @setsockopt(i32 %5, i32 %6, i32 15, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
define i32 @fnet_set_reuse_port(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = call i32 @setsockopt(i32 %0, i32 %4, i32 15, i32* %2, i32 4)
ret i32 %5
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
uint32_t strchrcount(const char *str, char symbol) {
  uint32_t count = 0;
  for (uint32_t i = 0; str[i] != '\0'; i++) {
    if (str[i] == symbol)
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<strchrcount>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116d <strchrcount+0x6d>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1157 <strchrcount+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115c <strchrcount+0x5c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <strchrcount+0x1e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strchrcount+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strchrcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strchrcount(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i64 [ 0, %2 ], [ %13, %7 ]
ret i64 %6
7: ; preds = %2, %7
%8 = phi i8 [ %16, %7 ], [ %3, %2 ]
%9 = phi i64 [ %14, %7 ], [ 0, %2 ]
%10 = phi i64 [ %13, %7 ], [ 0, %2 ]
%11 = icmp eq i8 %8, %1
%12 = zext i1 %11 to i64
%13 = add i64 %10, %12
%14 = add i64 %9, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %5, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ SwoVPrintfOnChannel(int /*<<< orphan*/, char const *,
                                       int /*<<< orphan*/);
void SwoVPrintf(const char *format, va_list arguments) {
  SwoVPrintfOnChannel(0, format, arguments);
}


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

x86 assembly (clang, -O2):
<SwoVPrintf>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <SwoVPrintfOnChannel@plt>

LLVM IR (-O0):
define void @SwoVPrintf(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 = load i32, i32* %4
%7 = call i32 @SwoVPrintfOnChannel(i32 0, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @SwoVPrintf(i8* %0, i32 %1) {
%3 = tail call i32 @SwoVPrintfOnChannel(i32 0, i8* %0, i32 %1)
ret void
}
int polynomial(int vet[], int p[], int n, int a, int ind) {
  int qx;
  if (n == ind - 1) {
    qx = vet[ind];
  } else {
    qx = (p[n + 1] * a) + vet[n + 1];
  }
  return qx;
}


x86 assembly (clang, -O0):
<polynomial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    113a <polynomial+0x3a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
jmp    1161 <polynomial+0x61>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
imul   -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<polynomial>:
mov    %ecx,%eax
lea    -0x1(%r8),%ecx
cmp    %edx,%ecx
jne    1111 <polynomial+0x11>
movslq %r8d,%rax
mov    (%rdi,%rax,4),%eax
ret
movslq %edx,%rcx
imul   0x4(%rsi,%rcx,4),%eax
add    0x4(%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @polynomial(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %8
%13 = load i32, i32* %10
%14 = sub nsw i32 %13, 1
%15 = icmp eq i32 %12, %14
br i1 %15, label %16, label %22
16: ; preds = %5
%17 = load i32*, i32** %6
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
store i32 %21, i32* %11
br label %38
22: ; preds = %5
%23 = load i32*, i32** %7
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %23, i64 %26
%28 = load i32, i32* %27
%29 = load i32, i32* %9
%30 = mul nsw i32 %28, %29
%31 = load i32*, i32** %6
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %31, i64 %34
%36 = load i32, i32* %35
%37 = add nsw i32 %30, %36
store i32 %37, i32* %11
br label %38
38: ; preds = %22, %16
%39 = load i32, i32* %11
ret i32 %39
}

LLVM IR (-O2):
define i32 @polynomial(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, %2
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
br label %21
12: ; preds = %5
%13 = add nsw i32 %2, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %1, i64 %14
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, %3
%18 = getelementptr inbounds i32, i32* %0, i64 %14
%19 = load i32, i32* %18
%20 = add nsw i32 %17, %19
br label %21
21: ; preds = %12, %8
%22 = phi i32 [ %11, %8 ], [ %20, %12 ]
ret i32 %22
}
int comp(const void *_a, const void *_b) {
  float a = *(const float *)_a;
  float b = *(const float *)_b;
  return a < b ? -1 : a > b;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1146 <comp+0x46>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <comp+0x5a>
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %22
17: ; preds = %2
%18 = load float, float* %5
%19 = load float, float* %6
%20 = fcmp ogt float %18, %19
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %17, %16
%23 = phi i32 [ -1, %16 ], [ %21, %17 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct cli_val_byte {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_val_byte_data(struct cli_val_byte *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, void const *, size_t);
int cli_val_byte_parse_binary(struct cli_val_byte *v, const void *b,
                              size_t length) {
  size_t size = 1;
  if (size > length) {
    return 0;
  }
  memcpy(cli_val_byte_data(v), b, size);
  return size;
}


x86 assembly (clang, -O0):
<cli_val_byte_parse_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1156 <cli_val_byte_parse_binary+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1175 <cli_val_byte_parse_binary+0x55>
mov    -0x10(%rbp),%rdi
call   1030 <cli_val_byte_data@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_val_byte_parse_binary>:
test   %rdx,%rdx
je     1144 <cli_val_byte_parse_binary+0x24>
push   %rbx
mov    %rsi,%rbx
call   1030 <cli_val_byte_data@plt>
mov    $0x1,%edx
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.cli_val_byte = type { i32 }
define i32 @cli_val_byte_parse_binary(%struct.cli_val_byte* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.cli_val_byte*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store %struct.cli_val_byte* %0, %struct.cli_val_byte** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 1, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %7
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 0, i32* %4
br label %21
13: ; preds = %3
%14 = load %struct.cli_val_byte*, %struct.cli_val_byte** %5
%15 = call i32 @cli_val_byte_data(%struct.cli_val_byte* %14)
%16 = load i8*, i8** %6
%17 = load i64, i64* %8
%18 = call i32 @memcpy(i32 %15, i8* %16, i64 %17)
%19 = load i64, i64* %8
%20 = trunc i64 %19 to i32
store i32 %20, i32* %4
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.cli_val_byte = type { i32 }
define i32 @cli_val_byte_parse_binary(%struct.cli_val_byte* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @cli_val_byte_data(%struct.cli_val_byte* %0)
%7 = tail call i32 @memcpy(i32 %6, i8* %1, i64 1)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo();
int main() {
  if (foo())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
struct mq_attr {
  int dummy;
};
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_mq_getsetattr;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, struct mq_attr *,
            struct mq_attr *);
int stp_mq_getsetattr(mqd_t mqdes, struct mq_attr *newattr,
                      struct mq_attr *oldattr) {
  return syscall(__NR_mq_getsetattr, mqdes, newattr, oldattr);
}


x86 assembly (clang, -O0):
<stp_mq_getsetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stp_mq_getsetattr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.mq_attr = type { i32 }
@__NR_mq_getsetattr = global i32 0
define i32 @stp_mq_getsetattr(i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2) {
%4 = alloca i32
%5 = alloca %struct.mq_attr*
%6 = alloca %struct.mq_attr*
store i32 %0, i32* %4
store %struct.mq_attr* %1, %struct.mq_attr** %5
store %struct.mq_attr* %2, %struct.mq_attr** %6
%7 = load i32, i32* @__NR_mq_getsetattr
%8 = load i32, i32* %4
%9 = load %struct.mq_attr*, %struct.mq_attr** %5
%10 = load %struct.mq_attr*, %struct.mq_attr** %6
%11 = call i32 @syscall(i32 %7, i32 %8, %struct.mq_attr* %9, %struct.mq_attr* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.mq_attr = type { i32 }
@__NR_mq_getsetattr = global i32 0
define i32 @stp_mq_getsetattr(i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2) {
%4 = load i32, i32* @__NR_mq_getsetattr
%5 = tail call i32 @syscall(i32 %4, i32 %0, %struct.mq_attr* %1, %struct.mq_attr* %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t aeron_driver_conductor_null_epoch_clock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @aeron_driver_conductor_null_epoch_clock() {
ret i32 0
}
void Sync_refresh() {}


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

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

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

LLVM IR (-O2):
define void @Sync_refresh() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_faces_bestsource();
int /*<<< orphan*/ test_ifaces_dump_addresses();
int /*<<< orphan*/ test_ifaces_dump_ifaces();
void test_ifaces() {
  test_faces_bestsource();
  test_ifaces_dump_ifaces();
  test_ifaces_dump_addresses();
}


x86 assembly (clang, -O0):
<test_ifaces>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_faces_bestsource@plt>
mov    $0x0,%al
call   1030 <test_ifaces_dump_ifaces@plt>
mov    $0x0,%al
call   1040 <test_ifaces_dump_addresses@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ifaces>:
push   %rax
xor    %eax,%eax
call   1050 <test_faces_bestsource@plt>
xor    %eax,%eax
call   1030 <test_ifaces_dump_ifaces@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_ifaces_dump_addresses@plt>

LLVM IR (-O0):
define void @test_ifaces() {
%1 = call i32 (...) @test_faces_bestsource()
%2 = call i32 (...) @test_ifaces_dump_ifaces()
%3 = call i32 (...) @test_ifaces_dump_addresses()
ret void
}

LLVM IR (-O2):
define void @test_ifaces() {
%1 = tail call i32 (...) @test_faces_bestsource()
%2 = tail call i32 (...) @test_ifaces_dump_ifaces()
%3 = tail call i32 (...) @test_ifaces_dump_addresses()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ ppc_write(int /*<<< orphan*/, char const *, unsigned int);
void print(const char *text) {
  unsigned sz;
  for (sz = 0; text[sz] != '\0'; sz++) {
  }
  ppc_write(STDOUT_FILENO, text, sz);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114a <print+0x3a>
jmp    113c <print+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print+0x13>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <ppc_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
mov    $0xffffffff,%edx
nopl   0x0(%rax,%rax,1)
add    $0x1,%edx
cmpb   $0x0,(%rsi,%rdx,1)
jne    1120 <print+0x10>
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ppc_write@plt>

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

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @print(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = load i32, i32* @STDOUT_FILENO
%11 = tail call i32 @ppc_write(i32 %10, i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_start(int);
void write_one_page_start(void) {
  ssize_t n;
  init_test();
  n = log_write_start(4096);
  basic_test(n == 4096);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_page_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1050 <log_write_start@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1040 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_page_start>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1050 <log_write_start@plt>
xor    %edi,%edi
cmp    $0x1000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_page_start() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_start(i32 4096)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 4096
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_page_start() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_start(i32 4096)
%3 = icmp eq i32 %2, 4096
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
double signalVoltage();
double determineDistanceToSignal(void) { return signalVoltage(); }


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

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

LLVM IR (-O0):
define double @determineDistanceToSignal() {
%1 = call double (...) @signalVoltage()
ret double %1
}

LLVM IR (-O2):
define double @determineDistanceToSignal() {
%1 = tail call double (...) @signalVoltage()
ret double %1
}
adr0imm1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*((unsigned char *)10000000)) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzbl (%rax),%eax
cmp    $0x21,%eax
jg     113b <adr0imm1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <adr0imm1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0imm1>:
xor    %eax,%eax
cmpb   $0x22,0x989680
22
setb   %al
ret

LLVM IR (-O0):
define i32 @adr0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 10000000 to i8*)
%17 = zext i8 %16 to i32
%18 = icmp sle i32 %17, 33
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adr0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 10000000 to i8*)
%8 = icmp ult i8 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_version(void) {
  printf("%.80s  %.80s\n", "Lua 4.0.1",
         "Copyright (C) 1994-2000 TeCGraf, PUC-Rio");
}


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
lea    0xef3(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%.80s %.80s\0A\00"
@.str.1 = [10 x i8] c"Lua 4.0.1\00"
@.str.2 = [41 x i8] c"Copyright (C) 1994-2000 TeCGraf, PUC-Rio\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%.80s %.80s\0A\00"
@.str.1 = [10 x i8] c"Lua 4.0.1\00"
@.str.2 = [41 x i8] c"Copyright (C) 1994-2000 TeCGraf, PUC-Rio\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_once(void) { puts("Hello, world!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define void @do_once() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define void @do_once() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int count_ones(int n) {
  switch (n) {
  case 4:
  case 5:
  case 9:
    return 4;
  case 1:
  case 2:
  case 6:
    return 3;
  case 3:
  case 7:
  case 8:
    return 5;
  default:
    assert(0);
  }
}


x86 assembly (clang, -O0):
<count_ones>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1199 <count_ones+0x89>
jmp    1132 <count_ones+0x22>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11a5 <count_ones+0x95>
jmp    1143 <count_ones+0x33>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
jb     118d <count_ones+0x7d>
jmp    1157 <count_ones+0x47>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     1199 <count_ones+0x89>
jmp    1168 <count_ones+0x58>
mov    -0xc(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     11a5 <count_ones+0x95>
jmp    117c <count_ones+0x6c>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
jne    11b1 <count_ones+0xa1>
jmp    118d <count_ones+0x7d>
movl   $0x4,-0x4(%rbp)
jmp    11b8 <count_ones+0xa8>
movl   $0x3,-0x4(%rbp)
jmp    11b8 <count_ones+0xa8>
movl   $0x5,-0x4(%rbp)
jmp    11b8 <count_ones+0xa8>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ones>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x9,%edi
jae    1128 <count_ones+0x18>
movslq %edi,%rax
lea    0xedd(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @count_ones(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 4, label %5
i32 5, label %5
i32 9, label %5
i32 1, label %6
i32 2, label %6
i32 6, label %6
i32 3, label %7
i32 7, label %7
i32 8, label %7
]
5: ; preds = %1, %1, %1
store i32 4, i32* %2
br label %10
6: ; preds = %1, %1, %1
store i32 3, i32* %2
br label %10
7: ; preds = %1, %1, %1
store i32 5, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 @assert(i32 0)
br label %10
10: ; preds = %5, %6, %7, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.count_ones = [9 x i32] [i32 3, i32 3, i32 5, i32 4, i32 4, i32 3, i32 5, i32 5, i32 4]
define i32 @count_ones(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 9
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @assert(i32 0)
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.count_ones, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ undef, %4 ], [ %9, %6 ]
ret i32 %11
}
int TVM_API(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @TVM_API() {
ret i32 7
}

LLVM IR (-O2):
define i32 @TVM_API() {
ret i32 7
}
/* Type definitions */
struct message {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fdopen(int, char *);
int message_deserialize(int /*<<< orphan*/ *, struct message *);
int /*<<< orphan*/ slog(char *);
int recv_message(struct message *message, int socket_fd) {
  FILE *socket_file = fdopen(socket_fd, "r+");
  if (socket_file == NULL)
    slog("fdopen()");
  return message_deserialize(socket_file, message);
}


x86 assembly (clang, -O0):
<recv_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fdopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <recv_message+0x39>
lea    0xe9f(%rip),%rdi
call   1030 <slog@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <message_deserialize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_message>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%r14
lea    0xec0(%rip),%rsi
mov    %eax,%edi
call   1040 <fdopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <recv_message+0x2b>
lea    0xead(%rip),%rdi
call   1030 <slog@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <message_deserialize@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
@.str = [3 x i8] c"r+\00"
@.str.1 = [9 x i8] c"fdopen()\00"
define i32 @recv_message(%struct.message* %0, i32 %1) {
%3 = alloca %struct.message*
%4 = alloca i32
%5 = alloca i32*
store %struct.message* %0, %struct.message** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32* @fdopen(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @slog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load %struct.message*, %struct.message** %3
%15 = call i32 @message_deserialize(i32* %13, %struct.message* %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.message = type { i32 }
@.str = [3 x i8] c"r+\00"
@.str.1 = [9 x i8] c"fdopen()\00"
define i32 @recv_message(%struct.message* %0, i32 %1) {
%3 = tail call i32* @fdopen(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @slog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @message_deserialize(i32* %3, %struct.message* %0)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ feed_sig(char);
void do_sigterm(int signo) { feed_sig('T'); }


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

x86 assembly (clang, -O2):
<do_sigterm>:
mov    $0x54,%edi
jmp    1030 <feed_sig@plt>

LLVM IR (-O0):
define void @do_sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @feed_sig(i8 signext 84)
ret void
}

LLVM IR (-O2):
define void @do_sigterm(i32 %0) {
%2 = tail call i32 @feed_sig(i8 signext 84)
ret void
}
/* Variables and functions */
int revoke(char *);
int main(void) { return revoke("/"); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ get_pin(int /*<<< orphan*/, int, int);
uint8_t io_get_interrupt_on_pin(uint8_t pin) {
  return get_pin(pin, 0x04, 0x05);
}


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

x86 assembly (clang, -O2):
<io_get_interrupt_on_pin>:
mov    $0x4,%esi
mov    $0x5,%edx
jmp    1030 <get_pin@plt>

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

LLVM IR (-O2):
define i32 @io_get_interrupt_on_pin(i32 %0) {
%2 = tail call i32 @get_pin(i32 %0, i32 4, i32 5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pattern_restore_pattern(int);
int seq_ctrl_get_first_track();
int seq_ctrl_get_scene();
int song_get_pattern_type(int, int);
void pattern_edit_restore_pattern(void) {
  int scene, track, pattern;
  scene = seq_ctrl_get_scene();
  track = seq_ctrl_get_first_track();
  pattern = song_get_pattern_type(scene, track);
  pattern_restore_pattern(pattern);
}


x86 assembly (clang, -O0):
<pattern_edit_restore_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <seq_ctrl_get_scene@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <seq_ctrl_get_first_track@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <song_get_pattern_type@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <pattern_restore_pattern@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern_edit_restore_pattern>:
push   %rbx
xor    %eax,%eax
call   1030 <seq_ctrl_get_scene@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <seq_ctrl_get_first_track@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <song_get_pattern_type@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <pattern_restore_pattern@plt>

LLVM IR (-O0):
define void @pattern_edit_restore_pattern() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @seq_ctrl_get_scene()
store i32 %4, i32* %1
%5 = call i32 (...) @seq_ctrl_get_first_track()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @song_get_pattern_type(i32 %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @pattern_restore_pattern(i32 %9)
ret void
}

LLVM IR (-O2):
define void @pattern_edit_restore_pattern() {
%1 = tail call i32 (...) @seq_ctrl_get_scene()
%2 = tail call i32 (...) @seq_ctrl_get_first_track()
%3 = tail call i32 @song_get_pattern_type(i32 %1, i32 %2)
%4 = tail call i32 @pattern_restore_pattern(i32 %3)
ret void
}
void gtk_vscrollbar_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vscrollbar_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xc1() {
  Assert_real((isspace(193) == 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_isspace.c",
              970, ("isspace should be 0 for 0xc1"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xc1>:
push   %rax
mov    $0xc1,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ca,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc1\00"
define void @t_isspace_0xc1() {
%1 = call i64 @isspace(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc1\00"
define void @t_isspace_0xc1() {
%1 = tail call i64 @isspace(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float sqrt(float);
float length(float x1, float y1, float x2, float y2) {
  return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm3
subss  -0x8(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
subss  %xmm0,%xmm2
subss  %xmm1,%xmm3
mulss  %xmm3,%xmm3
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     1134 <length+0x24>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
ret
movaps %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @length(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = load float, float* %7
%13 = load float, float* %5
%14 = fsub float %12, %13
%15 = load float, float* %8
%16 = load float, float* %6
%17 = fsub float %15, %16
%18 = load float, float* %8
%19 = load float, float* %6
%20 = fsub float %18, %19
%21 = fmul float %17, %20
%22 = call float @llvm.fmuladd.f32(float %11, float %14, float %21)
%23 = call float @sqrt(float %22)
ret float %23
}

LLVM IR (-O2):
define float @length(float %0, float %1, float %2, float %3) {
%5 = fsub float %2, %0
%6 = fsub float %3, %1
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
/* Variables and functions */
size_t strlen(char const *);
size_t Exynos_OSAL_Strlen(const char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<Exynos_OSAL_Strlen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @Exynos_OSAL_Strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @Exynos_OSAL_Strlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
void output_char(char c) {
  *(char *)(0x100000208) = c;
  return;
}


x86 assembly (clang, -O0):
<output_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
movabs $0x100000208,%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_char>:
movabs $0x100000208,%rax
mov    %dil,(%rax)
ret

LLVM IR (-O0):
define void @output_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store i8 %3, i8* inttoptr (i64 4294967816 to i8*)
ret void
}

LLVM IR (-O2):
define void @output_char(i8 signext %0) {
store i8 %0, i8* inttoptr (i64 4294967816 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void fs_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<fs_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @fs_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int d_ge_cr2(double a1) { return !(((100) >= (a1))); }


x86 assembly (clang, -O0):
<d_ge_cr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_cr2>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ge_cr2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_ge_cr2(double %0) {
%2 = fcmp ugt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ allocate_map();
int allocate_pid();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ release_pid(int);
int /*<<< orphan*/ stdout;
int main() {
  allocate_map();
  int j = allocate_pid();
  fprintf(stdout, "Allocated PID: %d \n", j);
  release_pid(j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <allocate_map@plt>
mov    $0x0,%al
call   1040 <allocate_pid@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe94(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1060 <release_pid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <allocate_map@plt>
xor    %eax,%eax
call   1040 <allocate_pid@plt>
mov    %eax,%ebx
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %ebx,%edx
call   1050 <fprintf@plt>
mov    %ebx,%edi
call   1060 <release_pid@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [20 x i8] c"Allocated PID: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @allocate_map()
%3 = call i32 (...) @allocate_pid()
store i32 %3, i32* %1
%4 = load i32, i32* @stdout
%5 = load i32, i32* %1
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @release_pid(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [20 x i8] c"Allocated PID: %d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @allocate_map()
%2 = tail call i32 (...) @allocate_pid()
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @release_pid(i32 %2)
ret i32 0
}
int do_686() { return 686; }


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

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

LLVM IR (-O0):
define i32 @do_686() {
ret i32 686
}

LLVM IR (-O2):
define i32 @do_686() {
ret i32 686
}