xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "Hello.\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1134 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <main+0x20>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"Hello.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"Hello.\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}
int isbrace(int c) { return ((char)c) == '(' || ((char)c) == ')' ? 1 : 0; }


x86 assembly (clang, -O0):
<isbrace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x28,%ecx
mov    %al,-0x5(%rbp)
je     112a <isbrace+0x2a>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
cmp    $0x29,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbrace>:
and    $0xfe,%edi
xor    %eax,%eax
cmp    $0x28,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isbrace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 40
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 41
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @isbrace(i32 %0) {
%2 = and i32 %0, 254
%3 = icmp eq i32 %2, 40
%4 = zext i1 %3 to i32
ret i32 %4
}
int ASAPWriter_PadXexInfo(unsigned char *dest, int offset, int endColumn) {
  while (offset % 32 != endColumn)
    dest[offset++] = 32;
  return offset;
}


x86 assembly (clang, -O0):
<ASAPWriter_PadXexInfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cmp    -0x10(%rbp),%edx
je     113d <ASAPWriter_PadXexInfo+0x3d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    110e <ASAPWriter_PadXexInfo+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASAPWriter_PadXexInfo>:
lea    0x1f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xffffffe0,%eax
mov    %esi,%ecx
sub    %eax,%ecx
cmp    %edx,%ecx
jne    1116 <ASAPWriter_PadXexInfo+0x16>
mov    %esi,%eax
ret
movslq %esi,%rax
add    %rax,%rdi
nopl   0x0(%rax)
movb   $0x20,(%rdi)
lea    0x1(%rsi),%eax
lea    0x20(%rsi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffe0,%ecx
neg    %ecx
add    %esi,%ecx
add    $0x1,%ecx
add    $0x1,%rdi
mov    %eax,%esi
cmp    %edx,%ecx
jne    1120 <ASAPWriter_PadXexInfo+0x20>
ret

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

LLVM IR (-O2):
define i32 @ASAPWriter_PadXexInfo(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = srem i32 %1, 32
%5 = icmp eq i32 %4, %2
br i1 %5, label %17, label %6
6: ; preds = %3
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %10, %8 ]
%10 = add i64 %9, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 32, i8* %11
%12 = trunc i64 %10 to i32
%13 = srem i32 %12, 32
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = trunc i64 %10 to i32
br label %17
17: ; preds = %15, %3
%18 = phi i32 [ %1, %3 ], [ %16, %15 ]
ret i32 %18
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_multprec_Laurent_size_limit(int k, int *szl) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(607, &k, szl, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_multprec_Laurent_size_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x25f,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_multprec_Laurent_size_limit>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x25f,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_multprec_Laurent_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc(i32 607, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_multprec_Laurent_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 607, i32* %3, i32* %1, double* undef)
ret i32 %4
}
int get_es(void) {
  int r;
  asm volatile("mov %%es, %0" : "=r"(r));
  return r;
}


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

x86 assembly (clang, -O2):
<get_es>:
mov    %es,%eax
ret

LLVM IR (-O0):
define i32 @get_es() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov %es, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_es() {
%1 = tail call i32 asm sideeffect "mov %es, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ init_declarator();
int yyselect();
init_declarator_list() {
  switch (yyselect()) {
  case 23: {
    switch (yyselect()) {
    case 115: {
      init_declarator_list();
      get_lexval();
    } break;
    default:;
    }
    init_declarator();
  } break;
  }
}


x86 assembly (clang, -O0):
<init_declarator_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x17,%eax
jne    118f <init_declarator_list+0x4f>
jmp    115d <init_declarator_list+0x1d>
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x73,%eax
jne    1183 <init_declarator_list+0x43>
jmp    1172 <init_declarator_list+0x32>
call   1030 <init_declarator_list@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
jmp    1188 <init_declarator_list+0x48>
jmp    1188 <init_declarator_list+0x48>
mov    $0x0,%al
call   1060 <init_declarator@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_declarator_list>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x17,%eax
jne    116c <init_declarator_list+0x2c>
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x73,%eax
jne    1165 <init_declarator_list+0x25>
call   1030 <init_declarator_list@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
xor    %eax,%eax
call   1060 <init_declarator@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @init_declarator_list() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %11 [
i32 23, label %3
]
3: ; preds = %0
%4 = call i32 (...) @yyselect()
switch i32 %4, label %8 [
i32 115, label %5
]
5: ; preds = %3
%6 = call i32 @init_declarator_list()
%7 = call i32 (...) @get_lexval()
br label %9
8: ; preds = %3
br label %9
9: ; preds = %8, %5
%10 = call i32 (...) @init_declarator()
br label %11
11: ; preds = %0, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @init_declarator_list() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 23
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i32 (...) @yyselect()
%5 = icmp eq i32 %4, 115
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @init_declarator_list()
%8 = tail call i32 (...) @get_lexval()
br label %9
9: ; preds = %3, %6
%10 = tail call i32 (...) @init_declarator()
br label %11
11: ; preds = %0, %9
ret i32 undef
}
void set_tmrin_line(int irqline, int state) {}


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

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

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

LLVM IR (-O2):
define void @set_tmrin_line(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void DESReset(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000034))) |= 0x00000002;
  while (((*((volatile unsigned long *)(ui32Base + 0x00000038))) &
          0x00000001) == 0) {
  }
}


x86 assembly (clang, -O0):
<DESReset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x34(%rax)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1133 <DESReset+0x33>
jmp    1118 <DESReset+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESReset>:
orq    $0x2,0x34(%rdi)
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,0x38(%rdi)
je     1110 <DESReset+0x10>
ret

LLVM IR (-O0):
define void @DESReset(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 52
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2
store volatile i64 %7, i64* %5
br label %8
8: ; preds = %15, %1
%9 = load i64, i64* %2
%10 = add nsw i64 %9, 56
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %8
16: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @DESReset(i64 %0) {
%2 = add nsw i64 %0, 52
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 2
store volatile i64 %5, i64* %3
%6 = add nsw i64 %0, 56
%7 = inttoptr i64 %6 to i64*
br label %8
8: ; preds = %8, %1
%9 = load volatile i64, i64* %7
%10 = and i64 %9, 1
%11 = icmp eq i64 %10, 0
br i1 %11, label %8, label %12
12: ; preds = %8
ret void
}
/* Variables and functions */
int waitpid(int, int *, int /*<<< orphan*/);
int wait_all_children(void) {
  int status;
  return waitpid(-1, &status, 0);
}


x86 assembly (clang, -O0):
<wait_all_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
lea    -0x4(%rbp),%rsi
xor    %edx,%edx
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_all_children>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
call   1030 <waitpid@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wait_all_children() {
%1 = alloca i32
%2 = call i32 @waitpid(i32 -1, i32* %1, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @wait_all_children() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @waitpid(i32 -1, i32* %1, i32 0)
ret i32 %3
}
unsigned char f16(unsigned char x, unsigned long int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f16(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f16(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Variables and functions */
float r_dim(float *, float *);
float intr_wrap_162(float p1, float p2) { return r_dim(&p1, &p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_162>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <r_dim@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @intr_wrap_162(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float @r_dim(float* %3, float* %4)
ret float %5
}

LLVM IR (-O2):
define float @intr_wrap_162(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float @r_dim(float* %3, float* %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ terminal_delete_char();
void delete_char() { terminal_delete_char(); }


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

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

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

LLVM IR (-O2):
define void @delete_char() {
%1 = tail call i32 (...) @terminal_delete_char()
ret void
}
__attribute__((__target__("sse4.2,popcnt"))) void
__sanitizer_cov_trace_cmpf(float Arg1 __attribute__((unused)),
                           float Arg2 __attribute__((unused))) {}


x86 assembly (clang, -O0):
<__sanitizer_cov_trace_cmpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__sanitizer_cov_trace_cmpf(float %0, float %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x3f() {
  Assert_real((isupper(63) == 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_isupper.c",
              320, ("isupper should be 0 for ?"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x140,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for ?\00"
define void @t_isupper_0x3f() {
%1 = call i64 @isupper(i32 63)
%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 320, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for ?\00"
define void @t_isupper_0x3f() {
%1 = tail call i64 @isupper(i32 63)
%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 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void function(int *(*(*x)[10])[20]) {
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @function([10 x [20 x i32*]*]* %0) {
%2 = alloca [10 x [20 x i32*]*]*
store [10 x [20 x i32*]*]* %0, [10 x [20 x i32*]*]** %2
ret void
}

LLVM IR (-O2):
define void @function([10 x [20 x i32*]*]* nocapture %0) {
ret void
}
void R_BackendShutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @R_BackendShutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void session_signal_handler(int signo) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<session_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<session_signal_handler>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @session_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @session_signal_handler(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void _exit(int status) { exit(status); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ getDiscardedElementsLock();
int /*<<< orphan*/ obtainExclusiveLock(int /*<<< orphan*/);
void lockDiscardedElements(void) {
  obtainExclusiveLock(getDiscardedElementsLock());
}


x86 assembly (clang, -O0):
<lockDiscardedElements>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getDiscardedElementsLock@plt>
mov    %eax,%edi
call   1030 <obtainExclusiveLock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockDiscardedElements>:
push   %rax
xor    %eax,%eax
call   1040 <getDiscardedElementsLock@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <obtainExclusiveLock@plt>

LLVM IR (-O0):
define void @lockDiscardedElements() {
%1 = call i32 (...) @getDiscardedElementsLock()
%2 = call i32 @obtainExclusiveLock(i32 %1)
ret void
}

LLVM IR (-O2):
define void @lockDiscardedElements() {
%1 = tail call i32 (...) @getDiscardedElementsLock()
%2 = tail call i32 @obtainExclusiveLock(i32 %1)
ret void
}
/* Variables and functions */
int random();
int randnib(void) { return (random() >> 16) & 15; }


x86 assembly (clang, -O0):
<randnib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
sar    $0x10,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randnib>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
shr    $0x10,%eax
and    $0xf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randnib() {
%1 = call i32 (...) @random()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 15
ret i32 %3
}

LLVM IR (-O2):
define i32 @randnib() {
%1 = tail call i32 (...) @random()
%2 = lshr i32 %1, 16
%3 = and i32 %2, 15
ret i32 %3
}
void intel_display_crc_init(struct drm_i915_private *dev_priv) {}


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

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

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

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @intel_display_crc_init(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, void *, int, int, struct timespec *, void *,
            int);
int sys_futex_ticket(void *addr1, int op, int val1, struct timespec *timeout,
                     void *addr2, int val3) {
  return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
}


x86 assembly (clang, -O0):
<sys_futex_ticket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_futex_ticket>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @sys_futex_ticket(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i8* %14, i32 %15, i32 %16, %struct.timespec* %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @sys_futex_ticket(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5)
ret i32 %8
}
/* Type definitions */
struct btf_var {
  int dummy;
};
struct btf_type {
  int dummy;
};

/* Variables and functions */
struct btf_var *btf_var(const struct btf_type *t) {
  return (struct btf_var *)(t + 1);
}


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

x86 assembly (clang, -O2):
<btf_var>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
%struct.btf_var = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_var* @btf_var(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to %struct.btf_var*
ret %struct.btf_var* %5
}

LLVM IR (-O2):
%struct.btf_var = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_var* @btf_var(%struct.btf_type* readnone %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1
%3 = bitcast %struct.btf_type* %2 to %struct.btf_var*
ret %struct.btf_var* %3
}
/* Variables and functions */
int /*<<< orphan*/ digitToHex(unsigned char);
int /*<<< orphan*/ serPutch(int /*<<< orphan*/);
void klogHexByte(unsigned char byte) {
  serPutch(digitToHex((byte & 0xF0) >> 4));
  serPutch(digitToHex(byte & 0xF));
}


x86 assembly (clang, -O0):
<klogHexByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <serPutch@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <serPutch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<klogHexByte>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <serPutch@plt>
and    $0xf,%ebx
mov    %ebx,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <serPutch@plt>

LLVM IR (-O0):
define void @klogHexByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 240
%6 = ashr i32 %5, 4
%7 = trunc i32 %6 to i8
%8 = call i32 @digitToHex(i8 zeroext %7)
%9 = call i32 @serPutch(i32 %8)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = trunc i32 %12 to i8
%14 = call i32 @digitToHex(i8 zeroext %13)
%15 = call i32 @serPutch(i32 %14)
ret void
}

LLVM IR (-O2):
define void @klogHexByte(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @digitToHex(i8 zeroext %2)
%4 = tail call i32 @serPutch(i32 %3)
%5 = and i8 %0, 15
%6 = tail call i32 @digitToHex(i8 zeroext %5)
%7 = tail call i32 @serPutch(i32 %6)
ret void
}
int jsY_ishex(int c) {
  return (c >= '0' && c <= '9') ||
         ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<jsY_ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <jsY_ishex+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115e <jsY_ishex+0x5e>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <jsY_ishex+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    1158 <jsY_ishex+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x7(%rbp)
jl     1152 <jsY_ishex+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsY_ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @jsY_ishex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %24, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11
%23 = phi i1 [ true, %11 ], [ %21, %20 ]
br label %24
24: ; preds = %22, %5
%25 = phi i1 [ true, %5 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @jsY_ishex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
double S(double phi) { return 1.0; }


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

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

LLVM IR (-O0):
define double @S(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @S(double %0) {
ret double 1.000000e+00
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int write_lockbits_49lfxxxc(struct flashctx *, int /*<<< orphan*/);
int unlock_49lfxxxc(struct flashctx *flash) {
  return write_lockbits_49lfxxxc(flash, 0);
}


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

x86 assembly (clang, -O2):
<unlock_49lfxxxc>:
xor    %esi,%esi
jmp    1030 <write_lockbits_49lfxxxc@plt>

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

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @unlock_49lfxxxc(%struct.flashctx* %0) {
%2 = tail call i32 @write_lockbits_49lfxxxc(%struct.flashctx* %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};
struct ipaddr_str {
  int dummy;
};

/* Variables and functions */
char const *ip4_to_string(struct ipaddr_str *const, int /*<<< orphan*/);
__attribute__((always_)) const char *
sockaddr4_to_string(struct ipaddr_str *const buf,
                    const struct sockaddr *const addr) {
  const struct sockaddr_in *const addr4 = (const struct sockaddr_in *)addr;
  return ip4_to_string(buf, addr4->sin_addr);
}


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

x86 assembly (clang, -O2):
<sockaddr4_to_string>:
mov    (%rsi),%esi
jmp    1030 <ip4_to_string@plt>

LLVM IR (-O0):
%struct.ipaddr_str = type { i32 }
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { i32 }
define i8* @sockaddr4_to_string(%struct.ipaddr_str* %0, %struct.sockaddr* %1) {
%3 = alloca %struct.ipaddr_str*
%4 = alloca %struct.sockaddr*
%5 = alloca %struct.sockaddr_in*
store %struct.ipaddr_str* %0, %struct.ipaddr_str** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%6 = load %struct.sockaddr*, %struct.sockaddr** %4
%7 = bitcast %struct.sockaddr* %6 to %struct.sockaddr_in*
store %struct.sockaddr_in* %7, %struct.sockaddr_in** %5
%8 = load %struct.ipaddr_str*, %struct.ipaddr_str** %3
%9 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i8* @ip4_to_string(%struct.ipaddr_str* %8, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
%struct.ipaddr_str = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @sockaddr4_to_string(%struct.ipaddr_str* %0, %struct.sockaddr* nocapture %1) {
%3 = getelementptr %struct.sockaddr, %struct.sockaddr* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i8* @ip4_to_string(%struct.ipaddr_str* %0, i32 %4)
ret i8* %5
}
/* Variables and functions */
int M_RandomInt(int, int);
int M_RandomIntNoRepeat(int lower, int upper, int previous) {
  int randomint = previous;
  while (randomint == previous)
    randomint = M_RandomInt(lower, upper);
  return randomint;
}


x86 assembly (clang, -O0):
<M_RandomIntNoRepeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1146 <M_RandomIntNoRepeat+0x36>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <M_RandomInt@plt>
mov    %eax,-0x10(%rbp)
jmp    1127 <M_RandomIntNoRepeat+0x17>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_RandomIntNoRepeat>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <M_RandomInt@plt>
cmp    %r14d,%eax
je     1120 <M_RandomIntNoRepeat+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @M_RandomIntNoRepeat(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %4
%5 = tail call i32 @M_RandomInt(i32 %0, i32 %1)
%6 = icmp eq i32 %5, %2
br i1 %6, label %4, label %7
7: ; preds = %4
ret i32 %5
}
/* Variables and functions */
char file_NativeSlash();
int file_IsDirectorySeparator(char c) {
  if (file_NativeSlash() == c) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_IsDirectorySeparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1030 <file_NativeSlash@plt>
movsbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1140 <file_IsDirectorySeparator+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <file_IsDirectorySeparator+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_IsDirectorySeparator>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <file_NativeSlash@plt>
xor    %ecx,%ecx
cmp    %bl,%al
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @file_IsDirectorySeparator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = call signext i8 (...) @file_NativeSlash()
%5 = sext i8 %4 to i32
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @file_IsDirectorySeparator(i8 signext %0) {
%2 = tail call signext i8 (...) @file_NativeSlash()
%3 = icmp eq i8 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
char *ascii_strlwr(char *string) {
  char *p;
  for (p = string; *p; p++)
    if (!(*p & ~0x7f) && *p >= 'A' && *p <= 'Z')
      *p |= 0x20;
  return string;
}


x86 assembly (clang, -O0):
<ascii_strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1172 <ascii_strlwr+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
jne    115c <ascii_strlwr+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     115c <ascii_strlwr+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     115c <ascii_strlwr+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
jmp    1161 <ascii_strlwr+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ascii_strlwr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_strlwr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ascii_strlwr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <ascii_strlwr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <ascii_strlwr+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <ascii_strlwr+0x10>
or     $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <ascii_strlwr+0x10>
ret

LLVM IR (-O0):
define i8* @ascii_strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %32, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %35
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, -128
%14 = icmp ne i32 %13, 0
br i1 %14, label %31, label %15
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %31
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %31
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = or i32 %28, 32
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
br label %31
31: ; preds = %25, %20, %15, %9
br label %32
32: ; preds = %31
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %3
br label %5
35: ; preds = %5
%36 = load i8*, i8** %2
ret i8* %36
}

LLVM IR (-O2):
define i8* @ascii_strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = or i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
void ata_acpi_associate_sata_port(struct ata_port *ap) {}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_acpi_associate_sata_port(%struct.ata_port* nocapture %0) {
ret void
}
void rop3_66_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ *D;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_66_0_0>:
mov    (%rdi),%al
xor    %al,%sil
xor    %al,%dl
and    %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_66_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = xor i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %7
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_66_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %4, %2
%7 = and i8 %5, %6
store i8 %7, i8* %0
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long tv_usec;
};

/* Variables and functions */
long time_interval(struct timeval *a, struct timeval *b) {
  return ((b->tv_sec - a->tv_sec) * 1000000) + (b->tv_usec - a->tv_usec);
}


x86 assembly (clang, -O0):
<time_interval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x8(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_interval>:
movslq (%rsi),%rax
movslq (%rdi),%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rcx
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @time_interval(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = sext i32 %12 to i64
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = add nsw i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @time_interval(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add nsw i64 %14, %9
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ bi_input(char *);
int bitcount(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char a[20];
  int num = 0;
  printf("please input the number:");
  scanf("%s", a);
  num = bitcount(bi_input(a));
  printf("the number of 1 is: %d\n", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x24(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <bi_input@plt>
mov    %eax,%edi
call   1050 <bitcount@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <bi_input@plt>
mov    %eax,%edi
call   1050 <bitcount@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"please input the number:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [24 x i8] c"the number of 1 is: %d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = call i32 @bi_input(i8* %6)
%8 = call i32 @bitcount(i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"please input the number:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [24 x i8] c"the number of 1 is: %d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @bi_input(i8* %2)
%6 = call i32 @bitcount(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}