xunge/DecIR huggingface dataset:
void *ehnlc_rawmemchr(const void *a, int c) {
  unsigned char *ucs;
  ucs = (unsigned char *)a;
  while (((int)(*ucs)) != c) {
    ++ucs;
  }
  return ucs;
}


x86 assembly (clang, -O0):
<ehnlc_rawmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    -0xc(%rbp),%eax
je     1134 <ehnlc_rawmemchr+0x34>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <ehnlc_rawmemchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_rawmemchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <ehnlc_rawmemchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @ehnlc_rawmemchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i8* %4
}
int test_imm_F0uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xF0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F0uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 240
%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_F0uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int /*<<< orphan*/ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  foo(rand());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%edi
call   1050 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%edi
call   1050 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = call i32 @foo(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @foo(i32 %5)
ret i32 0
}
/* Type definitions */
struct snmp_pdu {
  int dummy;
};

/* Variables and functions */
int snmp_sess_async_send(void *, struct snmp_pdu *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int snmp_sess_send(void *sessp, struct snmp_pdu *pdu) {
  return snmp_sess_async_send(sessp, pdu, 0, 0);
}


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

x86 assembly (clang, -O2):
<snmp_sess_send>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <snmp_sess_async_send@plt>

LLVM IR (-O0):
%struct.snmp_pdu = type { i32 }
define i32 @snmp_sess_send(i8* %0, %struct.snmp_pdu* %1) {
%3 = alloca i8*
%4 = alloca %struct.snmp_pdu*
store i8* %0, i8** %3
store %struct.snmp_pdu* %1, %struct.snmp_pdu** %4
%5 = load i8*, i8** %3
%6 = load %struct.snmp_pdu*, %struct.snmp_pdu** %4
%7 = call i32 @snmp_sess_async_send(i8* %5, %struct.snmp_pdu* %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.snmp_pdu = type { i32 }
define i32 @snmp_sess_send(i8* %0, %struct.snmp_pdu* %1) {
%3 = tail call i32 @snmp_sess_async_send(i8* %0, %struct.snmp_pdu* %1, i32 0, i32 0)
ret i32 %3
}
__attribute__((no)) int foo1(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @foo1(i32 returned %0) {
ret i32 %0
}
int test_imm_A8uint32_mem(unsigned int *val) {
  return ((*val) & (0xA8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A8uint32_mem>:
testb  $0xa8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A8uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 168
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int cairo_code_draw_envSpeedLabel_get_width() { return 72; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envSpeedLabel_get_width() {
ret i32 72
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envSpeedLabel_get_width() {
ret i32 72
}
int platform_shutdown() { return 0; }


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

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

LLVM IR (-O0):
define i32 @platform_shutdown() {
ret i32 0
}

LLVM IR (-O2):
define i32 @platform_shutdown() {
ret i32 0
}
int vector_int_compare(const void *a, const void *b) {
  const int *da = (const int *)a;
  const int *db = (const int *)b;
  const int daa = *da;
  const int dbb = *db;
  return (daa > dbb) - (daa < dbb);
}


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

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

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

LLVM IR (-O2):
define i32 @vector_int_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
char *asctime(const struct tm *tm) {}


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

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

LLVM IR (-O0):
%struct.tm = type opaque
define i8* @asctime(%struct.tm* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
%4 = load i8*, i8** %2
ret i8* %4
}

LLVM IR (-O2):
%struct.tm = type opaque
define noalias i8* @asctime(%struct.tm* nocapture readnone %0) {
ret i8* undef
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
void *ThreadFunc(void *Data) {
  unsigned long long IdxIter, NumIterations = *(unsigned long long *)Data;
  struct timespec TimeSpec;
  for (IdxIter = 0; IdxIter < NumIterations; ++IdxIter) {
    clock_gettime(CLOCK_MONOTONIC_RAW, &TimeSpec);
  }
}


x86 assembly (clang, -O0):
<ThreadFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1160 <ThreadFunc+0x50>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <ThreadFunc+0x1f>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadFunc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%rbx
test   %rbx,%rbx
je     1141 <ThreadFunc+0x31>
mov    0x2ec0(%rip),%r15
lea    0x8(%rsp),%r14
nopl   (%rax)
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <clock_gettime@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <ThreadFunc+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i8* @ThreadFunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca %struct.timespec
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
store i64 0, i64* %4
br label %10
10: ; preds = %17, %1
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32, i32* @CLOCK_MONOTONIC_RAW
%16 = call i32 @clock_gettime(i32 %15, %struct.timespec* %6)
br label %17
17: ; preds = %14
%18 = load i64, i64* %4
%19 = add i64 %18, 1
store i64 %19, i64* %4
br label %10
20: ; preds = %10
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define noalias i8* @ThreadFunc(i8* nocapture %0) {
%2 = alloca %struct.timespec
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast %struct.timespec* %2 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = load i32, i32* @CLOCK_MONOTONIC_RAW
%10 = call i32 @clock_gettime(i32 %9, %struct.timespec* %2)
%11 = add nuw i64 %8, 1
%12 = icmp eq i64 %11, %4
br i1 %12, label %13, label %7
13: ; preds = %7, %1
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x5e() {
  Assert_real((isascii(94)),
              "/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",
              475, ("isascii should be 1 for ^"));
}


x86 assembly (clang, -O0):
<t_isascii_0x5e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5e,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1db,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x5e>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x1db,%edx
jmp    1030 <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 = [26 x i8] c"isascii should be 1 for ^\00"
define void @t_isascii_0x5e() {
%1 = call i32 @isascii(i32 94)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for ^\00"
define void @t_isascii_0x5e() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_atexit() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XcmsQueryGreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Simple c program"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Simple c program\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Simple c program\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void null_hand_call() {}


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

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

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

LLVM IR (-O2):
define void @null_hand_call() {
ret void
}
/* Type definitions */
struct sock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sk_release_kernel(struct sock *);
void inet_ctl_sock_destroy(struct sock *sk) { sk_release_kernel(sk); }


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

x86 assembly (clang, -O2):
<inet_ctl_sock_destroy>:
jmp    1030 <sk_release_kernel@plt>

LLVM IR (-O0):
%struct.sock = type { i32 }
define void @inet_ctl_sock_destroy(%struct.sock* %0) {
%2 = alloca %struct.sock*
store %struct.sock* %0, %struct.sock** %2
%3 = load %struct.sock*, %struct.sock** %2
%4 = call i32 @sk_release_kernel(%struct.sock* %3)
ret void
}

LLVM IR (-O2):
%struct.sock = type { i32 }
define void @inet_ctl_sock_destroy(%struct.sock* %0) {
%2 = tail call i32 @sk_release_kernel(%struct.sock* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xc8() {
  Assert_real((isprint(200) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1005, ("isprint should be 0 for 0xc8"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc8\00"
define void @t_isprint_0xc8() {
%1 = tail call i64 @isprint(i32 200)
%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 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int *smallSqrtTable(void) {
  static int theTable[32] = {0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4,
                             4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6};
  return theTable;
}


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

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

LLVM IR (-O0):
@smallSqrtTable.theTable = internal global [32 x i32] [i32 0, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 6]
define i32* @smallSqrtTable() {
ret i32* getelementptr inbounds ([32 x i32], [32 x i32]* @smallSqrtTable.theTable, i64 0, i64 0)
}

LLVM IR (-O2):
@smallSqrtTable.theTable = internal global [32 x i32] [i32 0, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 6]
define i32* @smallSqrtTable() {
ret i32* getelementptr inbounds ([32 x i32], [32 x i32]* @smallSqrtTable.theTable, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x5b() {
  Assert_real((isprint(91)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              460, ("isprint should be 1 for ["));
}


x86 assembly (clang, -O0):
<t_isprint_0x5b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5b,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1cc,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1cc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for [\00"
define void @t_isprint_0x5b() {
%1 = call i32 @isprint(i32 91)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for [\00"
define void @t_isprint_0x5b() {
%1 = tail call i32 @isprint(i32 91)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float scale(const float x) { return x * 10.0f; }


x86 assembly (clang, -O0):
<scale>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @scale(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+01
ret float %4
}

LLVM IR (-O2):
define float @scale(float %0) {
%2 = fmul float %0, 1.000000e+01
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ platform_terminal_reset_color();
void terminal_reset_color() { platform_terminal_reset_color(); }


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

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

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

LLVM IR (-O2):
define void @terminal_reset_color() {
%1 = tail call i32 (...) @platform_terminal_reset_color()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long size_of_file(FILE *fileS1) {
  long size_file;
  fseek(fileS1, 0, SEEK_END);
  size_file = ftell(fileS1);
  fseek(fileS1, 0, SEEK_SET);
  return size_file;
}


x86 assembly (clang, -O0):
<size_of_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_of_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @size_of_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @size_of_file(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i64 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t div_with_reminder(uint64_t dividend, uint32_t divisor,
                           uint32_t *remainder) {
  dividend |= ((uint64_t)*remainder) << 32;
  *remainder = dividend % divisor;
  return dividend / divisor;
}


x86 assembly (clang, -O0):
<div_with_reminder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @div_with_reminder(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = shl i32 %8, 32
%10 = load i32, i32* %4
%11 = or i32 %10, %9
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @div_with_reminder(i32 %0, i32 %1, i32* nocapture readnone %2) {
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void roll_right(uint32_t state) { return; }


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

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

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

LLVM IR (-O2):
define void @roll_right(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ SLsmg_write_string(char *);
int /*<<< orphan*/ vsprintf(char *, char *, int /*<<< orphan*/);
void SLsmg_vprintf(char *fmt, va_list ap) {
  char p[1000];
  (void)vsprintf(p, fmt, ap);
  SLsmg_write_string(p);
}


x86 assembly (clang, -O0):
<SLsmg_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vsprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <SLsmg_write_string@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLsmg_vprintf>:
push   %rbx
sub    $0x3f0,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <vsprintf@plt>
mov    %rbx,%rdi
call   1040 <SLsmg_write_string@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SLsmg_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vsprintf(i8* %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @SLsmg_write_string(i8* %10)
ret void
}

LLVM IR (-O2):
define void @SLsmg_vprintf(i8* nocapture %0, i32 %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsprintf(i8* %4, i8* %0, i32 %1)
%6 = call i32 @SLsmg_write_string(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ raw();
int /*<<< orphan*/ ui_cancellation_enabled();
int ui_cancellation_pause(void) {
  if (!ui_cancellation_enabled()) {
    return 0;
  }
  raw();
  return 1;
}


x86 assembly (clang, -O0):
<ui_cancellation_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ui_cancellation_enabled@plt>
cmp    $0x0,%eax
jne    1144 <ui_cancellation_pause+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1152 <ui_cancellation_pause+0x32>
mov    $0x0,%al
call   1040 <raw@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_cancellation_pause>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <ui_cancellation_enabled@plt>
test   %eax,%eax
je     113a <ui_cancellation_pause+0x1a>
xor    %eax,%eax
call   1040 <raw@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ui_cancellation_pause() {
%1 = tail call i32 (...) @ui_cancellation_enabled()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @raw()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
int ispunct(int c) {
  return (c >= '!' && c <= '/') || (c >= ':' && c <= '@') ||
         (c >= '[' && c <= '`') || (c >= '{' && c <= '~') || (c > 0x7f);
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <ispunct+0x20>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1175 <ispunct+0x75>
cmpl   $0x3a,-0x4(%rbp)
jl     1139 <ispunct+0x39>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1175 <ispunct+0x75>
cmpl   $0x5b,-0x4(%rbp)
jl     1152 <ispunct+0x52>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1175 <ispunct+0x75>
cmpl   $0x7b,-0x4(%rbp)
jl     116b <ispunct+0x6b>
mov    $0x1,%al
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1175 <ispunct+0x75>
cmpl   $0x7f,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
cmp    $0x7f,%edi
pxor   0xef4(%rip),%xmm0
setg   %al
movdqa 0xef9(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
test   %ecx,%ecx
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %29, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 58
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %29, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 91
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 96
br i1 %19, label %29, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 123
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br i1 %25, label %29, label %26
26: ; preds = %23, %20
%27 = load i32, i32* %2
%28 = icmp sgt i32 %27, 127
br label %29
29: ; preds = %26, %23, %17, %11, %5
%30 = phi i1 [ true, %23 ], [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %28, %26 ]
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = icmp sgt i32 %0, 127
%7 = bitcast <4 x i1> %5 to i4
%8 = icmp ne i4 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
void consoleDone() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ktsan_thr_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, cuad;
  printf("Ingrese un numero: ");
  scanf("%d", &num);
  cuad = num * num;
  printf("%d", cuad);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Ingrese un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Ingrese un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
float __nv_rhypotf(float, float);
float rhypotf(float __a, float __b) { return __nv_rhypotf(__a, __b); }


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

x86 assembly (clang, -O2):
<rhypotf>:
jmp    1030 <__nv_rhypotf@plt>

LLVM IR (-O0):
define float @rhypotf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__nv_rhypotf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @rhypotf(float %0, float %1) {
%3 = tail call float @__nv_rhypotf(float %0, float %1)
ret float %3
}
/* Variables and functions */
unsigned char *pgmReadFile(char *, unsigned char *, int *, int *);
int /*<<< orphan*/ pgmWriteFile(char *, unsigned char *, int, int);
int main() {
  int cols, rows;
  unsigned char *img = NULL;
  img = pgmReadFile("test.pgm", img, &cols, &rows);
  pgmWriteFile("test1.pgm", img, cols, rows);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <pgmReadFile@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea5(%rip),%rdi
call   1030 <pgmWriteFile@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
xor    %esi,%esi
call   1040 <pgmReadFile@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0xec4(%rip),%rdi
mov    %rax,%rsi
call   1030 <pgmWriteFile@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.pgm\00"
@.str.1 = [10 x i8] c"test1.pgm\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @pgmReadFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, i32* %2, i32* %3)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @pgmWriteFile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %8, i32 %9)
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.pgm\00"
@.str.1 = [10 x i8] c"test1.pgm\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i8* @pgmReadFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* null, i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @pgmWriteFile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %6, i32 %7)
ret i32 1
}
int is_multiple(int N, int n) { return (N / n) * n == N; }


x86 assembly (clang, -O0):
<is_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_multiple>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_multiple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_multiple(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int strncmp(char const *, char const *, int /*<<< orphan*/);
int strcmp_prefix(const char *str1, const char *str2) {
  return strncmp(str1, str2, strlen(str2));
}


x86 assembly (clang, -O0):
<strcmp_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @strcmp_prefix(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmp_prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
int test_imm_4Cint16_mem(short *val) {
  return ((*val) & (-0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffb4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Cint16_mem>:
movzwl (%rdi),%eax
test   $0xffb4,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -76
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char x_to_col(int x, int startx, int w) { return 'a' + (x - startx) / w; }


x86 assembly (clang, -O0):
<x_to_col>:
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
cltd
idivl  -0xc(%rbp)
add    $0x61,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_to_col>:
mov    %edx,%ecx
mov    %edi,%eax
sub    %esi,%eax
cltd
idiv   %ecx
add    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @x_to_col(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = sdiv i32 %9, %10
%12 = add nsw i32 97, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @x_to_col(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = sdiv i32 %4, %2
%6 = trunc i32 %5 to i8
%7 = add i8 %6, 97
ret i8 %7
}
int test_imm_63uint32_mem(unsigned int *val) {
  return ((*val) & (0x63 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_63uint32_mem>:
testb  $0x63,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_63uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 99
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void fb_hInit(void) {
  unsigned int control_word;
  __asm__ __volatile__("fstcw %0" : "=m"(control_word) :);
  control_word = (control_word & 0xF0FF) | 0x300;
  __asm__ __volatile__("fldcw %0" : : "m"(control_word));
}


x86 assembly (clang, -O0):
<fb_hInit>:
push   %rbp
mov    %rsp,%rbp
fstcw  -0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0ff,%eax
or     $0x300,%eax
mov    %eax,-0x4(%rbp)
fldcw  -0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_hInit>:
fstcw  -0x4(%rsp)
mov    $0xf0ff,%eax
and    -0x4(%rsp),%eax
or     $0x300,%eax
mov    %eax,-0x4(%rsp)
fldcw  -0x4(%rsp)
ret

LLVM IR (-O0):
define void @fb_hInit() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = and i32 %2, 61695
%4 = or i32 %3, 768
store i32 %4, i32* %1
ret void
}

LLVM IR (-O2):
define void @fb_hInit() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
%4 = and i32 %3, 61695
%5 = or i32 %4, 768
store i32 %5, i32* %1
ret void
}
void debug_check_no_locks_held(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @debug_check_no_locks_held(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int setuid(int);
int g_setuid(int pid) { return setuid(pid); }


x86 assembly (clang, -O0):
<g_setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <setuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_setuid>:
jmp    1030 <setuid@plt>

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

LLVM IR (-O2):
define i32 @g_setuid(i32 %0) {
%2 = tail call i32 @setuid(i32 %0)
ret i32 %2
}
void unlink() {}


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

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

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

LLVM IR (-O2):
define void @unlink() {
ret void
}
void range(v, r) double *v, r;
{ *v -= r * floor(*v / r); }


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @range(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @llvm.floor.f64(double %9)
%11 = load double*, double** %3
%12 = load double, double* %11
%13 = fneg double %5
%14 = call double @llvm.fmuladd.f64(double %13, double %10, double %12)
store double %14, double* %11
ret void
}

LLVM IR (-O2):
define void @range(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fdiv double %3, %1
%5 = tail call double @llvm.floor.f64(double %4)
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %3)
store double %7, double* %0
ret void
}