xunge/DecIR huggingface dataset:
int CompareSizesByValue(const void *sz0, const void *sz1) {
  long long int *size0 = (long long int *)sz0, *size1 = (long long int *)sz1;
  int res = 0;
  if (*size0 - *size1 > 0)
    res = 1;
  else if (*size0 - *size1 < 0)
    res = -1;
  return res;
}


x86 assembly (clang, -O0):
<CompareSizesByValue>:
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)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%rax
cmp    $0x0,%rax
jle    1147 <CompareSizesByValue+0x47>
movl   $0x1,-0x24(%rbp)
jmp    116b <CompareSizesByValue+0x6b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%rax
cmp    $0x0,%rax
jge    1166 <CompareSizesByValue+0x66>
movl   $0xffffffff,-0x24(%rbp)
jmp    116b <CompareSizesByValue+0x6b>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareSizesByValue>:
mov    (%rdi),%rax
sub    (%rsi),%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
test   %rax,%rax
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @CompareSizesByValue(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = icmp sgt i64 %7, 0
%9 = ashr i64 %7, 63
%10 = trunc i64 %9 to i32
%11 = select i1 %8, i32 1, i32 %10
ret i32 %11
}
int test_imm_9Fuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x9F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Fuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 159
%7 = icmp ne i64 %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_9Fuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10420224
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *safe_malloc_(size_t);
void *safe_malloc_add_2op_(size_t size1, size_t size2) {
  size2 += size1;
  if (size2 < size1)
    return 0;
  return safe_malloc_(size2);
}


x86 assembly (clang, -O0):
<safe_malloc_add_2op_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1147 <safe_malloc_add_2op_+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1154 <safe_malloc_add_2op_+0x44>
mov    -0x18(%rbp),%rdi
call   1030 <safe_malloc_@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc_add_2op_>:
add    %rsi,%rdi
jae    1118 <safe_malloc_add_2op_+0x8>
xor    %eax,%eax
ret
jmp    1030 <safe_malloc_@plt>

LLVM IR (-O0):
define i8* @safe_malloc_add_2op_(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = add i64 %7, %6
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* null, i8** %3
br label %16
13: ; preds = %2
%14 = load i64, i64* %5
%15 = call i8* @safe_malloc_(i64 %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %13, %12
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @safe_malloc_add_2op_(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @safe_malloc_(i64 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: throttle <times> <period> <statefile> [<command> [args]]\n");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"usage: throttle <times> <period> <statefile> [<command> [args]]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"usage: throttle <times> <period> <statefile> [<command> [args]]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
int ShrTest11(int Y, int X, unsigned C) { return (Y | (X >> C)) << C; }


x86 assembly (clang, -O0):
<ShrTest11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest11>:
mov    %edx,%ecx
mov    %esi,%eax
sar    %cl,%eax
or     %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest11(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 = load i32, i32* %6
%10 = ashr i32 %8, %9
%11 = or i32 %7, %10
%12 = load i32, i32* %6
%13 = shl i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ShrTest11(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, %2
%5 = or i32 %4, %0
%6 = shl i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ init_device();
int /*<<< orphan*/ open_device();
int /*<<< orphan*/ start_capturing();
void capture_open() {
  open_device();
  init_device();
  start_capturing();
}


x86 assembly (clang, -O0):
<capture_open>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <open_device@plt>
mov    $0x0,%al
call   1030 <init_device@plt>
mov    $0x0,%al
call   1040 <start_capturing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_open>:
push   %rax
xor    %eax,%eax
call   1050 <open_device@plt>
xor    %eax,%eax
call   1030 <init_device@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <start_capturing@plt>

LLVM IR (-O0):
define void @capture_open() {
%1 = call i32 (...) @open_device()
%2 = call i32 (...) @init_device()
%3 = call i32 (...) @start_capturing()
ret void
}

LLVM IR (-O2):
define void @capture_open() {
%1 = tail call i32 (...) @open_device()
%2 = tail call i32 (...) @init_device()
%3 = tail call i32 (...) @start_capturing()
ret void
}
/* Type definitions */
struct mod {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mod *);
int /*<<< orphan*/ printf(char *);
void mod_release(struct mod *inst) {
  printf("this is mod_release\n");
  free(inst);
}


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

x86 assembly (clang, -O2):
<mod_release>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.mod = type { i32 }
@.str = [21 x i8] c"this is mod_release\0A\00"
define void @mod_release(%struct.mod* %0) {
%2 = alloca %struct.mod*
store %struct.mod* %0, %struct.mod** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.mod*, %struct.mod** %2
%5 = call i32 @free(%struct.mod* %4)
ret void
}

LLVM IR (-O2):
%struct.mod = type { i32 }
@str = [20 x i8] c"this is mod_release\00"
define void @mod_release(%struct.mod* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @free(%struct.mod* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void *threadA(void *unused) {
  display(100, 65);
  printf("\n End of the thread A\n");
  fflush(stdout);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<threadA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x64,%edi
mov    $0x41,%esi
call   1030 <display@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadA>:
push   %rax
mov    $0x64,%edi
mov    $0x41,%esi
call   1040 <display@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0A End of the thread A\0A\00"
@stdout = global i32 0
define i8* @threadA(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @display(i32 100, i32 65)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @pthread_exit(i32* null)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [22 x i8] c"\0A End of the thread A\00"
define noalias i8* @threadA(i8* nocapture readnone %0) {
%2 = tail call i32 @display(i32 100, i32 65)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int getAutoTypeImpl();
int getAutoType() {
  auto i = getAutoTypeImpl();
  return i;
}


x86 assembly (clang, -O0):
<getAutoType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getAutoTypeImpl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getAutoType() {
%1 = alloca i32
%2 = call i32 (...) @getAutoTypeImpl()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @getAutoType() {
%1 = tail call i32 (...) @getAutoTypeImpl()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putc(char const, int /*<<< orphan*/);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usleep(int);
void output(const char *s) {
  setbuf(stdout, NULL);
  while (*s != '\0') {
    usleep(8050);
    putc(*s, stdout);
    s++;
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1190 <output+0x60>
mov    $0x1f72,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    0x2e6b(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114e <output+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
cmpb   $0x0,(%rbx)
je     117f <output+0x4f>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1f72,%edi
call   1050 <usleep@plt>
movsbl -0x1(%rbx),%edi
mov    (%r14),%esi
call   1040 <putc@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1160 <output+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @output(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @setbuf(i32 %3, i32* null)
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = call i32 @usleep(i32 8050)
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = load i32, i32* @stdout
%15 = call i32 @putc(i8 signext %13, i32 %14)
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @output(i8* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %12, %6 ], [ %0, %1 ]
%8 = tail call i32 @usleep(i32 8050)
%9 = load i8, i8* %7
%10 = load i32, i32* @stdout
%11 = tail call i32 @putc(i8 signext %9, i32 %10)
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
ret void
}
/* Variables and functions */
bool prv_is_whitespace(char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}


x86 assembly (clang, -O0):
<prv_is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <prv_is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <prv_is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <prv_is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_is_whitespace>:
cmp    $0x20,%dil
ja     1120 <prv_is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <prv_is_whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @prv_is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @prv_is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
char *help_message(char *);
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *program_name) {
  printf("%s", help_message(program_name));
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_help(i8* %0) {
%2 = tail call i8* @help_message(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  long long_time = (long)time(NULL);
  printf("love you %ld\n", long_time);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"love you %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"love you %ld\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
int UAX_Asm_RegAsDWord(int reg) {
  if (reg == 0xFF)
    return (0xFF);
  return (reg & 15);
}


x86 assembly (clang, -O0):
<UAX_Asm_RegAsDWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    1120 <UAX_Asm_RegAsDWord+0x20>
movl   $0xff,-0x4(%rbp)
jmp    1129 <UAX_Asm_RegAsDWord+0x29>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UAX_Asm_RegAsDWord>:
mov    %edi,%eax
and    $0xf,%eax
cmp    $0xff,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @UAX_Asm_RegAsDWord(i32 %0) {
%2 = icmp eq i32 %0, 255
%3 = and i32 %0, 15
%4 = select i1 %2, i32 255, i32 %3
ret i32 %4
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISREG(int);
int S_IXUSR;
scalar_t__ stat(char const *, struct stat *);
int is_executable(const char *name) {
  struct stat st;
  if (stat(name, &st) || !S_ISREG(st.st_mode)) {
    return 0;
  }
  return st.st_mode & S_IXUSR;
}


x86 assembly (clang, -O0):
<is_executable>:
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
jne    1154 <is_executable+0x34>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%eax
jne    1160 <is_executable+0x40>
movl   $0x0,-0x4(%rbp)
jmp    116f <is_executable+0x4f>
mov    -0x18(%rbp),%eax
mov    0x2e7e(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_executable>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1150 <is_executable+0x30>
mov    0x8(%rsp),%edi
call   1040 <S_ISREG@plt>
test   %eax,%eax
je     1150 <is_executable+0x30>
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebx
and    0x8(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IXUSR = global i32 0
define i32 @is_executable(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 ne i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISREG(i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8, %1
store i32 0, i32* %2
br label %19
14: ; preds = %8
%15 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load i32, i32* @S_IXUSR
%18 = and i32 %16, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IXUSR = global i32 0
define i32 @is_executable(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i32, i32* %7
%13 = load i32, i32* @S_IXUSR
%14 = and i32 %13, %12
br label %15
15: ; preds = %1, %6, %11
%16 = phi i32 [ %14, %11 ], [ 0, %6 ], [ 0, %1 ]
ret i32 %16
}
int test(int a, int b, int c) {
  if (a == 43 || a == 75 || a == 44 || a == 78 || a == 77 || a == 46 ||
      a == 76 || a == 45)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x2b,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x4b,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x2c,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x4e,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x4d,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x2e,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x4c,-0x8(%rbp)
je     115d <test+0x5d>
cmpl   $0x2d,-0x8(%rbp)
jne    1168 <test+0x68>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <test+0x6e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
add    $0xffffffd5,%edi
cmp    $0x23,%edi
ja     111b <test+0x1b>
mov    %esi,%eax
movabs $0xf0000000f,%rcx
bt     %rdi,%rcx
jae    111b <test+0x1b>
ret
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 43
br i1 %9, label %31, label %10
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 75
br i1 %12, label %31, label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 44
br i1 %15, label %31, label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 78
br i1 %18, label %31, label %19
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 77
br i1 %21, label %31, label %22
22: ; preds = %19
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 46
br i1 %24, label %31, label %25
25: ; preds = %22
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 76
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 45
br i1 %30, label %31, label %33
31: ; preds = %28, %25, %22, %19, %16, %13, %10, %3
%32 = load i32, i32* %6
store i32 %32, i32* %4
br label %35
33: ; preds = %28
%34 = load i32, i32* %7
store i32 %34, i32* %4
br label %35
35: ; preds = %33, %31
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %4 [
i32 78, label %5
i32 77, label %5
i32 76, label %5
i32 75, label %5
i32 46, label %5
i32 45, label %5
i32 44, label %5
i32 43, label %5
]
4: ; preds = %3
br label %5
5: ; preds = %3, %3, %3, %3, %3, %3, %3, %3, %4
%6 = phi i32 [ %2, %4 ], [ %1, %3 ], [ %1, %3 ], [ %1, %3 ], [ %1, %3 ], [ %1, %3 ], [ %1, %3 ], [ %1, %3 ], [ %1, %3 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x48() {
  Assert_real((isascii(72)),
              "/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",
              365, ("isascii should be 1 for H"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x48>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x16d,%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 H\00"
define void @t_isascii_0x48() {
%1 = call i32 @isascii(i32 72)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, 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 H\00"
define void @t_isascii_0x48() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  if (s) {
    i = 0;
    while (s[i] != 0) {
      write(1, &s[i], 1);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116d <ft_putstr+0x5d>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <ft_putstr+0x58>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <ft_putstr+0x1e>
jmp    116d <ft_putstr+0x5d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
xchg   %ax,%ax
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = tail call i32 @write(i32 1, i8* %8, i32 1)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_prefetch_next_1();
void fill_prefetch_next(void) { fill_prefetch_next_1(); }


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

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

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

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

/* Variables and functions */
size_t BinIOFormatByteCount(char const *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ fwrite(void *, size_t, int, int /*<<< orphan*/ *);
void *malloc(size_t);
int /*<<< orphan*/ vspackf(void *, char const *, int /*<<< orphan*/);
void vfpackf(FILE *file, const char *format, va_list args) {
  size_t n_bytes = BinIOFormatByteCount(format);
  void *buffer = malloc(n_bytes);
  vspackf(buffer, format, args);
  fwrite(buffer, n_bytes, 1, file);
  free(buffer);
}


x86 assembly (clang, -O0):
<vfpackf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <BinIOFormatByteCount@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vspackf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1070 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfpackf>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <BinIOFormatByteCount@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1040 <vspackf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @vfpackf(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
%10 = call i64 @BinIOFormatByteCount(i8* %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @vspackf(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %8
%18 = load i64, i64* %7
%19 = load i32*, i32** %4
%20 = call i32 @fwrite(i8* %17, i64 %18, i32 1, i32* %19)
%21 = load i8*, i8** %8
%22 = call i32 @free(i8* %21)
ret void
}

LLVM IR (-O2):
define void @vfpackf(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i64 @BinIOFormatByteCount(i8* %1)
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @vspackf(i8* %5, i8* %1, i32 %2)
%7 = tail call i32 @fwrite(i8* %5, i64 %4, i32 1, i32* %0)
%8 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void display(int x, int y) { printf("\033[%u;%uH", x + 1, y + 1); }


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

x86 assembly (clang, -O2):
<display>:
lea    0x1(%rdi),%eax
lea    0x1(%rsi),%edx
lea    0xee3(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define void @display(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 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define void @display(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = add nsw i32 %1, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void paralyze(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 185)) {
    add_status(target, 1);
  }
}


x86 assembly (clang, -O0):
<paralyze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xb9,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <paralyze+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paralyze>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0xb9,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <paralyze+0x41>
mov    %r14,%rdi
mov    $0x1,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @paralyze(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 185)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 1)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @paralyze(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 185)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int main(int argc, char *argv[]) {
  int n;
  int input;
  struct node *root = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.node*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.node* null, %struct.node** %8
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ rc_pwm_init(int, int);
int setup_pwm() {
  if (rc_pwm_init(1, 25000))
    return -1;
  if (rc_pwm_init(2, 25000))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<setup_pwm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x61a8,%esi
call   1030 <rc_pwm_init@plt>
cmp    $0x0,%rax
je     113d <setup_pwm+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <setup_pwm+0x59>
mov    $0x2,%edi
mov    $0x61a8,%esi
call   1030 <rc_pwm_init@plt>
cmp    $0x0,%rax
je     1162 <setup_pwm+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <setup_pwm+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_pwm>:
push   %rax
mov    $0x1,%edi
mov    $0x61a8,%esi
call   1030 <rc_pwm_init@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     112f <setup_pwm+0x1f>
pop    %rcx
ret
mov    $0x2,%edi
mov    $0x61a8,%esi
call   1030 <rc_pwm_init@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @setup_pwm() {
%1 = alloca i32
%2 = call i64 @rc_pwm_init(i32 1, i32 25000)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %10
5: ; preds = %0
%6 = call i64 @rc_pwm_init(i32 2, i32 25000)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @setup_pwm() {
%1 = tail call i64 @rc_pwm_init(i32 1, i32 25000)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @rc_pwm_init(i32 2, i32 25000)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef short uint16_t;

/* Variables and functions */
uint16_t scr_ext_ps(uint8_t *scr) {
  short ext = 0;
  ext = (short)(scr[5] >> 1);
  ext += (short)(scr[4] & 0x03) * 128;
  return ext;
}


x86 assembly (clang, -O0):
<scr_ext_ps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
sar    $0x1,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0x3,%eax
movswl %ax,%ecx
shl    $0x7,%ecx
movswl -0xa(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scr_ext_ps>:
mov    0x10(%rdi),%ecx
mov    0x14(%rdi),%eax
and    $0x3,%ecx
shl    $0x7,%ecx
shr    %eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @scr_ext_ps(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
store i16 0, i16* %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 5
%6 = load i32, i32* %5
%7 = ashr i32 %6, 1
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load i32, i32* %10
%12 = and i32 %11, 3
%13 = trunc i32 %12 to i16
%14 = sext i16 %13 to i32
%15 = mul nsw i32 %14, 128
%16 = load i16, i16* %3
%17 = sext i16 %16 to i32
%18 = add nsw i32 %17, %15
%19 = trunc i32 %18 to i16
store i16 %19, i16* %3
%20 = load i16, i16* %3
ret i16 %20
}

LLVM IR (-O2):
define signext i16 @scr_ext_ps(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = load i32, i32* %4
%6 = shl i32 %5, 7
%7 = and i32 %6, 384
%8 = lshr i32 %3, 1
%9 = add nuw i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
void delay(unsigned long ms) {
  volatile unsigned long i, j;
  for (j = 0; j < ms; j++) {
    for (i = 0; i < 50; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1160 <delay+0x60>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x32,%rax
jae    114a <delay+0x4a>
jmp    1139 <delay+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <delay+0x26>
jmp    114f <delay+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <delay+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movq   $0x0,-0x10(%rsp)
jmp    1116 <delay+0x16>
nopl   0x0(%rax,%rax,1)
addq   $0x1,-0x10(%rsp)
mov    -0x10(%rsp),%rax
cmp    %rdi,%rax
jae    1153 <delay+0x53>
movq   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x31,%rax
ja     1110 <delay+0x10>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addq   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x32,%rax
jb     1140 <delay+0x40>
jmp    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store volatile i64 0, i64* %4
br label %5
5: ; preds = %18, %1
%6 = load volatile i64, i64* %4
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
store volatile i64 0, i64* %3
br label %10
10: ; preds = %14, %9
%11 = load volatile i64, i64* %3
%12 = icmp ult i64 %11, 50
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load volatile i64, i64* %3
%16 = add i64 %15, 1
store volatile i64 %16, i64* %3
br label %10
17: ; preds = %10
br label %18
18: ; preds = %17
%19 = load volatile i64, i64* %4
%20 = add i64 %19, 1
store volatile i64 %20, i64* %4
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
%5 = bitcast i64* %3 to i8*
store volatile i64 0, i64* %3
%6 = load volatile i64, i64* %3
%7 = icmp ult i64 %6, %0
br i1 %7, label %8, label %21
8: ; preds = %1, %16
store volatile i64 0, i64* %2
%9 = load volatile i64, i64* %2
%10 = icmp ult i64 %9, 50
br i1 %10, label %11, label %16
11: ; preds = %8, %11
%12 = load volatile i64, i64* %2
%13 = add i64 %12, 1
store volatile i64 %13, i64* %2
%14 = load volatile i64, i64* %2
%15 = icmp ult i64 %14, 50
br i1 %15, label %11, label %16
16: ; preds = %11, %8
%17 = load volatile i64, i64* %3
%18 = add i64 %17, 1
store volatile i64 %18, i64* %3
%19 = load volatile i64, i64* %3
%20 = icmp ult i64 %19, %0
br i1 %20, label %8, label %21
21: ; preds = %16, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *calloc(unsigned int, unsigned int);
void *my_alloc(int count, int size) {
  unsigned int u_count;
  unsigned int u_size;
  assert(count > 0 && size > 0);
  u_count = (unsigned int)count;
  u_size = (unsigned int)size;
  return calloc(u_count, u_size);
}


x86 assembly (clang, -O0):
<my_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jle    1147 <my_alloc+0x27>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <calloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_alloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %edi,%edi
setg   %al
test   %esi,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @my_alloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ false, %2 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %3
store i32 %16, i32* %5
%17 = load i32, i32* %4
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i8* @calloc(i32 %18, i32 %19)
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @my_alloc(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i8* @calloc(i32 %0, i32 %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *badblockscmd(const char *path, char *cmdresult) {
  sprintf(
      cmdresult,
      "badblocks %s -o /tmp/badblockinfo.txt 4096 2048 1>/dev/null 2>/dev/null",
      path);
  return cmdresult;
}


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

x86 assembly (clang, -O2):
<badblockscmd>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"badblocks %s -o /tmp/badblockinfo.txt 4096 2048 1>/dev/null 2>/dev/null\00"
define i8* @badblockscmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [72 x i8] c"badblocks %s -o /tmp/badblockinfo.txt 4096 2048 1>/dev/null 2>/dev/null\00"
define i8* @badblockscmd(i8* %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %1
}