xunge/DecIR huggingface dataset:
int __attribute__((no)) nleu(unsigned a, unsigned b) { return -(a <= b); }


x86 assembly (clang, -O0):
<nleu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nleu>:
xor    %eax,%eax
cmp    %edi,%esi
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @nleu(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 ule i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @nleu(i32 %0, i32 %1) {
%3 = icmp ule i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
double fsq(double x) { return x * x; }


x86 assembly (clang, -O0):
<fsq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @fsq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void iSeries_pcibios_fixup_resources(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @iSeries_pcibios_fixup_resources(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void fatal(char *s, char *p) {
  fprintf(stderr, "Deroff: ");
  fprintf(stderr, s, p);
  exit(1);
}


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

x86 assembly (clang, -O2):
<fatal>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"Deroff: \00"
define void @fatal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"Deroff: \00"
define void @fatal(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int isDigit(int s) {
  if ((s >= '0') && (s <= '9')) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <isDigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <isDigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isDigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isDigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isDigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void ScaleRowDown38_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_Any_SSSE3() {
ret void
}
int ft_isprint(int c) { return (c >= ' ' && c <= '~'); }


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printSeq(int, int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int m, n;
  scanf("%d%d", &n, &m);
  int arr[m];
  printSeq(n, m, 0, arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <printSeq@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
lea    0xed3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <printSeq@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %2)
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i32, i64 %8
store i64 %8, i64* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = call i32 @printSeq(i32 %11, i32 %12, i32 0, i32* %10)
store i32 0, i32* %1
%14 = load i8*, i8** %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i32, i64 %7
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = call i32 @printSeq(i32 %10, i32 %11, i32 0, i32* %9)
ret i32 0
}
void null_pruning2_Bad(int *p) {
  if (p != 0) {
    if (p != 0) {
      int a[5];
      a[10] = 1;
    }
  }
}


x86 assembly (clang, -O0):
<null_pruning2_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112a <null_pruning2_Bad+0x2a>
cmpq   $0x0,-0x8(%rbp)
je     1125 <null_pruning2_Bad+0x25>
movl   $0x1,0x8(%rbp)
jmp    112a <null_pruning2_Bad+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_pruning2_Bad(i32* %0) {
%2 = alloca i32*
%3 = alloca [5 x i32]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 10
store i32 1, i32* %10
br label %11
11: ; preds = %9, %6
br label %12
12: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @null_pruning2_Bad(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int adau1761_check_sample_rate(unsigned long);
int codec_check_sample_rate(unsigned long sample_rate) {
  return adau1761_check_sample_rate(sample_rate);
}


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

x86 assembly (clang, -O2):
<codec_check_sample_rate>:
jmp    1030 <adau1761_check_sample_rate@plt>

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

LLVM IR (-O2):
define i32 @codec_check_sample_rate(i64 %0) {
%2 = tail call i32 @adau1761_check_sample_rate(i64 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cJSON_Free(char *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cJSON_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int roadmap_string_hash(const char *value, int length) {
  int i;
  unsigned hash = (unsigned)(value[0]);
  for (i = length - 1; i > 0; --i) {
    hash = (9 * hash) + (unsigned)(value[i]);
  }
  return hash % 253;
}


x86 assembly (clang, -O0):
<roadmap_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    114b <roadmap_string_hash+0x4b>
imul   $0x9,-0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    111e <roadmap_string_hash+0x1e>
mov    -0x14(%rbp),%eax
mov    $0xfd,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_string_hash>:
movsbl (%rdi),%eax
cmp    $0x2,%esi
jl     1126 <roadmap_string_hash+0x26>
mov    %esi,%ecx
add    $0x1,%rcx
xchg   %ax,%ax
lea    -0x2(%rcx),%edx
lea    (%rax,%rax,8),%esi
movsbl (%rdi,%rdx,1),%eax
add    %esi,%eax
add    $0xffffffffffffffff,%rcx
cmp    $0x2,%rcx
ja     1110 <roadmap_string_hash+0x10>
mov    %eax,%ecx
mov    $0x81848da9,%edx
imul   %rcx,%rdx
shr    $0x27,%rdx
imul   $0xfd,%edx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @roadmap_string_hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %1, 1
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %11, %8 ]
%10 = phi i32 [ %4, %6 ], [ %17, %8 ]
%11 = add nsw i64 %9, -1
%12 = mul i32 %10, 9
%13 = and i64 %11, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = add i32 %12, %16
%18 = icmp ugt i64 %9, 2
br i1 %18, label %8, label %19
19: ; preds = %8, %2
%20 = phi i32 [ %4, %2 ], [ %17, %8 ]
%21 = urem i32 %20, 253
ret i32 %21
}
int kxtf9_exit(void *mlsl_handle, struct ext_slave_descr *slave,
               struct ext_slave_platform_data *pdata) {
  return (0);
}


x86 assembly (clang, -O0):
<kxtf9_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ext_slave_descr = type opaque
%struct.ext_slave_platform_data = type opaque
define i32 @kxtf9_exit(i8* %0, %struct.ext_slave_descr* %1, %struct.ext_slave_platform_data* %2) {
%4 = alloca i8*
%5 = alloca %struct.ext_slave_descr*
%6 = alloca %struct.ext_slave_platform_data*
store i8* %0, i8** %4
store %struct.ext_slave_descr* %1, %struct.ext_slave_descr** %5
store %struct.ext_slave_platform_data* %2, %struct.ext_slave_platform_data** %6
ret i32 0
}

LLVM IR (-O2):
%struct.ext_slave_descr = type opaque
%struct.ext_slave_platform_data = type opaque
define i32 @kxtf9_exit(i8* nocapture readnone %0, %struct.ext_slave_descr* nocapture readnone %1, %struct.ext_slave_platform_data* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
double M_PI;
double get_deg_from_rad(double rad) { return rad * 180 / M_PI; }


x86 assembly (clang, -O0):
<get_deg_from_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_deg_from_rad>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @get_deg_from_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @get_deg_from_rad(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int psi_probe_psi_fp(int /*<<< orphan*/ *);
int psi_probe_psi(const char *fname) {
  int r;
  FILE *fp;
  if ((fp = fopen(fname, "rb")) == NULL) {
    return (0);
  }
  r = psi_probe_psi_fp(fp);
  fclose(fp);
  return (r);
}


x86 assembly (clang, -O0):
<psi_probe_psi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1166 <psi_probe_psi+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1181 <psi_probe_psi+0x51>
mov    -0x20(%rbp),%rdi
call   1050 <psi_probe_psi_fp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_probe_psi>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     115d <psi_probe_psi+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <psi_probe_psi_fp@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
jmp    115f <psi_probe_psi+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @psi_probe_psi(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @psi_probe_psi_fp(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void cleanup(int s) {
  printf(">> Se interrumpió la comunicación con el servidor.\n");
  close(s);
  exit(1);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c">> Se interrumpi\C3\B3 la comunicaci\C3\B3n con el servidor.\0A\00"
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [53 x i8] c">> Se interrumpi\C3\B3 la comunicaci\C3\B3n con el servidor.\00"
define void @cleanup(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char const *_dns_get_answered_ip(char const *, size_t, int);
const char *dns_get_answered_ip(const char *rsp, size_t len) {
  return _dns_get_answered_ip(rsp, len, 1);
}


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

x86 assembly (clang, -O2):
<dns_get_answered_ip>:
mov    $0x1,%edx
jmp    1030 <_dns_get_answered_ip@plt>

LLVM IR (-O0):
define i8* @dns_get_answered_ip(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @_dns_get_answered_ip(i8* %5, i64 %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @dns_get_answered_ip(i8* %0, i64 %1) {
%3 = tail call i8* @_dns_get_answered_ip(i8* %0, i64 %1, i32 1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_OV7649(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_OV7649>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_OV7649>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_OV7649(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_OV7649(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mt_freecontext(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @mt_freecontext(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ cpuHalt();
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void newSigIntHandler(int signum) {
  signal(SIGINT, newSigIntHandler);
  cpuHalt();
}


x86 assembly (clang, -O0):
<newSigIntHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rsi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <cpuHalt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newSigIntHandler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rsi
call   1040 <signal@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cpuHalt@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @newSigIntHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = call i32 @signal(i32 %3, void (i32)* @newSigIntHandler)
%5 = call i32 (...) @cpuHalt()
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @newSigIntHandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, void (i32)* @newSigIntHandler)
%4 = tail call i32 (...) @cpuHalt()
ret void
}
long long zszu() { return 0x0000ffff00007fffLL; }


x86 assembly (clang, -O0):
<zszu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff00007fff,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @zszu() {
ret i64 281470681776127
}

LLVM IR (-O2):
define i64 @zszu() {
ret i64 281470681776127
}
/* Variables and functions */
char *strchr(char const *, int const);
size_t string_count_char(const char *str, const int c) {
  size_t count = 0;
  const char *tmp = str;
  while ((tmp = strchr(tmp, c)) != NULL) {
    tmp++;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<string_count_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1166 <string_count_char+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <string_count_char+0x1f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_count_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1147 <string_count_char+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0x1,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <string_count_char+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @string_count_char(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i64 %7, 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i32 %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i64 [ 0, %2 ], [ %9, %5 ]
ret i64 %13
}
/* Variables and functions */
int SetEnvironmentVariable(char const *, char const *);
int setenv(const char *a, const char *b, int c) {
  (void)c;
  return SetEnvironmentVariable(a, b);
}


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

x86 assembly (clang, -O2):
<setenv>:
jmp    1030 <SetEnvironmentVariable@plt>

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

LLVM IR (-O2):
define i32 @setenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @SetEnvironmentVariable(i8* %0, i8* %1)
ret i32 %4
}
int bitcount1(unsigned int x) {
  int b = 0;
  for (b = 0; x != 0; x >>= 1) {
    if (x & 01)
      b++;
  };
  return b;
}


x86 assembly (clang, -O0):
<bitcount1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <bitcount1+0x4a>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <bitcount1+0x37>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <bitcount1+0x3c>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1115 <bitcount1+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount1>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <bitcount1+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitcount1+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
void retro_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @retro_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void showVersion() {
  fprintf(stderr, "LXZ Assembler. Version %s\n\n", "0.0.12");
}


x86 assembly (clang, -O0):
<showVersion>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xef1(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showVersion>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xef5(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"LXZ Assembler. Version %s\0A\0A\00"
@.str.1 = [7 x i8] c"0.0.12\00"
define void @showVersion() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"LXZ Assembler. Version %s\0A\0A\00"
@.str.1 = [7 x i8] c"0.0.12\00"
define void @showVersion() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tms {
  scalar_t__ tms_stime;
  scalar_t__ tms_utime;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
clock_t clock(void) {
  struct tms tmsptr;
  times(&tmsptr);
  return tmsptr.tms_utime + tmsptr.tms_stime;
}


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

x86 assembly (clang, -O2):
<clock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
mov    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
define i64 @clock() {
%1 = alloca %struct.tms
%2 = call i32 @times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.tms = type { i64, i64 }
define i64 @clock() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void log_verr(const char *fmt, va_list ap) {
  (void)vfprintf(stderr, fmt, ap);
  (void)fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<log_verr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_verr>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
call   1040 <vfprintf@plt>
mov    (%rbx),%edi
lea    0xec3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @log_verr(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ vsprintf(char *, char const *, char *);
int write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int printf(const char *fmt, ...) {
  char ptfbuf[512];
  char *args = (char *)(((char *)&fmt) + 4);
  vsprintf(ptfbuf, fmt, args);
  return write(0, ptfbuf, strlen(ptfbuf));
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x218(%rbp),%rdx
lea    -0x210(%rbp),%rdi
mov    %rdi,-0x220(%rbp)
call   1050 <vsprintf@plt>
mov    -0x220(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x220(%rbp),%rsi
mov    %eax,%edx
xor    %edi,%edi
call   1030 <write@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rbx
sub    $0x210,%rsp
mov    %rdi,%rsi
mov    %rdi,0x8(%rsp)
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <vsprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x210,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [512 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i8** %2 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8* %6, i8** %4
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = load i8*, i8** %4
%10 = call i32 @vsprintf(i8* %7, i8* %8, i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @write(i32 0, i8* %11, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = bitcast i8** %2 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 4
%7 = call i32 @vsprintf(i8* %4, i8* %0, i8* %6)
%8 = call i32 @strlen(i8* %4)
%9 = call i32 @write(i32 0, i8* %4, i32 %8)
ret i32 %9
}
int link(const char *oldpath, const char *newpath) { return 1; }


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
XPeekEvent() {}


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

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

LLVM IR (-O0):
define i32 @XPeekEvent() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XPeekEvent() {
ret i32 undef
}
int RAND_poll(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @RAND_poll() {
ret i32 1
}

LLVM IR (-O2):
define i32 @RAND_poll() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t net_checksum16_foldcarry(uint32_t v) {
  v = (v >> 16) + (v & 0xffff);
  v += v >> 16;
  return v;
}


x86 assembly (clang, -O0):
<net_checksum16_foldcarry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_checksum16_foldcarry>:
movzwl %di,%ecx
sar    $0x10,%edi
add    %edi,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @net_checksum16_foldcarry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 16
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @net_checksum16_foldcarry(i32 %0) {
%2 = ashr i32 %0, 16
%3 = and i32 %0, 65535
%4 = add nsw i32 %2, %3
%5 = ashr i32 %4, 16
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int FP64_MAKE(int, int, int);
int /*<<< orphan*/ assert(int);
uint64_t FP64_NAN(bool sign, uint64_t payload) {
  assert(payload);
  assert(payload < 0x10000000000000LL);
  return FP64_MAKE(sign, 0x7ff, payload);
}


x86 assembly (clang, -O0):
<FP64_NAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <assert@plt>
movslq -0x8(%rbp),%rax
movabs $0x10000000000000,%rcx
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x7ff,%esi
call   1030 <FP64_MAKE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP64_NAN>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    %ebp,%edi
mov    $0x7ff,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <FP64_MAKE@plt>

LLVM IR (-O0):
define i32 @FP64_NAN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, 4503599627370496
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @FP64_MAKE(i32 %12, i32 2047, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @FP64_NAN(i32 %0, i32 %1) {
%3 = tail call i32 @assert(i32 %1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @FP64_MAKE(i32 %0, i32 2047, i32 %1)
ret i32 %5
}
/* Variables and functions */
double M_PI;
double to_radians(double d) { return d * (M_PI / 180.0); }


x86 assembly (clang, -O0):
<to_radians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_radians>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
divsd  0xeed(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @to_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double %4, 1.800000e+02
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @to_radians(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double %2, 1.800000e+02
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int m_strlen(char const *);
char *xmemdupstr(char const *, int);
char *m_substrdup(const char *s, const char *end) {
  return xmemdupstr((s), (end ? end - s : m_strlen(s)));
}


x86 assembly (clang, -O0):
<m_substrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <m_substrdup+0x37>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1166 <m_substrdup+0x46>
mov    -0x8(%rbp),%rdi
call   1030 <m_strlen@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %eax,%esi
call   1040 <xmemdupstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_substrdup>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     112e <m_substrdup+0xe>
sub    %rbx,%rsi
jmp    1138 <m_substrdup+0x18>
mov    %rbx,%rdi
call   1030 <m_strlen@plt>
mov    %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xmemdupstr@plt>

LLVM IR (-O0):
define i8* @m_substrdup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
br label %18
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = call i32 @m_strlen(i8* %15)
%17 = sext i32 %16 to i64
br label %18
18: ; preds = %14, %8
%19 = phi i64 [ %13, %8 ], [ %17, %14 ]
%20 = trunc i64 %19 to i32
%21 = call i8* @xmemdupstr(i8* %5, i32 %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @m_substrdup(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
br label %11
8: ; preds = %2
%9 = tail call i32 @m_strlen(i8* %0)
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %8, %4
%12 = phi i64 [ %7, %4 ], [ %10, %8 ]
%13 = trunc i64 %12 to i32
%14 = tail call i8* @xmemdupstr(i8* %0, i32 %13)
ret i8* %14
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  const char *ss = s;
  while (n-- && *ss)
    ss++;
  return ss - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1163 <strnlen+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Variables and functions */
float fmodf(float, float);
float m_mod_f(float a, float n) { return fmodf(a, n); }


x86 assembly (clang, -O0):
<m_mod_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmodf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_mod_f>:
jmp    1030 <fmodf@plt>

LLVM IR (-O0):
define float @m_mod_f(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 = call float @fmodf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @m_mod_f(float %0, float %1) {
%3 = tail call float @fmodf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void exec_usage(int status) {
  fputs("HELLO\n\n", stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<exec_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exec_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"HELLO\0A\0A\00"
@stdout = global i32 0
define void @exec_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"HELLO\0A\0A\00"
@stdout = global i32 0
define void @exec_usage(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}