xunge/DecIR huggingface dataset:
/* Type definitions */
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int poll(struct pollfd fds[], nfds_t nfds, int timeout) {
  (void)fds;
  (void)nfds;
  (void)timeout;
  puts("poll: not implemented");
  return -1;
}


x86 assembly (clang, -O0):
<poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
@.str = [22 x i8] c"poll: not implemented\00"
define i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd*
%5 = alloca i32
%6 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.pollfd*, %struct.pollfd** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
@.str = [22 x i8] c"poll: not implemented\00"
define i32 @poll(%struct.pollfd* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void scdrain(int fd) { tcflush(fd, TCIFLUSH); }


x86 assembly (clang, -O0):
<scdrain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scdrain>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIFLUSH = global i32 0
define void @scdrain(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIFLUSH = global i32 0
define void @scdrain(i32 %0) {
%2 = load i32, i32* @TCIFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
void cmd_start_color(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(start_color());
}


x86 assembly (clang, -O0):
<cmd_start_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_start_color+0x27>
jmp    117f <cmd_start_color+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1040 <start_color@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_start_color>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_start_color+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1040 <start_color@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_start_color(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @start_color()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_start_color(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @start_color()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
double pow(double, double);
double weibullhrf(double x, double alpha, double beta, double x0) {
  double y;
  y = beta / alpha * pow((x - x0) / alpha, beta - 1);
  return y;
}


x86 assembly (clang, -O0):
<weibullhrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xea9(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weibullhrf>:
push   %rax
movapd %xmm2,%xmm4
divsd  %xmm1,%xmm4
movsd  %xmm4,(%rsp)
subsd  %xmm3,%xmm0
divsd  %xmm1,%xmm0
addsd  0xed2(%rip),%xmm2
movapd %xmm2,%xmm1
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @weibullhrf(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %7
%11 = load double, double* %6
%12 = fdiv double %10, %11
%13 = load double, double* %5
%14 = load double, double* %8
%15 = fsub double %13, %14
%16 = load double, double* %6
%17 = fdiv double %15, %16
%18 = load double, double* %7
%19 = fsub double %18, 1.000000e+00
%20 = call double @pow(double %17, double %19)
%21 = fmul double %12, %20
store double %21, double* %9
%22 = load double, double* %9
ret double %22
}

LLVM IR (-O2):
define double @weibullhrf(double %0, double %1, double %2, double %3) {
%5 = fdiv double %2, %1
%6 = fsub double %0, %3
%7 = fdiv double %6, %1
%8 = fadd double %2, -1.000000e+00
%9 = tail call double @pow(double %7, double %8)
%10 = fmul double %5, %9
ret double %10
}
void sizeof_vla_2(int a) {
  if (a == 5) {
    char x[a];
    int y[sizeof(x) / sizeof(char)];
    y[4] = 4;
    y[5] = 5;
  }
}


x86 assembly (clang, -O0):
<sizeof_vla_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1167 <sizeof_vla_2+0x67>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x20(%rbp)
movl   $0x4,0x10(%rax)
movl   $0x5,0x14(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sizeof_vla_2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = alloca i8, i64 %10
store i64 %10, i64* %4
%13 = udiv i64 %10, 1
%14 = alloca i32, i64 %13
store i64 %13, i64* %5
%15 = getelementptr inbounds i32, i32* %14, i64 4
store i32 4, i32* %15
%16 = getelementptr inbounds i32, i32* %14, i64 5
store i32 5, i32* %16
%17 = load i8*, i8** %3
br label %18
18: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @sizeof_vla_2(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LDX_();
int /*<<< orphan*/ c64_memZeroY();
void LDX_zpy(void) {
  c64_memZeroY();
  LDX_();
}


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

x86 assembly (clang, -O2):
<LDX_zpy>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memZeroY@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <LDX_@plt>

LLVM IR (-O0):
define void @LDX_zpy() {
%1 = call i32 (...) @c64_memZeroY()
%2 = call i32 (...) @LDX_()
ret void
}

LLVM IR (-O2):
define void @LDX_zpy() {
%1 = tail call i32 (...) @c64_memZeroY()
%2 = tail call i32 (...) @LDX_()
ret void
}
double fisSum(double x, double y) { return (x + y); }


x86 assembly (clang, -O0):
<fisSum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisSum>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fisSum(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_x11_get_prop() {
  printf("NOT IMPLEMENTED:"
         "pa_x11_get_prop"
         "\n");
}


x86 assembly (clang, -O0):
<pa_x11_get_prop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_x11_get_prop\0A\00"
define i32 @pa_x11_get_prop() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_x11_get_prop\00"
define i32 @pa_x11_get_prop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
double coq_fmul(double x, double y) { return x * y; }


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

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

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

LLVM IR (-O2):
define double @coq_fmul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
const char *POPT_prev_char(const char *str) {
  const char *p = str;
  while (1) {
    p--;
    if (((unsigned)*p & 0xc0) != (unsigned)0x80)
      return p;
  }
}


x86 assembly (clang, -O0):
<POPT_prev_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1139 <POPT_prev_char+0x39>
mov    -0x10(%rbp),%rax
pop    %rbp
ret
jmp    1110 <POPT_prev_char+0x10>

x86 assembly (clang, -O2):
<POPT_prev_char>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rax),%ecx
add    $0xffffffffffffffff,%rax
and    $0xc0,%cl
cmp    $0x80,%cl
je     1110 <POPT_prev_char+0x10>
ret

LLVM IR (-O0):
define i8* @POPT_prev_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %1, %15
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 -1
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 192
%12 = icmp ne i32 %11, 128
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = load i8*, i8** %3
ret i8* %14
15: ; preds = %5
br label %5
}

LLVM IR (-O2):
define i8* @POPT_prev_char(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = and i8 %5, -64
%7 = icmp eq i8 %6, -128
br i1 %7, label %2, label %8
8: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
unsigned long O_NONBLOCK;
unsigned long fcntl(int, int /*<<< orphan*/, ...);
int g_tcp_set_non_blocking(int sck) {
  unsigned long i;
  i = fcntl(sck, F_GETFL);
  i = i | O_NONBLOCK;
  fcntl(sck, F_SETFL, i);
  return 0;
}


x86 assembly (clang, -O0):
<g_tcp_set_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eab(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <fcntl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_tcp_set_non_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%rax
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fcntl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define i32 @g_tcp_set_non_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i64 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* @O_NONBLOCK
%9 = or i64 %7, %8
store i64 %9, i64* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i64, i64* %3
%13 = call i64 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i64 %12)
ret i32 0
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define i32 @g_tcp_set_non_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i64 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i64, i64* @O_NONBLOCK
%5 = or i64 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i64 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i64 %5)
ret i32 0
}
void gtk_tree_view_get_hover_selection() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_hover_selection() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t _MULx(uint8_t V, uint8_t c) {
  if (V & 0x80)
    return ((V << 1) ^ c);
  else
    return (V << 1);
}


x86 assembly (clang, -O0):
<_MULx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112c <_MULx+0x2c>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <_MULx+0x35>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MULx>:
movsbl %dil,%eax
sar    $0x7,%eax
lea    (%rdi,%rdi,1),%ecx
and    %esi,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_MULx(i32 %0, i32 %1) {
%3 = and i32 %0, 128
%4 = icmp eq i32 %3, 0
%5 = shl i32 %0, 1
%6 = select i1 %4, i32 0, i32 %1
%7 = xor i32 %6, %5
ret i32 %7
}
/* Variables and functions */
char *get_time_str(char *);
int /*<<< orphan*/ printf(char *, char *);
void cmd_time(int argc, char *argv[]) {
  printf("%s\n", get_time_str("%a %b %d %H:%M:%S %Z %Y"));
}


x86 assembly (clang, -O0):
<cmd_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xece(%rip),%rdi
call   1040 <get_time_str@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_time>:
push   %rax
lea    0xedc(%rip),%rdi
call   1040 <get_time_str@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [24 x i8] c"%a %b %d %H:%M:%S %Z %Y\00"
define void @cmd_time(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* @get_time_str(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [24 x i8] c"%a %b %d %H:%M:%S %Z %Y\00"
define void @cmd_time(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @get_time_str(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
long countTrailingZeroes(long num) {
  long zeroes = 0;
  long divisor = 5;
  while (divisor <= num) {
    zeroes += num / divisor;
    divisor *= 5;
  }
  return zeroes;
}


x86 assembly (clang, -O0):
<countTrailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x5,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1146 <countTrailingZeroes+0x46>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x18(%rbp)
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0x5,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <countTrailingZeroes+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countTrailingZeroes>:
xor    %ecx,%ecx
cmp    $0x5,%rdi
jge    110c <countTrailingZeroes+0xc>
mov    %rcx,%rax
ret
mov    $0x5,%esi
jmp    1134 <countTrailingZeroes+0x34>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdi,%rax
cqto
idiv   %rsi
add    %rax,%rcx
lea    (%rsi,%rsi,4),%rsi
cmp    %rdi,%rsi
jg     1108 <countTrailingZeroes+0x8>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <countTrailingZeroes+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1128 <countTrailingZeroes+0x28>

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

LLVM IR (-O2):
define i64 @countTrailingZeroes(i64 %0) {
%2 = icmp slt i64 %0, 5
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 5, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i64 %0, %4
%7 = add nsw i64 %6, %5
%8 = mul nsw i64 %4, 5
%9 = icmp sgt i64 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x9e() {
  Assert_real((isprint(158) == 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_isprint.c",
              795, ("isprint should be 0 for 0x9e"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x9e>:
push   %rax
mov    $0x9e,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x31b,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x9e\00"
define void @t_isprint_0x9e() {
%1 = call i64 @isprint(i32 158)
%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 795, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x9e\00"
define void @t_isprint_0x9e() {
%1 = tail call i64 @isprint(i32 158)
%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 795, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rl_maybe_replace_line();
int maybe_replace_line() { return rl_maybe_replace_line(); }


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

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

LLVM IR (-O0):
define i32 @maybe_replace_line() {
%1 = call i32 (...) @rl_maybe_replace_line()
ret i32 %1
}

LLVM IR (-O2):
define i32 @maybe_replace_line() {
%1 = tail call i32 (...) @rl_maybe_replace_line()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ lequal(long, long);
int lnequal(long a, long b) { return !(lequal(a, b)); }


x86 assembly (clang, -O0):
<lnequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lequal@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnequal>:
push   %rax
call   1030 <lequal@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lnequal(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 = call i32 @lequal(i64 %5, i64 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @lnequal(i64 %0, i64 %1) {
%3 = tail call i32 @lequal(i64 %0, i64 %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct tm *localtime(scalar_t__ *);
scalar_t__ mktime(struct tm *);
void mktime_test1(time_t now) {
  struct tm *lt = localtime(&now);
  if (lt && mktime(lt) != now)
    exit(2);
}


x86 assembly (clang, -O0):
<mktime_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1171 <mktime_test1+0x41>
mov    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
cmp    -0x8(%rbp),%rax
je     1171 <mktime_test1+0x41>
mov    $0x2,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktime_test1>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <localtime@plt>
test   %rax,%rax
je     1150 <mktime_test1+0x20>
mov    %rax,%rdi
call   1040 <mktime@plt>
cmp    (%rsp),%rax
jne    1152 <mktime_test1+0x22>
pop    %rax
ret
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @mktime_test1(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.tm*
store i64 %0, i64* %2
%4 = call %struct.tm* @localtime(i64* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = icmp ne %struct.tm* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i64 @mktime(%struct.tm* %8)
%10 = load i64, i64* %2
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @exit(i32 2)
unreachable
14: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @mktime_test1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call %struct.tm* @localtime(i64* %2)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = call i64 @mktime(%struct.tm* %3)
%7 = load i64, i64* %2
%8 = icmp eq i64 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @exit(i32 2)
unreachable
11: ; preds = %5, %1
ret void
}
int is_tabular_alphanumeric(char *buf) {
  int result = 0;
  if (((unsigned char)*(buf + 2) * 0x100 + (unsigned char)*((buf + 2) + 1)) ==
      3)
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<is_tabular_alphanumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
cmp    $0x3,%eax
jne    1134 <is_tabular_alphanumeric+0x34>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_tabular_alphanumeric>:
movzwl 0x2(%rdi),%ecx
shl    $0x10,%ecx
bswap  %ecx
xor    %eax,%eax
cmp    $0x3,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_tabular_alphanumeric(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *, char *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ setgid(int);
int /*<<< orphan*/ setgroups(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int);
int main() {
  setgroups(0);
  setgid(1000);
  setuid(1000);
  execl("/usr/bin/timeout", "/usr/bin/timeout", "-s", "SIGKILL", "3", "./code",
        NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <setgroups@plt>
mov    $0x3e8,%edi
call   1040 <setgid@plt>
mov    $0x3e8,%edi
call   1050 <setuid@plt>
lea    0xe96(%rip),%rsi
lea    0xea0(%rip),%rdx
lea    0xe9c(%rip),%rcx
lea    0xe9d(%rip),%r8
lea    0xe98(%rip),%r9
xor    %eax,%eax
mov    %rsi,%rdi
movq   $0x0,(%rsp)
call   1060 <execl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <setgroups@plt>
mov    $0x3e8,%edi
call   1040 <setgid@plt>
mov    $0x3e8,%edi
call   1050 <setuid@plt>
movq   $0x0,(%rsp)
lea    0xe95(%rip),%rdi
lea    0xe9f(%rip),%rdx
lea    0xe9b(%rip),%rcx
lea    0xe9c(%rip),%r8
lea    0xe97(%rip),%r9
mov    %rdi,%rsi
call   1060 <execl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/usr/bin/timeout\00"
@.str.1 = [3 x i8] c"-s\00"
@.str.2 = [8 x i8] c"SIGKILL\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [7 x i8] c"./code\00"
define i32 @main() {
%1 = call i32 @setgroups(i32 0)
%2 = call i32 @setgid(i32 1000)
%3 = call i32 @setuid(i32 1000)
%4 = call i32 @execl(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"/usr/bin/timeout\00"
@.str.1 = [3 x i8] c"-s\00"
@.str.2 = [8 x i8] c"SIGKILL\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [7 x i8] c"./code\00"
define i32 @main() {
%1 = tail call i32 @setgroups(i32 0)
%2 = tail call i32 @setgid(i32 1000)
%3 = tail call i32 @setuid(i32 1000)
%4 = tail call i32 @execl(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* null)
ret i32 0
}
unsigned short SIO1_readCtrl16(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i16 @SIO1_readCtrl16() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @SIO1_readCtrl16() {
ret i16 0
}
double Sleef_round(double x) { return __builtin_round(x); }


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

x86 assembly (clang, -O2):
<Sleef_round>:
jmp    1030 <round@plt>

LLVM IR (-O0):
define double @Sleef_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.round.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @Sleef_round(double %0) {
%2 = tail call double @llvm.round.f64(double %0)
ret double %2
}
char *test_heap_property() { return 0; }


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

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

LLVM IR (-O0):
define i8* @test_heap_property() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test_heap_property() {
ret i8* null
}
/* Variables and functions */
bool is_collatz(int candidate) {
  if (candidate == 1) {
    return true;
  } else if (candidate % 2 == 0) {
    candidate = candidate / 2;
  } else {
    candidate = 3 * candidate + 1;
  }
  return is_collatz(candidate);
}


x86 assembly (clang, -O0):
<is_collatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <is_collatz+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1172 <is_collatz+0x62>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1158 <is_collatz+0x48>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1162 <is_collatz+0x52>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <is_collatz+0x57>
mov    -0x8(%rbp),%edi
call   1030 <is_collatz@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_collatz>:
cmp    $0x1,%edi
jne    111b <is_collatz+0x1b>
jmp    1131 <is_collatz+0x31>
nopw   0x0(%rax,%rax,1)
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
cmp    $0x1,%edi
je     1131 <is_collatz+0x31>
test   $0x1,%dil
jne    1110 <is_collatz+0x10>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
mov    %eax,%edi
cmp    $0x1,%edi
jne    111b <is_collatz+0x1b>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_collatz(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1, %12
%4 = phi i32 [ %13, %12 ], [ %0, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = sdiv i32 %4, 2
br label %12
9: ; preds = %3
%10 = mul nsw i32 %4, 3
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %7, %9
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %3
15: ; preds = %12, %1
ret i32 1
}
void BrzConstant_ackdown(struct comp *comp, int port) {}


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

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

LLVM IR (-O0):
%struct.comp = type opaque
define void @BrzConstant_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.comp = type opaque
define void @BrzConstant_ackdown(%struct.comp* nocapture %0, i32 %1) {
ret void
}
int test_stack() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_stack() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ __sighandler_t;

/* Variables and functions */
int /*<<< orphan*/ SA_RESTART;
int /*<<< orphan*/ __signal(int, int /*<<< orphan*/, int /*<<< orphan*/);
__sighandler_t bsd_signal(int signum, __sighandler_t handler) {
  return __signal(signum, handler, SA_RESTART);
}


x86 assembly (clang, -O0):
<bsd_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1030 <__signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsd_signal>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__signal@plt>

LLVM IR (-O0):
@SA_RESTART = global i32 0
define i32 @bsd_signal(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 = load i32, i32* @SA_RESTART
%8 = call i32 @__signal(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SA_RESTART = global i32 0
define i32 @bsd_signal(i32 %0, i32 %1) {
%3 = load i32, i32* @SA_RESTART
%4 = tail call i32 @__signal(i32 %0, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do1();
int /*<<< orphan*/ do2();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  do1();
  do2();
  exit(0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @do1()
%3 = call i32 (...) @do2()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do1()
%2 = tail call i32 (...) @do2()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int fn1(int p1) { return 1 >> p1; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %edi,%ecx
mov    $0x1,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = lshr i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x7b() {
  Assert_real((islower(123) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              620, ("islower should be 0 for {"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x7b>:
push   %rax
mov    $0x7b,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x26c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for {\00"
define void @t_islower_0x7b() {
%1 = call i64 @islower(i32 123)
%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 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for {\00"
define void @t_islower_0x7b() {
%1 = tail call i64 @islower(i32 123)
%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 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEldc_string(char *, int /*<<< orphan*/ *);
void code_ldc_string(char *arg) { appendCODE(makeCODEldc_string(arg, NULL)); }


x86 assembly (clang, -O0):
<code_ldc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <makeCODEldc_string@plt>
mov    %eax,%edi
call   1040 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_ldc_string>:
push   %rax
xor    %esi,%esi
call   1030 <makeCODEldc_string@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <appendCODE@plt>

LLVM IR (-O0):
define void @code_ldc_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @makeCODEldc_string(i8* %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_ldc_string(i8* %0) {
%2 = tail call i32 @makeCODEldc_string(i8* %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x5c() {
  Assert_real((isalpha(92) == 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_isalpha.c",
              465, ("isalpha should be 0 for 0x5c"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x5c>:
push   %rax
mov    $0x5c,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1d1,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x5c\00"
define void @t_isalpha_0x5c() {
%1 = call i64 @isalpha(i32 92)
%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 465, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x5c\00"
define void @t_isalpha_0x5c() {
%1 = tail call i64 @isalpha(i32 92)
%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 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void update(int bit_tree[], int n, int index, int val) {
  index = index + 1;
  while (index <= n) {
    bit_tree[index] += val;
    index += index & (-index);
  }
  return;
}


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     114c <update+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
and    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111a <update+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
cmp    %esi,%edx
jge    1122 <update+0x22>
add    $0x1,%edx
nopw   0x0(%rax,%rax,1)
movslq %edx,%rax
add    %ecx,(%rdi,%rax,4)
mov    %eax,%edx
neg    %edx
and    %eax,%edx
add    %eax,%edx
cmp    %esi,%edx
jle    1110 <update+0x10>
ret

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

LLVM IR (-O2):
define void @update(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %1
br i1 %5, label %6, label %18
6: ; preds = %4
%7 = add nsw i32 %2, 1
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %16, %8 ], [ %7, %6 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %3
store i32 %13, i32* %11
%14 = sub nsw i32 0, %9
%15 = and i32 %9, %14
%16 = add nsw i32 %15, %9
%17 = icmp sgt i32 %16, %1
br i1 %17, label %18, label %8
18: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_56(void) {
  { a_0_55(((((2)))), "BEGIN?"); }
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"BEGIN?\00"
define void @a_0_56() {
%1 = call i32 @a_0_55(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"BEGIN?\00"
define void @a_0_56() {
%1 = tail call i32 @a_0_55(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
double VR() {
  int PZ = 0x7fff;
  return (double)(rand() & PZ) / (double)PZ;
}


x86 assembly (clang, -O0):
<VR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7fff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VR>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
divsd  0xed7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @VR() {
%1 = alloca i32
store i32 32767, i32* %1
%2 = call i32 (...) @rand()
%3 = load i32, i32* %1
%4 = and i32 %2, %3
%5 = sitofp i32 %4 to double
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = fdiv double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @VR() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 32767
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 3.276700e+04
ret double %4
}
int main() {
  int x;
  int y;
  x = 3;
  y = x--;
  return y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}