xunge/DecIR huggingface dataset:
/* Variables and functions */
int strnlen(const char *str, unsigned int max_len) {
  unsigned int i = 0;
  while (str[i] && (i < max_len)) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strnlen+0x37>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setb   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strnlen+0x47>
jmp    1155 <strnlen+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <strnlen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %esi,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rdx),%rax
cmpb   $0x0,(%rdi,%rdx,1)
je     1122 <strnlen+0x22>
cmp    %rcx,%rdx
mov    %rax,%rdx
jb     1110 <strnlen+0x10>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @strnlen(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp ult i64 %5, %3
%10 = select i1 %8, i1 %9, i1 false
%11 = add nuw nsw i64 %5, 1
br i1 %10, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %5 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _info_print_format(char *, char const *);
void _info_print(const char *message) { _info_print_format("%s", message); }


x86 assembly (clang, -O0):
<_info_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <_info_print_format@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_info_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <_info_print_format@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @_info_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_info_print_format(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @_info_print(i8* %0) {
%2 = tail call i32 @_info_print_format(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void fix_dir(char *str) {
  (void)str;
  return;
}


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

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

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

LLVM IR (-O2):
define void @fix_dir(i8* nocapture %0) {
ret void
}
int test_imm_09uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x09 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_09uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_09uint64_lowword_reg>:
test   $0x9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_09uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 9
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_09uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 9
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t sancus_u8ll(long long v) {
  assert((v >= 0) && (v <= 0xff));
  return (uint8_t)v;
}


x86 assembly (clang, -O0):
<sancus_u8ll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     113a <sancus_u8ll+0x2a>
cmpq   $0xff,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u8ll>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x100,%rbx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u8ll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 255
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %2
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @sancus_u8ll(i64 %0) {
%2 = icmp ult i64 %0, 256
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i64 %0 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("Here we will tell about commands and "
       "statistics (like available memory and frequency\n");
}


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

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

LLVM IR (-O0):
@.str = [86 x i8] c"Here we will tell about commands and statistics (like available memory and frequency\0A\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"Here we will tell about commands and statistics (like available memory and frequency\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
ret void
}
double Abs(double r) {
  if (r < 0.0) {
    return -r;
  } else {
    return r;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<Abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <Abs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <Abs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Abs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @Abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
char *__get_option_string(char *token) {
  char *new_token;
  new_token = (char *)calloc(strlen(token) + 3, 1);
  sprintf(new_token, "--%s", token);
  return new_token;
}


x86 assembly (clang, -O0):
<__get_option_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x3,%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_option_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x3(%rax),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xeac(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"--%s\00"
define i8* @__get_option_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 3
%7 = call i64 @calloc(i64 %6, i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"--%s\00"
define i8* @__get_option_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 3
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ eraseDisplay();
void scheibenwischer() { eraseDisplay(); }


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

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

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

LLVM IR (-O2):
define void @scheibenwischer() {
%1 = tail call i32 (...) @eraseDisplay()
ret void
}
/* Variables and functions */
int ioCanOpenFileOfSizeWritable(char *, int, int);
int ioCanOpenAsyncFileOfSizeWritable(char *pathString, int pathStringLength,
                                     int writeFlag) {
  return ioCanOpenFileOfSizeWritable(pathString, pathStringLength, writeFlag);
}


x86 assembly (clang, -O0):
<ioCanOpenAsyncFileOfSizeWritable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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
call   1030 <ioCanOpenFileOfSizeWritable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioCanOpenAsyncFileOfSizeWritable>:
jmp    1030 <ioCanOpenFileOfSizeWritable@plt>

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

LLVM IR (-O2):
define i32 @ioCanOpenAsyncFileOfSizeWritable(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @ioCanOpenFileOfSizeWritable(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
double linterpolate(double y_a, double y_b, double x_a, double x, double x_b) {
  double y = 0;
  y = (y_a + ((y_b - y_a) * (x - x_a) / (x_b - x_a)));
  return y;
}


x86 assembly (clang, -O0):
<linterpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linterpolate>:
subsd  %xmm0,%xmm1
subsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm2,%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @linterpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = load double, double* %9
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = fmul double %15, %18
%20 = load double, double* %10
%21 = load double, double* %8
%22 = fsub double %20, %21
%23 = fdiv double %19, %22
%24 = fadd double %12, %23
store double %24, double* %11
%25 = load double, double* %11
ret double %25
}

LLVM IR (-O2):
define double @linterpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %1, %0
%7 = fsub double %3, %2
%8 = fmul double %6, %7
%9 = fsub double %4, %2
%10 = fdiv double %8, %9
%11 = fadd double %10, %0
ret double %11
}
char *memccpy(s1, s2, c, n)
register char *s1, *s2;
register int c, n;
{
  while (--n >= 0)
    if ((*s1++ = *s2++) == c)
      return (s1);
  return (0);
}


x86 assembly (clang, -O0):
<memccpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jl     1164 <memccpy+0x64>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    -0x1c(%rbp),%eax
jne    115f <memccpy+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <memccpy+0x6c>
jmp    1112 <memccpy+0x12>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memccpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %ecx,%ecx
jle    112a <memccpy+0x2a>
add    $0xffffffff,%ecx
movsbl (%rsi),%edi
add    $0x1,%rsi
mov    %dil,(%rax)
add    $0x1,%rax
cmp    %edx,%edi
jne    1110 <memccpy+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memccpy(i8* writeonly %0, i8* nocapture %1, i32 %2, i32 %3) {
br label %5
5: ; preds = %10, %4
%6 = phi i8* [ %0, %4 ], [ %14, %10 ]
%7 = phi i8* [ %1, %4 ], [ %12, %10 ]
%8 = phi i32 [ %3, %4 ], [ %11, %10 ]
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = add nsw i32 %8, -1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %7
%14 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %13, i8* %6
%15 = sext i8 %13 to i32
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %5
17: ; preds = %5, %10
%18 = phi i8* [ %14, %10 ], [ null, %5 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int y = 42;
  int change_y = 0;
  int save_y;
  scanf("%d", &change_y);
  if (change_y) {
    save_y = y;
    y = 10;
  }
  change_y++;
  printf("Doing some other work");
  change_y--;
  if (!change_y)
    y = save_y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1164 <main+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1192 <main+0x72>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
addl   $0x1,0x4(%rsp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Doing some other work\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %4
store i32 10, i32* %2
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %10
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Doing some other work\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test6() {
  int x;
  x += 2;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @test6() {
ret i32 undef
}
void test___atomic_xor_fetch_0(char *mem) { __atomic_xor_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_xor_fetch_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test___atomic_xor_fetch_0+0x4a>
jmp    111f <test___atomic_xor_fetch_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
xor    %cl,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_xor_fetch_0>:
lock xorb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_xor_fetch_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw xor i8* %5, i8 %6 acq_rel
%8 = xor i8 %7, %6
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_xor_fetch_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 1 acq_rel
ret void
}
int fun1287() { return 1287; }


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

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

LLVM IR (-O0):
define i32 @fun1287() {
ret i32 1287
}

LLVM IR (-O2):
define i32 @fun1287() {
ret i32 1287
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int arg5(int a1, int a2, int a3, int a4, int a5) {
  printf("%d\n", a1 + a2 + a3 + a4 + a5);
  return a5;
}


x86 assembly (clang, -O0):
<arg5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
add    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg5>:
push   %rbx
mov    %r8d,%ebx
add    %edi,%esi
add    %edx,%esi
add    %ecx,%esi
add    %r8d,%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = add nsw i32 %17, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %10
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg5(i32 %0, i32 %1, i32 %2, i32 %3, i32 returned %4) {
%6 = add nsw i32 %1, %0
%7 = add nsw i32 %6, %2
%8 = add nsw i32 %7, %3
%9 = add nsw i32 %8, %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *dll_fgets(char *, int, int /*<<< orphan*/ *);
char *__wrap_fgets(char *s, int size, FILE *stream) {
  return dll_fgets(s, size, stream);
}


x86 assembly (clang, -O0):
<__wrap_fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <dll_fgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_fgets>:
jmp    1030 <dll_fgets@plt>

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

LLVM IR (-O2):
define i8* @__wrap_fgets(i8* %0, i32 %1, i32* %2) {
%4 = tail call i8* @dll_fgets(i8* %0, i32 %1, i32* %2)
ret i8* %4
}
void mumps_ooc_is_async_avail(int *flag) { *flag = 1; }


x86 assembly (clang, -O0):
<mumps_ooc_is_async_avail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mumps_ooc_is_async_avail>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @mumps_ooc_is_async_avail(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
void decode(unsigned char *string, unsigned short string_len, int format) {
  if (format == 0x2) {
    xor(string, string_len);
  }
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    113f <decode+0x2f>
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%esi
mov    $0x0,%al
call   1030 <xor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
cmp    $0x2,%edx
jne    111f <decode+0xf>
movzwl %si,%esi
xor    %eax,%eax
jmp    1030 <xor@plt>
ret

LLVM IR (-O0):
define void @decode(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i16, i16* %5
%12 = zext i16 %11 to i32
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @xor to i32 (i8*, i32, ...)*)(i8* %10, i32 %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @decode(i8* %0, i16 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 2
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = zext i16 %1 to i32
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @xor to i32 (i8*, i32, ...)*)(i8* %0, i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int __cxa_atexit(void (*)(void *), int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int atexit(void (*func)(void)) {
  return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
}


x86 assembly (clang, -O0):
<atexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <__cxa_atexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atexit>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__cxa_atexit@plt>

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

LLVM IR (-O2):
define i32 @atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (i8*)*
%3 = tail call i32 @__cxa_atexit(void (i8*)* %2, i32* null, i32* null)
ret i32 %3
}
void d1() {
  do {
  } while (1);
}


x86 assembly (clang, -O0):
<d1>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <d1+0x9>
jmp    110e <d1+0xe>
mov    $0x1,%al
test   $0x1,%al
jne    1109 <d1+0x9>
jmp    111d <d1+0x1d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @d1() {
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
br i1 true, label %1, label %3
3: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @d1() {
br label %1
1: ; preds = %1, %0
br label %1
}
void bit(char last4, char args[]) {}


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bit(i8 signext %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintWelcome(void) {
  printf("\nmakefsfile - Generate a file containing a file system image.\n");
  printf("Copyright (c) 2008-2013 Texas Instruments Incorporated.  All rights "
         "reserved.\n\n");
}


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

x86 assembly (clang, -O2):
<PrintWelcome>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"\0Amakefsfile - Generate a file containing a file system image.\0A\00"
@.str.1 = [80 x i8] c"Copyright (c) 2008-2013 Texas Instruments Incorporated. All rights reserved.\0A\0A\00"
define void @PrintWelcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"\0Amakefsfile - Generate a file containing a file system image.\00"
@str.2 = [79 x i8] c"Copyright (c) 2008-2013 Texas Instruments Incorporated. All rights reserved.\0A\00"
define void @PrintWelcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.2, i64 0, i64 0))
ret void
}
int strcoll(const char *str1, const char *str2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *__memalign(size_t, size_t);
void *__pvalloc(size_t bytes) {
  size_t pagesize = (0x1000);
  return __memalign(pagesize, (bytes + pagesize - 1) & ~(pagesize - 1));
}


x86 assembly (clang, -O0):
<__pvalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1000,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rsi
call   1030 <__memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pvalloc>:
lea    0xfff(%rdi),%rsi
and    $0xfffffffffffff000,%rsi
mov    $0x1000,%edi
jmp    1030 <__memalign@plt>

LLVM IR (-O0):
define i8* @__pvalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 4096, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %3
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
%13 = call i8* @__memalign(i64 %4, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @__pvalloc(i64 %0) {
%2 = add i64 %0, 4095
%3 = and i64 %2, -4096
%4 = tail call i8* @__memalign(i64 4096, i64 %3)
ret i8* %4
}
int fftw_square(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<fftw_square>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fftw_square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void g_option_context_set_main_group() {}


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

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

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

LLVM IR (-O2):
define void @g_option_context_set_main_group() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xed() {
  Assert_real((isspace(237) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1190, ("isspace should be 0 for 0xed"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xed\00"
define void @t_isspace_0xed() {
%1 = tail call i64 @isspace(i32 237)
%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 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int write_cr4_checking(unsigned long val) {
  asm volatile("movl $0, %%gs:4 \n\t"
               ".pushsection .data.ex \n\t"
               ".quad 1111f, "
               "1f"
               "\n\t"
               ".popsection \n\t"
               "1111:"
               "mov %0,%%cr4\n\t"
               "1:"
               :
               : "r"(val));
  return exception_vector();
}


x86 assembly (clang, -O0):
<write_cr4_checking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,%gs:0x4
mov    %rax,%cr4
mov    $0x0,%al
call   1030 <exception_vector@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_cr4_checking>:
movl   $0x0,%gs:0x4
mov    %rdi,%cr4
xor    %eax,%eax
jmp    1030 <exception_vector@plt>

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

LLVM IR (-O2):
define i32 @write_cr4_checking(i64 %0) {
tail call void asm sideeffect "movl $$0, %gs:4 \0A\09.pushsection .data.ex \0A\09.quad 1111f, 1f\0A\09.popsection \0A\091111:mov $0,%cr4\0A\091:", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%2 = tail call i32 (...) @exception_vector()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int parse_bypass_mode(char *param) {
  int bypass_mode = -1;
  if (!strcmp(param, "on"))
    bypass_mode = 1;
  else if (!strcmp(param, "off"))
    bypass_mode = 0;
  return bypass_mode;
}


x86 assembly (clang, -O0):
<parse_bypass_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1148 <parse_bypass_mode+0x38>
movl   $0x1,-0xc(%rbp)
jmp    116d <parse_bypass_mode+0x5d>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1168 <parse_bypass_mode+0x58>
movl   $0x0,-0xc(%rbp)
jmp    116d <parse_bypass_mode+0x5d>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_bypass_mode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1139 <parse_bypass_mode+0x29>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %eax
sbb    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i32 @parse_bypass_mode(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int ya_random();
int rand_2(void) {
  static int i = 0;
  static int r = 0;
  if (i != 0) {
    i--;
  } else {
    i = 15;
    r = ya_random();
  }
  {
    register int j = (r & 3);
    r = r >> 2;
    return j;
  }
}


x86 assembly (clang, -O0):
<rand_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
je     1139 <rand_2+0x29>
mov    0x2f01(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2ef8(%rip)
jmp    1150 <rand_2+0x40>
movl   $0xf,0x2ee9(%rip)
mov    $0x0,%al
call   1030 <ya_random@plt>
mov    %eax,0x2ee0(%rip)
mov    0x2eda(%rip),%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    0x2ece(%rip),%eax
sar    $0x2,%eax
mov    %eax,0x2ec5(%rip)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_2>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     112c <rand_2+0x1c>
add    $0xffffffff,%eax
mov    %eax,0x2f08(%rip)
mov    0x2f06(%rip),%eax
jmp    113d <rand_2+0x2d>
movl   $0xf,0x2ef6(%rip)
xor    %eax,%eax
call   1030 <ya_random@plt>
mov    %eax,%ecx
and    $0x3,%ecx
sar    $0x2,%eax
mov    %eax,0x2ee5(%rip)
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@rand_2.i = internal global i32 0
@rand_2.r = internal global i32 0
define i32 @rand_2() {
%1 = alloca i32
%2 = load i32, i32* @rand_2.i
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @rand_2.i
%6 = add nsw i32 %5, -1
store i32 %6, i32* @rand_2.i
br label %9
7: ; preds = %0
store i32 15, i32* @rand_2.i
%8 = call i32 (...) @ya_random()
store i32 %8, i32* @rand_2.r
br label %9
9: ; preds = %7, %4
%10 = load i32, i32* @rand_2.r
%11 = and i32 %10, 3
store i32 %11, i32* %1
%12 = load i32, i32* @rand_2.r
%13 = ashr i32 %12, 2
store i32 %13, i32* @rand_2.r
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@rand_2.i = internal unnamed_addr global i32 0
@rand_2.r = internal unnamed_addr global i32 0
define i32 @rand_2() {
%1 = load i32, i32* @rand_2.i
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = add nsw i32 %1, -1
store i32 %4, i32* @rand_2.i
%5 = load i32, i32* @rand_2.r
br label %8
6: ; preds = %0
store i32 15, i32* @rand_2.i
%7 = tail call i32 (...) @ya_random()
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %5, %3 ]
%10 = and i32 %9, 3
%11 = ashr i32 %9, 2
store i32 %11, i32* @rand_2.r
ret i32 %10
}
/* Variables and functions */
int memcmp(char *, char *, int);
int strcmp(char *, char *);
int fofCmp(char *prefix, char *name, int maxSize, int isPrefix) {
  if (isPrefix)
    return memcmp(prefix, name, maxSize);
  else
    return strcmp(prefix, name);
}


x86 assembly (clang, -O0):
<fofCmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1158 <fofCmp+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <fofCmp+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fofCmp>:
test   %ecx,%ecx
je     1129 <fofCmp+0x9>
jmp    1030 <memcmp@plt>
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
define i32 @fofCmp(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memcmp(i8* %13, i8* %14, i32 %15)
store i32 %16, i32* %5
br label %21
17: ; preds = %4
%18 = load i8*, i8** %6
%19 = load i8*, i8** %7
%20 = call i32 @strcmp(i8* %18, i8* %19)
store i32 %20, i32* %5
br label %21
21: ; preds = %17, %12
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @fofCmp(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int unschedule_downtime(int type, unsigned long downtime_id) {}


x86 assembly (clang, -O0):
<unschedule_downtime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unschedule_downtime(i32 %0, i64 %1) {
ret i32 undef
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_completes(struct fsm *, int);
struct fsm *fsm_complete(struct fsm *net) {
  return (fsm_completes(net, 1));
}


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

x86 assembly (clang, -O2):
<fsm_complete>:
mov    $0x1,%esi
jmp    1030 <fsm_completes@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_complete(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%3 = load %struct.fsm*, %struct.fsm** %2
%4 = call %struct.fsm* @fsm_completes(%struct.fsm* %3, i32 1)
ret %struct.fsm* %4
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_complete(%struct.fsm* %0) {
%2 = tail call %struct.fsm* @fsm_completes(%struct.fsm* %0, i32 1)
ret %struct.fsm* %2
}
/* Variables and functions */
int foo();
int __attribute__((no)) bar(void) {
  int c = 1;
  c |= 4294967295 ^ (foo() | 4073709551608);
  return c;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
movslq %eax,%rcx
movabs $0x3b47c02bff8,%rax
or     %rax,%rcx
movabs $0xffffffff,%rax
xor    %rax,%rcx
movslq -0x4(%rbp),%rax
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
or     $0x7c02bff9,%eax
xor    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 (...) @foo()
%3 = sext i32 %2 to i64
%4 = or i64 %3, 4073709551608
%5 = xor i64 4294967295, %4
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = or i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo()
%2 = or i32 %1, 2080555001
%3 = xor i32 %2, -2
ret i32 %3
}
/* Variables and functions */
double exp(double);
double pow(double, int);
double pt_delta(double tempka) {
  double a, b, result;
  tempka -= 273.15;
  b = tempka + 237.3;
  a = (17.27 * tempka) / b;
  result = 2504.0 * exp(a) / pow(b, 2);
  return result;
}


x86 assembly (clang, -O0):
<pt_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec5(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeab(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_delta>:
sub    $0x18,%rsp
addsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  0xeca(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xec1(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @pt_delta(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fsub double %6, 2.731500e+02
store double %7, double* %2
%8 = load double, double* %2
%9 = fadd double %8, 2.373000e+02
store double %9, double* %4
%10 = load double, double* %2
%11 = fmul double 1.727000e+01, %10
%12 = load double, double* %4
%13 = fdiv double %11, %12
store double %13, double* %3
%14 = load double, double* %3
%15 = call double @exp(double %14)
%16 = fmul double 2.504000e+03, %15
%17 = load double, double* %4
%18 = call double @pow(double %17, i32 2)
%19 = fdiv double %16, %18
store double %19, double* %5
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @pt_delta(double %0) {
%2 = fadd double %0, -2.731500e+02
%3 = fadd double %2, 2.373000e+02
%4 = fmul double %2, 1.727000e+01
%5 = fdiv double %4, %3
%6 = tail call double @exp(double %5)
%7 = fmul double %6, 2.504000e+03
%8 = tail call double @pow(double %3, i32 2)
%9 = fdiv double %7, %8
ret double %9
}