xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_timestamp_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xembed_message_send(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
void xembed_focus_out(xcb_connection_t *c, xcb_window_t client,
                      xcb_timestamp_t timestamp) {
  xembed_message_send(c, client, timestamp, 5, 0, 0, 0);
}


x86 assembly (clang, -O0):
<xembed_focus_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x5,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <xembed_message_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xembed_focus_out>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x5,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <xembed_message_send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @xembed_focus_out(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @xembed_message_send(i32* %0, i32 %1, i32 %2, i32 5, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
double exp(double);
double Bbp4a(double x) { return x * exp(-x); }


x86 assembly (clang, -O0):
<Bbp4a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bbp4a>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movapd %xmm0,(%rsp)
movapd 0xedb(%rip),%xmm0
xorpd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Bbp4a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %4
%6 = call double @exp(double %5)
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
define double @Bbp4a(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int BIT(int);
int wpa_key_mgmt_wpa_psk(int akm) {
  return !!(akm & (BIT(1) | BIT(6) | BIT(8) | BIT(10)));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa_psk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <BIT@plt>
mov    %eax,-0x14(%rbp)
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x8,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <BIT@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
or     %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa_psk>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    $0x1,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0x8,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0xa,%edi
call   1030 <BIT@plt>
or     %ebp,%eax
or     %ebx,%eax
xor    %ecx,%ecx
test   %r14d,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_wpa_psk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 1)
%5 = call i32 @BIT(i32 6)
%6 = or i32 %4, %5
%7 = call i32 @BIT(i32 8)
%8 = or i32 %6, %7
%9 = call i32 @BIT(i32 10)
%10 = or i32 %8, %9
%11 = and i32 %3, %10
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa_psk(i32 %0) {
%2 = tail call i32 @BIT(i32 1)
%3 = tail call i32 @BIT(i32 6)
%4 = or i32 %3, %2
%5 = tail call i32 @BIT(i32 8)
%6 = or i32 %4, %5
%7 = tail call i32 @BIT(i32 10)
%8 = or i32 %6, %7
%9 = and i32 %8, %0
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int main() {
  char buf[128];
  ssize_t nread;
  nread = read(10, buf, 1);
  if (nread == -1) {
    perror("read error:");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rsi
mov    $0xa,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0xffffffff,-0x94(%rbp)
jne    1167 <main+0x47>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    %rsp,%rsi
mov    $0xa,%edi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     1148 <main+0x28>
xor    %eax,%eax
add    $0x88,%rsp
ret
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
jmp    113e <main+0x1e>

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

LLVM IR (-O2):
@.str = [12 x i8] c"read error:\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 10, i8* %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xd6() {
  Assert_real((isxdigit(214) == 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_isxdigit.c",
              1075, ("isxdigit should be 0 for 0xd6"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xd6>:
push   %rax
mov    $0xd6,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x433,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd6\00"
define void @t_isxdigit_0xd6() {
%1 = call i64 @isxdigit(i32 214)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1075, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd6\00"
define void @t_isxdigit_0xd6() {
%1 = tail call i64 @isxdigit(i32 214)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1075, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void CG_DrawHoldableSelect(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_DrawHoldableSelect() {
ret void
}
void f16(float a, float b, float c, float d, float e, float f, float g, float h,
         float X) {}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f16(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
ret void
}

LLVM IR (-O2):
define void @f16(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
ret void
}
int waitpid(pid, istat, options)
int pid;
int *istat;
int options;
{ return (wait4(pid, istat, options, (struct rusage *)0)); }


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x0,%al
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <wait4@plt>

LLVM IR (-O0):
%struct.rusage = type opaque
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i32*, i32, %struct.rusage*, ...) bitcast (i32 (...)* @wait4 to i32 (i32, i32*, i32, %struct.rusage*, ...)*)(i32 %7, i32* %8, i32 %9, %struct.rusage* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.rusage = type opaque
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 (i32, i32*, i32, %struct.rusage*, ...) bitcast (i32 (...)* @wait4 to i32 (i32, i32*, i32, %struct.rusage*, ...)*)(i32 %0, i32* %1, i32 %2, %struct.rusage* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int strcmp(char *, char *);
int weirder_strcmp(char *a, char *b) {
  int val = strcmp(a, b);
  free(a);
  free(b);
  return val;
}


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

x86 assembly (clang, -O2):
<weirder_strcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @weirder_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strcmp(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @weirder_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 @free(i8* %0)
%5 = tail call i32 @free(i8* %1)
ret i32 %3
}
/* Variables and functions */
int STC3100_WriteByte(int, int /*<<< orphan*/);
int STC3100_Powerdown(void) {
  int s32_res;
  s32_res = STC3100_WriteByte(0x00, 0);
  if (s32_res != 0)
    return (s32_res);
  return (0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <STC3100_WriteByte@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1139 <STC3100_Powerdown+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <STC3100_Powerdown+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <STC3100_WriteByte@plt>

LLVM IR (-O0):
define i32 @STC3100_Powerdown() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @STC3100_WriteByte(i32 0, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @STC3100_Powerdown() {
%1 = tail call i32 @STC3100_WriteByte(i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ this_comparison_is_not_decidable();
void bla2ge(int var) {
  if (var + 10 >= INT_MIN + 11)
    this_comparison_is_not_decidable();
}


x86 assembly (clang, -O0):
<bla2ge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
add    $0xb,%ecx
cmp    %ecx,%eax
jl     113c <bla2ge+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_not_decidable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla2ge>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jge    1122 <bla2ge+0x12>
xor    %eax,%eax
jmp    1030 <this_comparison_is_not_decidable@plt>
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define void @bla2ge(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = load i32, i32* @INT_MIN
%6 = add nsw i32 %5, 11
%7 = icmp sge i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_not_decidable()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define void @bla2ge(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = icmp slt i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_not_decidable()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasConvBase() {
  wNotYet("ConvBase");
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasConvBase>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasConvBase>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ConvBase\00"
define void @wBasConvBase() {
%1 = call i32 @wNotYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ConvBase\00"
define void @wBasConvBase() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @wPushNumber(i32 0)
ret void
}
void ares_free_errmem(char *mem) {}


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

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

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

LLVM IR (-O2):
define void @ares_free_errmem(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ http_post_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wlan_init();
int main(int argc, char *argv[]) {
  wlan_init();
  http_post_test();
  printf("done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <wlan_init@plt>
mov    $0x0,%al
call   1050 <http_post_test@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [5 x i8] c"done\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @wlan_init()
%4 = tail call i32 (...) @http_post_test()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CA_CacheGrChunk(int);
void CacheLump(int lumpstart, int lumpend) {
  int i;
  for (i = lumpstart; i <= lumpend; i++)
    CA_CacheGrChunk(i);
}


x86 assembly (clang, -O0):
<CacheLump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1146 <CacheLump+0x36>
mov    -0xc(%rbp),%edi
call   1030 <CA_CacheGrChunk@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <CacheLump+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CacheLump>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jg     112e <CacheLump+0x1e>
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <CA_CacheGrChunk@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <CacheLump+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @CacheLump(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @CA_CacheGrChunk(i32 %5)
%7 = add i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void wl_cvsupdate(void) { errx(1, "This one isn't implementd yet."); }


x86 assembly (clang, -O0):
<wl_cvsupdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_cvsupdate>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"This one isn't implementd yet.\00"
define void @wl_cvsupdate() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"This one isn't implementd yet.\00"
define void @wl_cvsupdate() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
void BSP_WriteMemBarrier(void) {
  unsigned long tmp;
  tmp = 0xdeadbeef;
  ({
    unsigned long __v = tmp;
    (*(volatile unsigned long *)(0x21000000) = (__v));
    __v;
  });
  tmp = ({
    unsigned long __v = (*(volatile unsigned long *)(0x21000000));
    __v;
  });
}


x86 assembly (clang, -O0):
<BSP_WriteMemBarrier>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdeadbeef,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x21000000,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x21000000,%eax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_WriteMemBarrier>:
mov    $0xdeadbeef,%eax
mov    %rax,0x21000000
21
mov    0x21000000,%rax
21
ret

LLVM IR (-O0):
define void @BSP_WriteMemBarrier() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 3735928559, i64* %1
%6 = load i64, i64* %1
store i64 %6, i64* %2
%7 = load i64, i64* %2
store volatile i64 %7, i64* inttoptr (i64 553648128 to i64*)
%8 = load i64, i64* %2
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load volatile i64, i64* inttoptr (i64 553648128 to i64*)
store i64 %10, i64* %4
%11 = load i64, i64* %4
store i64 %11, i64* %5
%12 = load i64, i64* %5
store i64 %12, i64* %1
ret void
}

LLVM IR (-O2):
define void @BSP_WriteMemBarrier() {
store volatile i64 3735928559, i64* inttoptr (i64 553648128 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 553648128 to i64*)
ret void
}
double func1(double i) { return i + 1; }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @func1(double %0) {
%2 = fadd double %0, 1.000000e+00
ret double %2
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int time(int *);
int main() {
  time_t a, b;
  a = time(&b);
  assert(1262304000 < a);
  assert(a == b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4b3d3b00,%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0x4b3d3b01,%eax
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    0xc(%rsp),%ebx
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 1262304000, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = icmp sgt i32 %3, 1262304000
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = icmp eq i32 %3, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void deliver(int client, int msg) {
  {
    { puts("mail delivered\n"); }
    return;
  }
}


x86 assembly (clang, -O0):
<deliver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"mail delivered\0A\00"
define void @deliver(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"mail delivered\0A\00"
define void @deliver(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int clear_dobldobl_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(174, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_dobldobl_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xae,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_dobldobl_homotopy>:
mov    $0xae,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_dobldobl_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 174, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_dobldobl_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 174, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
__attribute__((no, noclone)) unsigned __int128 t171_3sub(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow((signed __int128)(3), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t171_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rsi,%rax
sar    $0x3f,%rax
xor    %ecx,%ecx
mov    $0x3,%edx
sub    %rdi,%rdx
mov    %ecx,%r9d
mov    %r9,%rcx
sbb    %rsi,%rcx
mov    %r9,%r8
sbb    %rax,%r8
sbb    %rax,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1190 <t171_3sub+0x80>
jmp    1197 <t171_3sub+0x87>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t171_3sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    $0x3,%ebx
sub    %rdi,%rbx
sbb    %rsi,%r14
cmp    $0x4,%rdi
sbb    $0x0,%rsi
jl     1133 <t171_3sub+0x23>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define { i64, i64 } @t171_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sub nsw i129 3, %7
%9 = icmp sgt i128 %6, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void sk_delete_ptr(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_delete_ptr() {
ret void
}
const char *Ipolweight2str(int method) {
  switch (method) {
  case 4:
    return ("equal");
  case 8:
    return ("weighted");
  default:
    return ("undefined");
  }
}


x86 assembly (clang, -O0):
<Ipolweight2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x4,%eax
je     112c <Ipolweight2str+0x2c>
jmp    111b <Ipolweight2str+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x8,%eax
je     113c <Ipolweight2str+0x3c>
jmp    114c <Ipolweight2str+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <Ipolweight2str+0x57>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <Ipolweight2str+0x57>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ipolweight2str>:
cmp    $0x8,%edi
lea    0xefc(%rip),%rax
lea    0xefe(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x4,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"weighted\00"
@.str.2 = [10 x i8] c"undefined\00"
define i8* @Ipolweight2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 4, label %5
i32 8, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"weighted\00"
@.str.2 = [10 x i8] c"undefined\00"
define i8* @Ipolweight2str(i32 %0) {
%2 = icmp eq i32 %0, 8
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 4
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ STDOUT_FILENO;
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char *argv[]) {
  char c;
  while (read(0, &c, 1) > 0)
    write(STDOUT_FILENO, &c, sizeof(c));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jle    116c <main+0x4c>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1136 <main+0x16>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jle    1174 <main+0x54>
mov    0x2eaf(%rip),%r14
lea    0x7(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jg     1150 <main+0x30>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %10, %2
%8 = call i64 @read(i32 0, i8* %6, i32 1)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* @STDOUT_FILENO
%12 = call i32 @write(i32 %11, i8* %6, i32 1)
br label %7
13: ; preds = %7
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i64 @read(i32 0, i8* %3, i32 1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @write(i32 %7, i8* %3, i32 1)
%9 = call i64 @read(i32 0, i8* %3, i32 1)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %2
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
size_t regerror(int, int /*<<< orphan*/ const *, char *, size_t);
__attribute__((__weak__, __always___)) size_t
softboundmpx_regerror(int errcode, const regex_t *preg, char *errbuf,
                      size_t errbuf_size) {
  return regerror(errcode, preg, errbuf, errbuf_size);
}


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

x86 assembly (clang, -O2):
<softboundmpx_regerror>:
jmp    1030 <regerror@plt>

LLVM IR (-O0):
define weak i64 @softboundmpx_regerror(i32 %0, i32* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i64 @regerror(i32 %9, i32* %10, i8* %11, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define weak i64 @softboundmpx_regerror(i32 %0, i32* %1, i8* %2, i64 %3) {
%5 = tail call i64 @regerror(i32 %0, i32* %1, i8* %2, i64 %3)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x91() {
  Assert_real((isupper(145) == 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_isupper.c",
              730, ("isupper should be 0 for 0x91"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x91>:
push   %rax
mov    $0x91,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2da,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x91\00"
define void @t_isupper_0x91() {
%1 = call i64 @isupper(i32 145)
%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 730, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x91\00"
define void @t_isupper_0x91() {
%1 = tail call i64 @isupper(i32 145)
%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 730, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int common(int, int);
uint64_t __attribute__((no)) fast(uint64_t n, uint64_t seed) {
  uint64_t max = (n / 10) + 1;
  for (uint64_t i = 0; i < max; ++i) {
    seed = common(n, (seed * seed) - (3 * seed) + 1);
  }
  return seed;
}


x86 assembly (clang, -O0):
<fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116b <fast+0x5b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   $0x3,-0x8(%rbp),%eax
sub    %eax,%esi
add    $0x1,%esi
call   1030 <common@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <fast+0x26>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
cmp    $0xfffffff7,%edi
jl     1155 <fast+0x45>
mov    %edi,%ebx
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
sar    $0x22,%rdx
shr    $0x3f,%rcx
lea    (%rdx,%rcx,1),%ebp
add    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rax),%esi
imul   %eax,%esi
add    $0x1,%esi
mov    %ebx,%edi
call   1030 <common@plt>
add    $0xffffffff,%ebp
jne    1140 <fast+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fast(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, -9
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, 10
br label %8
6: ; preds = %8, %2
%7 = phi i32 [ %1, %2 ], [ %14, %8 ]
ret i32 %7
8: ; preds = %4, %8
%9 = phi i32 [ %15, %8 ], [ 0, %4 ]
%10 = phi i32 [ %14, %8 ], [ %1, %4 ]
%11 = add i32 %10, -3
%12 = mul i32 %11, %10
%13 = add nsw i32 %12, 1
%14 = tail call i32 @common(i32 %0, i32 %13)
%15 = add nuw nsw i32 %9, 1
%16 = icmp eq i32 %9, %5
br i1 %16, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_mutex_timedlock;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)pthread_mutex_timedlock;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@pthread_mutex_timedlock = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @pthread_mutex_timedlock
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@pthread_mutex_timedlock = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
void userlock_wait(volatile const int *userlock) {
  while (1 == *userlock) {
    usleep(10);
  }
}


x86 assembly (clang, -O0):
<userlock_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    1140 <userlock_wait+0x30>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <usleep@plt>
jmp    111c <userlock_wait+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userlock_wait>:
push   %rbx
mov    (%rdi),%eax
cmp    $0x1,%eax
jne    1133 <userlock_wait+0x23>
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <usleep@plt>
mov    (%rbx),%eax
cmp    $0x1,%eax
je     1120 <userlock_wait+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @userlock_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %7, %1
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
%6 = icmp eq i32 1, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 10)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @userlock_wait(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 10)
%6 = load volatile i32, i32* %0
%7 = icmp eq i32 %6, 1
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
void memleak_init(void) {}


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

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

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

LLVM IR (-O2):
define void @memleak_init() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t prv_lte_int32_fn(int32_t a, int32_t b) { return a <= b ? -1 : 0; }


x86 assembly (clang, -O0):
<prv_lte_int32_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovle %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_lte_int32_fn>:
xor    %eax,%eax
cmp    %rsi,%rdi
setle  %al
neg    %rax
ret

LLVM IR (-O0):
define i64 @prv_lte_int32_fn(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sle i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @prv_lte_int32_fn(i64 %0, i64 %1) {
%3 = icmp sle i64 %0, %1
%4 = sext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
scalar_t__ memcmp(unsigned char const *, char *, int);
int search_waste(const unsigned char *payload, const int plen,
                 int payload_len) {
  if (plen >= 8 && payload_len >= 8 && memcmp(payload, "GET.sha1:", 9) == 0)
    return ((15 * 100) + 0);
  return 0;
}


x86 assembly (clang, -O0):
<search_waste>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x8,-0x14(%rbp)
jl     1161 <search_waste+0x51>
cmpl   $0x8,-0x18(%rbp)
jl     1161 <search_waste+0x51>
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x9,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1161 <search_waste+0x51>
movl   $0x5dc,-0x4(%rbp)
jmp    1168 <search_waste+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_waste>:
cmp    $0x8,%esi
jl     1136 <search_waste+0x26>
cmp    $0x8,%edx
jl     1136 <search_waste+0x26>
push   %rax
lea    0xede(%rip),%rsi
mov    $0x9,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     1139 <search_waste+0x29>
xor    %eax,%eax
ret
mov    $0x5dc,%eax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"GET.sha1:\00"
define i32 @search_waste(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp sge i32 %8, 8
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 8
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = call i64 @memcmp(i8* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1500, i32* %4
br label %19
18: ; preds = %13, %10, %3
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [10 x i8] c"GET.sha1:\00"
define i32 @search_waste(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 7
%5 = icmp sgt i32 %2, 7
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%9 = icmp eq i64 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %3
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 0, %10 ], [ 1500, %7 ]
ret i32 %12
}
/* Variables and functions */
int US_LoadMain(int, int);
bool US_QuickLoad(void) { return US_LoadMain(6 - 1, false); }


x86 assembly (clang, -O0):
<US_QuickLoad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <US_LoadMain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<US_QuickLoad>:
mov    $0x5,%edi
xor    %esi,%esi
jmp    1030 <US_LoadMain@plt>

LLVM IR (-O0):
define i32 @US_QuickLoad() {
%1 = call i32 @US_LoadMain(i32 5, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @US_QuickLoad() {
%1 = tail call i32 @US_LoadMain(i32 5, i32 0)
ret i32 %1
}