xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x26() {
  Assert_real((isascii(38)),
              "/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",
              195, ("isascii should be 1 for &"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x26>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xc3,%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_0x26() {
%1 = call i32 @isascii(i32 38)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, 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_0x26() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo2(int d) {
  { double d; }
}


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

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

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

LLVM IR (-O2):
define void @foo2(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((destructor(300))) void fini_func300(void) {
  printf("fini_func with priority 300\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"fini_func with priority 300\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 300, void ()* @fini_func300, i8* null }]
define void @fini_func300() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 300, void ()* @fini_func300, i8* null }]
@str = [28 x i8] c"fini_func with priority 300\00"
define void @fini_func300() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *name(const char *pszName) {
  const char *psz = strrchr(pszName, '/');
  return psz ? psz + 1 : pszName;
}


x86 assembly (clang, -O0):
<name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <name+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <name+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
float log2f(float);
float __ocl_native_log2_float(float src) { return log2f(src); }


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

x86 assembly (clang, -O2):
<__ocl_native_log2_float>:
jmp    1030 <log2f@plt>

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

LLVM IR (-O2):
define float @__ocl_native_log2_float(float %0) {
%2 = tail call float @log2f(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, unsigned long);
void IOWrite32A(unsigned long IOadrs, unsigned long IOdata) {
  RamWrite32A(0xC000, IOadrs);
  RamWrite32A(0xD000, IOdata);
}


x86 assembly (clang, -O0):
<IOWrite32A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xc000,%edi
call   1030 <RamWrite32A@plt>
mov    -0x10(%rbp),%rsi
mov    $0xd000,%edi
call   1030 <RamWrite32A@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IOWrite32A>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    $0xc000,%edi
call   1030 <RamWrite32A@plt>
mov    $0xd000,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @IOWrite32A(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @RamWrite32A(i32 49152, i64 %5)
%7 = load i64, i64* %4
%8 = call i32 @RamWrite32A(i32 53248, i64 %7)
ret void
}

LLVM IR (-O2):
define void @IOWrite32A(i64 %0, i64 %1) {
%3 = tail call i32 @RamWrite32A(i32 49152, i64 %0)
%4 = tail call i32 @RamWrite32A(i32 53248, i64 %1)
ret void
}
void HalIOWait(void) { __asm volatile("jmp 1f;1:jmp 1f;1:"); }


x86 assembly (clang, -O0):
<HalIOWait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HalIOWait+0x9>
jmp    110e <HalIOWait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HalIOWait>:
jmp    1102 <HalIOWait+0x2>
jmp    1104 <HalIOWait+0x4>
ret

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

LLVM IR (-O2):
define void @HalIOWait() {
tail call void asm sideeffect "jmp 1f;1:jmp 1f;1:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int add_one_to_double_loop_counters(int *i, int *j, int n, int m) {
  if (++(*j) >= m) {
    *j = 0;
    (*i)++;
  }
  return ((*i) >= n ? 1 : 0);
}


x86 assembly (clang, -O0):
<add_one_to_double_loop_counters>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    -0x18(%rbp),%eax
jl     113b <add_one_to_double_loop_counters+0x3b>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_one_to_double_loop_counters>:
mov    (%rsi),%eax
add    $0x1,%eax
mov    %eax,(%rsi)
cmp    %ecx,%eax
jge    110f <add_one_to_double_loop_counters+0xf>
mov    (%rdi),%ecx
jmp    111c <add_one_to_double_loop_counters+0x1c>
movl   $0x0,(%rsi)
mov    (%rdi),%ecx
add    $0x1,%ecx
mov    %ecx,(%rdi)
xor    %eax,%eax
cmp    %edx,%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @add_one_to_double_loop_counters(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = icmp slt i32 %6, %3
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* %0
br label %13
10: ; preds = %4
store i32 0, i32* %1
%11 = load i32, i32* %0
%12 = add nsw i32 %11, 1
store i32 %12, i32* %0
br label %13
13: ; preds = %8, %10
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
%15 = icmp sge i32 %14, %2
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ store_htonll(int /*<<< orphan*/);
u_int64_t store_swp_hton64(u_int64_t v) { return store_htonll(v); }


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

x86 assembly (clang, -O2):
<store_swp_hton64>:
jmp    1030 <store_htonll@plt>

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

LLVM IR (-O2):
define i32 @store_swp_hton64(i32 %0) {
%2 = tail call i32 @store_htonll(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test7();
int main(int argc, char **argv) {
  if (!test7())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test7@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test7@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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 (...) @test7()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test7()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
/* Type definitions */
typedef float uint32_t;

/* Variables and functions */
float fasterlog2(float x) {
  union {
    float f;
    uint32_t i;
  } vx = {x};
  float y = vx.i;
  y *= 1.1920928955078125e-7f;
  return y - 126.94269504f;
}


x86 assembly (clang, -O0):
<fasterlog2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xec4(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { float }
define float @fasterlog2(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca float
store float %0, float* %2
%5 = bitcast %union.anon* %3 to float*
%6 = load float, float* %2
store float %6, float* %5
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
store float %8, float* %4
%9 = load float, float* %4
%10 = fmul float %9, 0x3E80000000000000
store float %10, float* %4
%11 = load float, float* %4
%12 = fsub float %11, 0x405FBC5520000000
ret float %12
}

LLVM IR (-O2):
define float @fasterlog2(float %0) {
%2 = fmul float %0, 0x3E80000000000000
%3 = fadd float %2, 0xC05FBC5520000000
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *del_string(char *string) {
  if (string)
    free(string);
  return NULL;
}


x86 assembly (clang, -O0):
<del_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <del_string+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_string>:
test   %rdi,%rdi
je     111f <del_string+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @del_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* null
}
char nextChar(char *s) {
  static int i = -1;
  char c;
  ++i;
  c = *(s + i);
  if (c == '\0')
    return '\0';
  else
    return c;
}


x86 assembly (clang, -O0):
<nextChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    0x2f12(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f09(%rip)
mov    -0x10(%rbp),%rax
movslq 0x2efe(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    113e <nextChar+0x3e>
movb   $0x0,-0x1(%rbp)
jmp    1144 <nextChar+0x44>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextChar>:
movslq 0x2f19(%rip),%rax
lea    0x1(%rax),%rcx
mov    %ecx,0x2f0f(%rip)
mov    0x1(%rdi,%rax,1),%al
ret

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

LLVM IR (-O2):
@nextChar.i = internal unnamed_addr global i32 -1
define signext i8 @nextChar(i8* nocapture %0) {
%2 = load i32, i32* @nextChar.i
%3 = add nsw i32 %2, 1
store i32 %3, i32* @nextChar.i
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void c_intface_(int *i) { fprintf(stdout, "ADD_\n"); }


x86 assembly (clang, -O0):
<c_intface_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_intface_>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"ADD_\0A\00"
define void @c_intface_(i32* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test87(__m64 a, __m64 b) { return _mm_cmpgt_pi8(a, b); }


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

x86 assembly (clang, -O2):
<test87>:
jmp    1030 <_mm_cmpgt_pi8@plt>

LLVM IR (-O0):
define i32 @test87(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 = call i32 @_mm_cmpgt_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test87(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root_depth;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
int get_Screen_root_depth(void *_p) { return (int)((Screen *)_p)->root_depth; }


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

x86 assembly (clang, -O2):
<get_Screen_root_depth>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_Screen_root_depth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_Screen_root_depth(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int evt_wait() {}


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

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

LLVM IR (-O0):
define i32 @evt_wait() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @evt_wait() {
ret i32 undef
}
extern __attribute__((__simd__)) int simd_attr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @simd_attr() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void die_with_usage(char **argv) {
  printf("Usage: %s <thread|fork> <mem size in MB>\n", argv[0]);
  exit(0);
}


x86 assembly (clang, -O0):
<die_with_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_with_usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Usage: %s <thread|fork> <mem size in MB>\0A\00"
define void @die_with_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Usage: %s <thread|fork> <mem size in MB>\0A\00"
define void @die_with_usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
long __syscall_error(int err_no) {
  __set_errno(err_no);
  return -1;
}


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

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @__syscall_error(i32 %0) {
%2 = tail call i32 @__set_errno(i32 %0)
ret i64 -1
}
int add_int(register int u, register int v) { return u + v; }


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

x86 assembly (clang, -O2):
<add_int>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_int(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
void *mal(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mal>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @mal(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @mal(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_server_get_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_server@%p::get (rtpp_server_get) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_server_get_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_server_get_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"Method rtpp_server@%p::get (rtpp_server_get) is invoked after destruction\0A\00"
define void @rtpp_server_get_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"Method rtpp_server@%p::get (rtpp_server_get) is invoked after destruction\0A\00"
define void @rtpp_server_get_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
scalar_t__ strchr(char *, char);
int is_int(double number) {
  char buf[2000];
  sprintf(buf, "%g", number);
  if (strchr(buf, '.')) {
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<is_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movsd  %xmm0,-0x10(%rbp)
lea    -0x7e0(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x7e0(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     116f <is_int+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <is_int+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_int>:
push   %rbx
sub    $0x7d0,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x7d0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define i32 @is_int(double %0) {
%2 = alloca [2000 x i8]
%3 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
%5 = call i64 @strchr(i8* %3, i8 signext 46)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void __hv_store_f(float *bOut, float bIn) { *bOut = bIn; }


x86 assembly (clang, -O0):
<__hv_store_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_store_f>:
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @__hv_store_f(float* nocapture writeonly %0, float %1) {
store float %1, float* %0
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf) < 0) {
    if (errno == ENOENT) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    115e <file_exists+0x4e>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1159 <file_exists+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1165 <file_exists+0x55>
jmp    115e <file_exists+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jns    1136 <file_exists+0x26>
mov    0x2ebb(%rip),%rax
mov    (%rax),%rcx
mov    0x2ea1(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
je     113b <file_exists+0x2b>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i64, i64* @errno
%10 = load i64, i64* @ENOENT
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %15
13: ; preds = %8
br label %14
14: ; preds = %13, %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOENT
%9 = icmp eq i64 %7, %8
br i1 %9, label %11, label %10
10: ; preds = %6, %1
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 1, %10 ], [ 0, %6 ]
ret i32 %12
}
void foobar() { double d = 0.0; }


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foobar() {
%1 = alloca double
store double 0.000000e+00, double* %1
ret void
}

LLVM IR (-O2):
define void @foobar() {
ret void
}
int test_imm_9Duint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Duint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 157
%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_9Duint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 157
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ libipt_DNAT_init();
int /*<<< orphan*/ libipt_LOG_init();
int /*<<< orphan*/ libipt_MASQUERADE_init();
int /*<<< orphan*/ libipt_REDIRECT_init();
int /*<<< orphan*/ libipt_REJECT_init();
int /*<<< orphan*/ libipt_SNAT_init();
int /*<<< orphan*/ libipt_ah_init();
int /*<<< orphan*/ libipt_icmp_init();
void init_extensions4(void) {
  libipt_DNAT_init();
  libipt_LOG_init();
  libipt_MASQUERADE_init();
  libipt_REDIRECT_init();
  libipt_REJECT_init();
  libipt_SNAT_init();
  libipt_ah_init();
  libipt_icmp_init();
}


x86 assembly (clang, -O0):
<init_extensions4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <libipt_DNAT_init@plt>
mov    $0x0,%al
call   1050 <libipt_LOG_init@plt>
mov    $0x0,%al
call   1080 <libipt_MASQUERADE_init@plt>
mov    $0x0,%al
call   1090 <libipt_REDIRECT_init@plt>
mov    $0x0,%al
call   1030 <libipt_REJECT_init@plt>
mov    $0x0,%al
call   1060 <libipt_SNAT_init@plt>
mov    $0x0,%al
call   10a0 <libipt_ah_init@plt>
mov    $0x0,%al
call   1070 <libipt_icmp_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_extensions4>:
push   %rax
xor    %eax,%eax
call   1040 <libipt_DNAT_init@plt>
xor    %eax,%eax
call   1050 <libipt_LOG_init@plt>
xor    %eax,%eax
call   1080 <libipt_MASQUERADE_init@plt>
xor    %eax,%eax
call   1090 <libipt_REDIRECT_init@plt>
xor    %eax,%eax
call   1030 <libipt_REJECT_init@plt>
xor    %eax,%eax
call   1060 <libipt_SNAT_init@plt>
xor    %eax,%eax
call   10a0 <libipt_ah_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <libipt_icmp_init@plt>

LLVM IR (-O0):
define void @init_extensions4() {
%1 = call i32 (...) @libipt_DNAT_init()
%2 = call i32 (...) @libipt_LOG_init()
%3 = call i32 (...) @libipt_MASQUERADE_init()
%4 = call i32 (...) @libipt_REDIRECT_init()
%5 = call i32 (...) @libipt_REJECT_init()
%6 = call i32 (...) @libipt_SNAT_init()
%7 = call i32 (...) @libipt_ah_init()
%8 = call i32 (...) @libipt_icmp_init()
ret void
}

LLVM IR (-O2):
define void @init_extensions4() {
%1 = tail call i32 (...) @libipt_DNAT_init()
%2 = tail call i32 (...) @libipt_LOG_init()
%3 = tail call i32 (...) @libipt_MASQUERADE_init()
%4 = tail call i32 (...) @libipt_REDIRECT_init()
%5 = tail call i32 (...) @libipt_REJECT_init()
%6 = tail call i32 (...) @libipt_SNAT_init()
%7 = tail call i32 (...) @libipt_ah_init()
%8 = tail call i32 (...) @libipt_icmp_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int);
int /*<<< orphan*/ stdout;
void show_summary(int num_pixels, int heigth, int width, int length_data) {
  fprintf(stdout,
          "\n------------------------ Summary "
          "----------------------------\n\n[!] Num pixels: %d \n[!] Heigth: "
          "%d\n[!] Width: %d\n[!] Length of hidded data: "
          "%d\n\n-------------------------------------------------------------",
          num_pixels, heigth, width, length_data);
}


x86 assembly (clang, -O0):
<show_summary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_summary>:
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [206 x i8] c"\0A------------------------ Summary ----------------------------\0A\0A[!] Num pixels: %d \0A[!] Heigth: %d\0A[!] Width: %d\0A[!] Length of hidded data: %d\0A\0A-------------------------------------------------------------\00"
define void @show_summary(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stdout
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [206 x i8] c"\0A------------------------ Summary ----------------------------\0A\0A[!] Num pixels: %d \0A[!] Heigth: %d\0A[!] Width: %d\0A[!] Length of hidded data: %d\0A\0A-------------------------------------------------------------\00"
define void @show_summary(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
void lerrsf(msg, arg) const char *msg, arg[];
{
  char errmsg[2048];
  snprintf(errmsg, sizeof(errmsg) - 1, msg, arg);
  errmsg[sizeof(errmsg) - 1] = 0;
  flexerror(errmsg);
}


x86 assembly (clang, -O0):
<lerrsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x7ff,%esi
mov    $0x0,%al
call   1040 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1030 <flexerror@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrsf>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    $0x7ff,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <snprintf@plt>
movb   $0x0,0x7ff(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <flexerror@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lerrsf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 2047, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 2047
store i8 0, i8* %10
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %11)
ret void
}

LLVM IR (-O2):
define void @lerrsf(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %4, i64 2047, i8* %0, i8* %1)
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 2047
store i8 0, i8* %6
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void nothing() {
  char *buf0[50];
  fgets(*buf0, sizeof(*buf0), stdin);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    -0x190(%rbp),%rdi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1030 <fgets@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
jmp    1030 <fgets@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 8, i32 %4)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @nothing() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgets(i8* undef, i32 8, i32 %1)
ret void
}
char *hash_plugin_detailed(void) {
  return ("osx-old - MacOSX <=10.6 system passwords plugin\n"
          "------------------------\n"
          "Use this module to crack MacOSX <= 10.6 password hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "MacOSX.\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [290 x i8] c"osx-old - MacOSX <=10.6 system passwords plugin\0A------------------------\0AUse this module to crack MacOSX <= 10.6 password hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AMacOSX.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([290 x i8], [290 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [290 x i8] c"osx-old - MacOSX <=10.6 system passwords plugin\0A------------------------\0AUse this module to crack MacOSX <= 10.6 password hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AMacOSX.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([290 x i8], [290 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void BME_OR_W(volatile uint32_t *addr,
                                       register uint32_t wdata) {
  *(volatile uint32_t *)((uint32_t)addr | (1 << 27)) = wdata;
}


x86 assembly (clang, -O0):
<BME_OR_W>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     $0x8000000,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_OR_W>:
movslq %edi,%rax
or     $0x8000000,%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @BME_OR_W(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 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i32
%8 = or i32 %7, 134217728
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %5, i32* %10
ret void
}

LLVM IR (-O2):
define void @BME_OR_W(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = or i64 %5, 134217728
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
ret void
}
void engine_state_idle_deinit(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd2\00"
define void @t_isspace_0xd2() {
%1 = tail call i64 @isspace(i32 210)
%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 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void bytestream_put_be16(uint8_t **b, const unsigned int value) {
  do {
    uint16_t d = (value);
    ((uint8_t *)(*b))[1] = (d);
    ((uint8_t *)(*b))[0] = (d) >> 8;
  } while (0);
  (*b) += 2;
}


x86 assembly (clang, -O0):
<bytestream_put_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytestream_put_be16>:
mov    (%rdi),%rax
mov    %esi,0x4(%rax)
sar    $0x8,%esi
mov    %esi,(%rax)
add    $0x8,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @bytestream_put_be16(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2
%7 = load i32, i32* %4
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %8, i32* %11
%12 = load i32, i32* %5
%13 = ashr i32 %12, 8
%14 = load i32**, i32*** %3
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %13, i32* %16
br label %17
17: ; preds = %6
%18 = load i32**, i32*** %3
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32* %20, i32** %18
ret void
}

LLVM IR (-O2):
define void @bytestream_put_be16(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %1, i32* %4
%5 = ashr i32 %1, 8
store i32 %5, i32* %3
%6 = getelementptr inbounds i32, i32* %3, i64 2
store i32* %6, i32** %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
uint8_t rotateR_fun_uint8_t(uint8_t x, int32_t i) {
  if ((i %= 8) == 0)
    return x;
  return (x << (8 - i)) | (x >> i);
}


x86 assembly (clang, -O0):
<rotateR_fun_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
jne    112c <rotateR_fun_uint8_t+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <rotateR_fun_uint8_t+0x48>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_uint8_t>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xfffffff8,%eax
sub    %eax,%esi
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%edx
shl    %cl,%edx
mov    %edi,%eax
mov    %esi,%ecx
sar    %cl,%eax
or     %edx,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rotateR_fun_uint8_t(i32 %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 8, %3
%6 = shl i32 %0, %5
%7 = ashr i32 %0, %3
%8 = or i32 %6, %7
%9 = select i1 %4, i32 %0, i32 %8
ret i32 %9
}
int test_imm_C3uint16_mem(unsigned short *val) {
  return ((*val) & (0xC3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C3uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 195
%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_C3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 195
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}