xunge/DecIR huggingface dataset:
/* Variables and functions */
int const intLSL(long long);
long long mask_value(int const);
int /*<<< orphan*/ set_carry(int const);
long long topbit_mask();
long long int intRL(long long int x) {
  const int cry = (topbit_mask() & x) ? 1 : 0;
  set_carry(cry);
  return mask_value(intLSL(x) | cry);
}


x86 assembly (clang, -O0):
<intRL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <topbit_mask@plt>
mov    %rax,%rdx
and    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <set_carry@plt>
mov    -0x8(%rbp),%rdi
call   1060 <intLSL@plt>
mov    %eax,%edi
or     -0xc(%rbp),%edi
call   1040 <mask_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intRL>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <topbit_mask@plt>
xor    %ebp,%ebp
test   %rbx,%rax
setne  %bpl
mov    %ebp,%edi
call   1030 <set_carry@plt>
mov    %rbx,%rdi
call   1060 <intLSL@plt>
or     %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mask_value@plt>

LLVM IR (-O0):
define i64 @intRL(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = call i64 (...) @topbit_mask()
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @set_carry(i32 %10)
%12 = load i64, i64* %2
%13 = call i32 @intLSL(i64 %12)
%14 = load i32, i32* %3
%15 = or i32 %13, %14
%16 = call i64 @mask_value(i32 %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @intRL(i64 %0) {
%2 = tail call i64 (...) @topbit_mask()
%3 = and i64 %2, %0
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @set_carry(i32 %5)
%7 = tail call i32 @intLSL(i64 %0)
%8 = or i32 %7, %5
%9 = tail call i64 @mask_value(i32 %8)
ret i64 %9
}
/* Variables and functions */
int CMSG_SPACE(int);
__attribute__((visibility("default"))) int inet6_option_space(int nbytes) {
  nbytes += 2;
  return (CMSG_SPACE((nbytes + 7) & ~7));
}


x86 assembly (clang, -O0):
<inet6_option_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x7,%edi
and    $0xfffffff8,%edi
call   1030 <CMSG_SPACE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_option_space>:
add    $0x9,%edi
and    $0xfffffff8,%edi
jmp    1030 <CMSG_SPACE@plt>

LLVM IR (-O0):
define i32 @inet6_option_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 7
%7 = and i32 %6, -8
%8 = call i32 @CMSG_SPACE(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @inet6_option_space(i32 %0) {
%2 = add nsw i32 %0, 9
%3 = and i32 %2, -8
%4 = tail call i32 @CMSG_SPACE(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void plugtest(char *arg) { printf("Arg was '%s'\n", arg); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Arg was '%s'\0A\00"
define void @plugtest(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_apply(void (*)(), int /*<<< orphan*/, int);
int /*<<< orphan*/ __builtin_apply_args();
int /*<<< orphan*/ __builtin_return(int /*<<< orphan*/);
int /*<<< orphan*/ foo(double);
double bar(double arg) {
  foo(arg);
  __builtin_return(
      __builtin_apply((void (*)())foo, __builtin_apply_args(), 16));
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <foo@plt>
mov    $0x0,%al
call   1040 <__builtin_apply_args@plt>
mov    %eax,%esi
mov    0x2e91(%rip),%rdi
mov    $0x10,%edx
call   1050 <__builtin_apply@plt>
mov    %eax,%edi
call   1030 <__builtin_return@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
call   1060 <foo@plt>
mov    0x2eab(%rip),%rbx
xor    %eax,%eax
call   1040 <__builtin_apply_args@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x10,%edx
call   1050 <__builtin_apply@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <__builtin_return@plt>

LLVM IR (-O0):
define double @bar(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @foo(double %4)
%6 = call i32 (...) @__builtin_apply_args()
%7 = call i32 @__builtin_apply(void (...)* bitcast (i32 (double)* @foo to void (...)*), i32 %6, i32 16)
%8 = call i32 @__builtin_return(i32 %7)
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call i32 @foo(double %0)
%3 = tail call i32 (...) @__builtin_apply_args()
%4 = tail call i32 @__builtin_apply(void (...)* bitcast (i32 (double)* @foo to void (...)*), i32 %3, i32 16)
%5 = tail call i32 @__builtin_return(i32 %4)
ret double undef
}
unsigned mulX(unsigned v) {
  v <<= 1;
  if (v > 0xFF)
    v ^= 0x11D;
  return v;
}


x86 assembly (clang, -O0):
<mulX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jbe    1128 <mulX+0x28>
mov    -0x4(%rbp),%eax
xor    $0x11d,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulX>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x11d,%eax
cmp    $0x100,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mulX(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ugt i32 %5, 255
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = xor i32 %8, 285
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @mulX(i32 %0) {
%2 = shl i32 %0, 1
%3 = icmp ugt i32 %2, 255
%4 = xor i32 %2, 285
%5 = select i1 %3, i32 %4, i32 %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void fun2(const int x) { printf("fun2 : %u\n", x); }


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

x86 assembly (clang, -O2):
<fun2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"fun2 : %u\0A\00"
define void @fun2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void pthread_attr_setdetachstate() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_setdetachstate() {
ret void
}
void free_classes(int **classes, int nbClass) {
  int i;
  for (i = 0; i < nbClass; i++)
    free(classes[i]);
  free(classes);
}


x86 assembly (clang, -O0):
<free_classes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_classes+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_classes+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_classes>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_classes+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_classes+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_classes(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_pixels(int);
int /*<<< orphan*/ verify();
void exec_redraw_all(void) {
  verify();
  process_pixels(0x7fffffff);
}


x86 assembly (clang, -O0):
<exec_redraw_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <verify@plt>
mov    $0x7fffffff,%edi
call   1030 <process_pixels@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_redraw_all>:
push   %rax
xor    %eax,%eax
call   1040 <verify@plt>
mov    $0x7fffffff,%edi
pop    %rax
jmp    1030 <process_pixels@plt>

LLVM IR (-O0):
define void @exec_redraw_all() {
%1 = call i32 (...) @verify()
%2 = call i32 @process_pixels(i32 2147483647)
ret void
}

LLVM IR (-O2):
define void @exec_redraw_all() {
%1 = tail call i32 (...) @verify()
%2 = tail call i32 @process_pixels(i32 2147483647)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void countdown(int signum) {
  static int num = 10;
  printf("%d..", num--);
  fflush(stdout);
  if (num < 0) {
    printf("DONE! \n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<countdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ef7(%rip),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,0x2eec(%rip)
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
cmpl   $0x0,0x2ec9(%rip)
jge    118a <countdown+0x5a>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countdown>:
push   %rax
mov    0x2ef9(%rip),%esi
lea    -0x1(%rsi),%eax
mov    %eax,0x2ef0(%rip)
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
cmpl   $0x0,0x2ecd(%rip)
js     1177 <countdown+0x37>
pop    %rax
ret
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@countdown.num = internal global i32 10
@.str = [5 x i8] c"%d..\00"
@stdout = global i32 0
@.str.1 = [8 x i8] c"DONE! \0A\00"
define void @countdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @countdown.num
%4 = add nsw i32 %3, -1
store i32 %4, i32* @countdown.num
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* @countdown.num
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@countdown.num = internal unnamed_addr global i32 10
@.str = [5 x i8] c"%d..\00"
@stdout = global i32 0
@str = [7 x i8] c"DONE! \00"
define void @countdown(i32 %0) {
%2 = load i32, i32* @countdown.num
%3 = add nsw i32 %2, -1
store i32 %3, i32* @countdown.num
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = load i32, i32* @countdown.num
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mark_back();
void Begin() { mark_back(); }


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

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

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

LLVM IR (-O2):
define void @Begin() {
%1 = tail call i32 (...) @mark_back()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void XXH_free(void *p) { free((p)); }


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

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

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

LLVM IR (-O2):
define void @XXH_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ece_write_uint16_be(uint8_t *bytes, uint16_t value) {
  bytes[0] = (value >> 8) & 0xff;
  bytes[1] = value & 0xff;
}


x86 assembly (clang, -O0):
<ece_write_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece_write_uint16_be>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @ece_write_uint16_be(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @ece_write_uint16_be(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_IFREG;
int /*<<< orphan*/ label_context_clear();
int label_context_set(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ write_string_file_atomic(char const *, char const *);
int write_string_file_atomic_label(const char *fn, const char *line) {
  int r;
  r = label_context_set(fn, S_IFREG);
  if (r < 0)
    return r;
  write_string_file_atomic(fn, line);
  label_context_clear();
  return r;
}


x86 assembly (clang, -O0):
<write_string_file_atomic_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1050 <label_context_set@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116a <write_string_file_atomic_label+0x3a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <write_string_file_atomic_label+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <write_string_file_atomic@plt>
mov    $0x0,%al
call   1030 <label_context_clear@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string_file_atomic_label>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1050 <label_context_set@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1161 <write_string_file_atomic_label+0x31>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <write_string_file_atomic@plt>
xor    %eax,%eax
call   1030 <label_context_clear@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@S_IFREG = global i32 0
define i32 @write_string_file_atomic_label(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i32, i32* @S_IFREG
%9 = call i32 @label_context_set(i8* %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %6
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = call i32 @write_string_file_atomic(i8* %15, i8* %16)
%18 = call i32 (...) @label_context_clear()
%19 = load i32, i32* %6
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@S_IFREG = global i32 0
define i32 @write_string_file_atomic_label(i8* %0, i8* %1) {
%3 = load i32, i32* @S_IFREG
%4 = tail call i32 @label_context_set(i8* %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @write_string_file_atomic(i8* %0, i8* %1)
%8 = tail call i32 (...) @label_context_clear()
br label %9
9: ; preds = %2, %6
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int cmp_func_int64_t(void *p1, void *p2) {
  int64_t v1 = *((int64_t *)p1);
  int64_t v2 = *((int64_t *)p2);
  return (v1 > v2) - (v1 < v2);
}


x86 assembly (clang, -O0):
<cmp_func_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_func_int64_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_func_int64_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %5
%18 = load i64, i64* %6
%19 = icmp slt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmp_func_int64_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
AX0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (((int *)10000000)[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
movslq %edx,%rcx
mov    %eax,0x989680(,%rcx,4)
ret

LLVM IR (-O0):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %10
store i32 %9, i32* %11
ret i32 undef
}
/* Variables and functions */
int strcasecmp(char *, char *);
int compStrLM(const void *p1, const void *p2) {
  return strcasecmp((char *)p1, *(char **)p2);
}


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

x86 assembly (clang, -O2):
<compStrLM>:
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @compStrLM(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strcasecmp(i8* %0, i8* %4)
ret i32 %5
}
int soustraction(int lhs, int rhs, int taillalpha) {
  int result = lhs - rhs;
  if (result < 0) {
    result += taillalpha;
  }
  return result;
}


x86 assembly (clang, -O0):
<soustraction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1129 <soustraction+0x29>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soustraction>:
sub    %esi,%edi
mov    %edi,%eax
sar    $0x1f,%eax
and    %edx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @soustraction(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 %2, i32 0
%7 = add nsw i32 %6, %4
ret i32 %7
}
void matrixMultiply() {}


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

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

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

LLVM IR (-O2):
define void @matrixMultiply() {
ret void
}
int lrt(double nullmodel_logl, double ptp_logl, unsigned int df,
        double *pvalue) {
  return 1;
}


x86 assembly (clang, -O0):
<lrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lrt(double %0, double %1, i32 %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
store double* %3, double** %8
ret i32 1
}

LLVM IR (-O2):
define i32 @lrt(double %0, double %1, i32 %2, double* nocapture readnone %3) {
ret i32 1
}
/* Variables and functions */
int sprintf_time(char *, char *, float);
int sprint_time(char *buffer, float value) {
  return sprintf_time(buffer, "%.2f %s", value);
}


x86 assembly (clang, -O0):
<sprint_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf_time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_time>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf_time@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%.2f %s\00"
define i32 @sprint_time(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = call i32 @sprintf_time(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.2f %s\00"
define i32 @sprint_time(i8* %0, float %1) {
%3 = tail call i32 @sprintf_time(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 %3
}
void check_aux_info(cond) int cond;
{
  if (!cond)
    aux_info_corrupted();
}


x86 assembly (clang, -O0):
<check_aux_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <check_aux_info+0x1c>
mov    $0x0,%al
call   1030 <aux_info_corrupted@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_aux_info>:
test   %edi,%edi
je     1115 <check_aux_info+0x5>
ret
xor    %eax,%eax
jmp    1030 <aux_info_corrupted@plt>

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

LLVM IR (-O2):
define void @check_aux_info(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @aux_info_corrupted()
br label %5
5: ; preds = %3, %1
ret void
}
void point_int(int *i) { *i = 10; }


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

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

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

LLVM IR (-O2):
define void @point_int(i32* nocapture writeonly %0) {
store i32 10, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xb2() {
  Assert_real((iscntrl(178) == 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_iscntrl.c",
              895, ("iscntrl should be 0 for 0xb2"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xb2>:
push   %rax
mov    $0xb2,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37f,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xb2\00"
define void @t_iscntrl_0xb2() {
%1 = call i64 @iscntrl(i32 178)
%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 895, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xb2\00"
define void @t_iscntrl_0xb2() {
%1 = tail call i64 @iscntrl(i32 178)
%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 895, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int get_count_input(char *msg) {
  char buffer[64];
  printf("%s: ", msg);
  fflush(stdout);
  fgets(buffer, 64, stdin);
  return atoi(buffer);
}


x86 assembly (clang, -O0):
<get_count_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
mov    $0x40,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
call   1060 <atoi@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_count_input>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @get_count_input(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 64, i32 %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%12 = call i32 @atoi(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @get_count_input(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %3, i32 64, i32 %7)
%9 = call i32 @atoi(i8* %3)
ret i32 %9
}
int sl30(unsigned int a) { return (a << 30) != 0; }


x86 assembly (clang, -O0):
<sl30>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1e,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl30>:
xor    %eax,%eax
test   $0x3,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @sl30(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 30
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sl30(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
char *langRomTypeSvi707Fdc() { return "SVI-707 Disk Controller"; }


x86 assembly (clang, -O0):
<langRomTypeSvi707Fdc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeSvi707Fdc>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"SVI-707 Disk Controller\00"
define i8* @langRomTypeSvi707Fdc() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"SVI-707 Disk Controller\00"
define i8* @langRomTypeSvi707Fdc() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
void rop3_125_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_125_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_125_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_125_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_125_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xe8() {
  Assert_real((isascii(232) == 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_isascii.c",
              1165, ("isascii should be 0 for 0xe8"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe8\00"
define void @t_isascii_0xe8() {
%1 = call i64 @isascii(i32 232)
%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 1165, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe8\00"
define void @t_isascii_0xe8() {
%1 = tail call i64 @isascii(i32 232)
%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 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char const *get_string(int stringNum) {
  switch (stringNum) {
  case 0:
    return "Bitz";
  case 1:
    return "Bytez";
  case 42:
    return "Answerz";
  default:
    return "Nothing";
  }
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <get_string+0x3c>
jmp    111a <get_string+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <get_string+0x4c>
jmp    112b <get_string+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2a,%eax
je     115c <get_string+0x5c>
jmp    116c <get_string+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <get_string+0x77>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <get_string+0x77>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <get_string+0x77>
lea    0xea0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
test   %edi,%edi
je     1116 <get_string+0x16>
cmp    $0x2a,%edi
je     111e <get_string+0x1e>
cmp    $0x1,%edi
jne    1126 <get_string+0x26>
lea    0xef0(%rip),%rax
ret
lea    0xee3(%rip),%rax
ret
lea    0xee6(%rip),%rax
ret
lea    0xee6(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"Bitz\00"
@.str.1 = [6 x i8] c"Bytez\00"
@.str.2 = [8 x i8] c"Answerz\00"
@.str.3 = [8 x i8] c"Nothing\00"
define i8* @get_string(i32 %0) {
switch i32 %0, label %4 [
i32 0, label %5
i32 1, label %2
i32 42, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
struct dive_site_table {
  int dummy;
};
struct dive_site {
  int dummy;
};

/* Variables and functions */
int get_idx_in_dive_site_table(struct dive_site_table *,
                               struct dive_site const *);
int /*<<< orphan*/ remove_from_dive_site_table(struct dive_site_table *, int);
int remove_dive_site(const struct dive_site *item,
                     struct dive_site_table *table) {
  int idx = get_idx_in_dive_site_table(table, item);
  if (idx >= 0)
    remove_from_dive_site_table(table, idx);
  return idx;
}


x86 assembly (clang, -O0):
<remove_dive_site>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <get_idx_in_dive_site_table@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1156 <remove_dive_site+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <remove_from_dive_site_table@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_dive_site>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1040 <get_idx_in_dive_site_table@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1141 <remove_dive_site+0x21>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <remove_from_dive_site_table@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.dive_site = type { i32 }
%struct.dive_site_table = type { i32 }
define i32 @remove_dive_site(%struct.dive_site* %0, %struct.dive_site_table* %1) {
%3 = alloca %struct.dive_site*
%4 = alloca %struct.dive_site_table*
%5 = alloca i32
store %struct.dive_site* %0, %struct.dive_site** %3
store %struct.dive_site_table* %1, %struct.dive_site_table** %4
%6 = load %struct.dive_site_table*, %struct.dive_site_table** %4
%7 = load %struct.dive_site*, %struct.dive_site** %3
%8 = call i32 @get_idx_in_dive_site_table(%struct.dive_site_table* %6, %struct.dive_site* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.dive_site_table*, %struct.dive_site_table** %4
%13 = load i32, i32* %5
%14 = call i32 @remove_from_dive_site_table(%struct.dive_site_table* %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
%struct.dive_site = type { i32 }
%struct.dive_site_table = type { i32 }
define i32 @remove_dive_site(%struct.dive_site* %0, %struct.dive_site_table* %1) {
%3 = tail call i32 @get_idx_in_dive_site_table(%struct.dive_site_table* %1, %struct.dive_site* %0)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @remove_from_dive_site_table(%struct.dive_site_table* %1, i32 %3)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
double myproc(int x) { return 42.0 + x; }


x86 assembly (clang, -O0):
<myproc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<myproc>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @myproc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fadd double 4.200000e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @myproc(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, 4.200000e+01
ret double %3
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_newsbindir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_newsbindir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_newsbindir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_newsbindir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void test_43_1(short *mem) { __atomic_nand_fetch(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_43_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0xffff,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x28(%rbp)
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1162 <test_43_1+0x62>
jmp    1125 <test_43_1+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
and    %cx,%ax
xor    $0xffff,%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_43_1>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_43_1+0x10>
ret

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

LLVM IR (-O2):
define void @test_43_1(i16* nocapture %0) {
%2 = atomicrmw nand i16* %0, i16 -1 acq_rel
ret void
}
void dummy() { ; }


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

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

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

LLVM IR (-O2):
define void @dummy() {
ret void
}