xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ mem_copy_vect2qword_little(int /*<<< orphan*/ *,
                                              unsigned char const *);
uint64_t arch_mem_copy_vect2qword_little(uint64_t *qword,
                                         const unsigned char *v) {
  return mem_copy_vect2qword_little(qword, v);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_vect2qword_little>:
jmp    1030 <mem_copy_vect2qword_little@plt>

LLVM IR (-O0):
define i32 @arch_mem_copy_vect2qword_little(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @mem_copy_vect2qword_little(i32* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @arch_mem_copy_vect2qword_little(i32* %0, i8* %1) {
%3 = tail call i32 @mem_copy_vect2qword_little(i32* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int result = (getchar() != EOF);
  switch (result) {
  case 0: {
    printf("es 0!!!");
  } break;
  case 1: {
    printf("es 1!!!");
  } break;
  default: {
    printf("no es ninguno de los dos!!!");
  }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
setne  %al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1170 <main+0x50>
jmp    115f <main+0x3f>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1181 <main+0x61>
jmp    1192 <main+0x72>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
lea    0xec7(%rip),%rax
lea    0xec8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [8 x i8] c"es 0!!!\00"
@.str.1 = [8 x i8] c"es 1!!!\00"
@.str.2 = [28 x i8] c"no es ninguno de los dos!!!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
switch i32 %7, label %12 [
i32 0, label %8
i32 1, label %10
]
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %14
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [8 x i8] c"es 0!!!\00"
@.str.1 = [8 x i8] c"es 1!!!\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t entry2index(void *p) { return ((int32_t)((uintptr_t)p)) >> 2; }


x86 assembly (clang, -O0):
<entry2index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry2index>:
mov    %rdi,%rax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @entry2index(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = ashr i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @entry2index(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RESHLm(int);
void RES5HLm() { RESHLm(0x20); }


x86 assembly (clang, -O0):
<RES5HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <RESHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RES5HLm>:
mov    $0x20,%edi
jmp    1030 <RESHLm@plt>

LLVM IR (-O0):
define void @RES5HLm() {
%1 = call i32 @RESHLm(i32 32)
ret void
}

LLVM IR (-O2):
define void @RES5HLm() {
%1 = tail call i32 @RESHLm(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(void *);
void vis5d_mem_free(void *ptr) {
  mem_free(ptr);
  return;
}


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

x86 assembly (clang, -O2):
<vis5d_mem_free>:
jmp    1030 <mem_free@plt>

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

LLVM IR (-O2):
define void @vis5d_mem_free(i8* %0) {
%2 = tail call i32 @mem_free(i8* %0)
ret void
}
void gtk_table_get_col_spacing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_table_get_col_spacing() {
ret void
}
int f(int a, int b, int c) {
  if (a == 0)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1122 <f+0x22>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <f+0x28>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
test   %edi,%edi
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @f(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, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
store i32 %11, i32* %4
br label %14
12: ; preds = %3
%13 = load i32, i32* %7
store i32 %13, i32* %4
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %1, i32 %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int fatal(const char *msg) {
  fputs(msg, stderr);
  exit(EXIT_FAILURE);
  return 0;
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ newFct2(char *, int);
void newFct1(char *S) { newFct2(S, 1); }


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

x86 assembly (clang, -O2):
<newFct1>:
mov    $0x1,%esi
jmp    1030 <newFct2@plt>

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

LLVM IR (-O2):
define void @newFct1(i8* %0) {
%2 = tail call i32 @newFct2(i8* %0, i32 1)
ret void
}
/* Variables and functions */
double DBL_MAX;
double hugedbl_(double *x) { return DBL_MAX; }


x86 assembly (clang, -O0):
<hugedbl_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hugedbl_>:
mov    0x2ed9(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
define double @hugedbl_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double, double* @DBL_MAX
ret double %3
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
define double @hugedbl_(double* nocapture readnone %0) {
%2 = load double, double* @DBL_MAX
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int int16_t;

/* Variables and functions */
uint16_t normalize_i6S(int16_t value, int16_t adjustingValue) {
  return (uint16_t)(((adjustingValue * value) / 32767) + 1500);
}


x86 assembly (clang, -O0):
<normalize_i6S>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x7fff,%ecx
cltd
idiv   %ecx
add    $0x5dc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_i6S>:
imul   %esi,%edi
movslq %edi,%rax
imul   $0xffffffff80010003,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
sar    $0xe,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x5dc,%eax
ret

LLVM IR (-O0):
define i32 @normalize_i6S(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = sdiv i32 %7, 32767
%9 = add nsw i32 %8, 1500
ret i32 %9
}

LLVM IR (-O2):
define i32 @normalize_i6S(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sdiv i32 %3, 32767
%5 = add nsw i32 %4, 1500
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x1e() {
  Assert_real((iscntrl(30)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              155, ("iscntrl should be 1 for 0x1e"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1e\00"
define void @t_iscntrl_0x1e() {
%1 = tail call i32 @iscntrl(i32 30)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct strm_queue_task {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ task_push(int, struct strm_queue_task *);
void strm_task_push(struct strm_queue_task *t) { task_push(-1, t); }


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

x86 assembly (clang, -O2):
<strm_task_push>:
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <task_push@plt>

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

LLVM IR (-O2):
%struct.strm_queue_task = type { i32 }
define void @strm_task_push(%struct.strm_queue_task* %0) {
%2 = tail call i32 @task_push(i32 -1, %struct.strm_queue_task* %0)
ret void
}
/* Type definitions */
struct bnx2x {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bnx2x_stats_comp(struct bnx2x *);
int /*<<< orphan*/ bnx2x_stats_start(struct bnx2x *);
void bnx2x_stats_restart(struct bnx2x *bp) {
  bnx2x_stats_comp(bp);
  bnx2x_stats_start(bp);
}


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

x86 assembly (clang, -O2):
<bnx2x_stats_restart>:
push   %rbx
mov    %rdi,%rbx
call   1040 <bnx2x_stats_comp@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bnx2x_stats_start@plt>

LLVM IR (-O0):
%struct.bnx2x = type { i32 }
define void @bnx2x_stats_restart(%struct.bnx2x* %0) {
%2 = alloca %struct.bnx2x*
store %struct.bnx2x* %0, %struct.bnx2x** %2
%3 = load %struct.bnx2x*, %struct.bnx2x** %2
%4 = call i32 @bnx2x_stats_comp(%struct.bnx2x* %3)
%5 = load %struct.bnx2x*, %struct.bnx2x** %2
%6 = call i32 @bnx2x_stats_start(%struct.bnx2x* %5)
ret void
}

LLVM IR (-O2):
%struct.bnx2x = type { i32 }
define void @bnx2x_stats_restart(%struct.bnx2x* %0) {
%2 = tail call i32 @bnx2x_stats_comp(%struct.bnx2x* %0)
%3 = tail call i32 @bnx2x_stats_start(%struct.bnx2x* %0)
ret void
}
unsigned char SHT1x_Mirrorbyte(unsigned char value) {
  unsigned char ret = 0, i;
  for (i = 0x80; i; i >>= 1) {
    if (value & 0x01)
      ret |= i;
    value >>= 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<SHT1x_Mirrorbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movb   $0x80,-0x3(%rbp)
cmpb   $0x0,-0x3(%rbp)
je     1152 <SHT1x_Mirrorbyte+0x52>
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1139 <SHT1x_Mirrorbyte+0x39>
movzbl -0x3(%rbp),%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x3(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x3(%rbp)
jmp    1112 <SHT1x_Mirrorbyte+0x12>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHT1x_Mirrorbyte>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @SHT1x_Mirrorbyte(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
store i8 -128, i8* %4
br label %5
5: ; preds = %25, %1
%6 = load i8, i8* %4
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %30
8: ; preds = %5
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = or i32 %17, %15
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
br label %20
20: ; preds = %13, %8
%21 = load i8, i8* %2
%22 = zext i8 %21 to i32
%23 = ashr i32 %22, 1
%24 = trunc i32 %23 to i8
store i8 %24, i8* %2
br label %25
25: ; preds = %20
%26 = load i8, i8* %4
%27 = zext i8 %26 to i32
%28 = ashr i32 %27, 1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %4
br label %5
30: ; preds = %5
%31 = load i8, i8* %3
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @SHT1x_Mirrorbyte(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ bckH_deleteAll();
int /*<<< orphan*/ gen_deleteAll();
int /*<<< orphan*/ part_deleteAll();
int /*<<< orphan*/ sim_deselect();
void sim_clean() {
  sim_deselect();
  part_deleteAll();
  gen_deleteAll();
  bckH_deleteAll();
}


x86 assembly (clang, -O0):
<sim_clean>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <sim_deselect@plt>
mov    $0x0,%al
call   1050 <part_deleteAll@plt>
mov    $0x0,%al
call   1040 <gen_deleteAll@plt>
mov    $0x0,%al
call   1030 <bckH_deleteAll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_clean>:
push   %rax
xor    %eax,%eax
call   1060 <sim_deselect@plt>
xor    %eax,%eax
call   1050 <part_deleteAll@plt>
xor    %eax,%eax
call   1040 <gen_deleteAll@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bckH_deleteAll@plt>

LLVM IR (-O0):
define void @sim_clean() {
%1 = call i32 (...) @sim_deselect()
%2 = call i32 (...) @part_deleteAll()
%3 = call i32 (...) @gen_deleteAll()
%4 = call i32 (...) @bckH_deleteAll()
ret void
}

LLVM IR (-O2):
define void @sim_clean() {
%1 = tail call i32 (...) @sim_deselect()
%2 = tail call i32 (...) @part_deleteAll()
%3 = tail call i32 (...) @gen_deleteAll()
%4 = tail call i32 (...) @bckH_deleteAll()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void local_mcu_Cpu_cycle__E() {
  printf("Cpu.cycle\n");
  usleep(1);
}


x86 assembly (clang, -O0):
<local_mcu_Cpu_cycle__E>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_mcu_Cpu_cycle__E>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Cpu.cycle\0A\00"
define void @local_mcu_Cpu_cycle__E() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"Cpu.cycle\00"
define void @local_mcu_Cpu_cycle__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @usleep(i32 1)
ret void
}
int test_imm_48uint8_reg(unsigned char val) {
  return ((val) & (-0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffb8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_48uint8_reg(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, -72
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_48uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -72
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int j = 18;
  for (int j = 6; j < 10; ++j)
    ;
  printf("j"
         " = %d\n",
         (j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114a <main+0x3a>
jmp    113c <main+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x12,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"j = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 18)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pause_t() {
  printf("Enter a character to continue:");
  getchar();
  getchar();
}


x86 assembly (clang, -O0):
<pause_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause_t>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Enter a character to continue:\00"
define void @pause_t() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
%3 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Enter a character to continue:\00"
define void @pause_t() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void err_exit(int n) {
  printf("SSTL_client error %d\n", n);
  exit(n);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"SSTL_client error %d\0A\00"
define void @err_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"SSTL_client error %d\0A\00"
define void @err_exit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void makecond(int sz) {
  if (sz > 2)
    output(" a|x A2; a|x A3;");
  if (sz > 1)
    output(" a|x A1;");
  else
    output(" a|c 0;");
}


x86 assembly (clang, -O0):
<makecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    1131 <makecond+0x21>
lea    0xed4(%rip),%rdi
call   1030 <output@plt>
cmpl   $0x1,-0x4(%rbp)
jle    114c <makecond+0x3c>
lea    0xecf(%rip),%rdi
call   1030 <output@plt>
jmp    1158 <makecond+0x48>
lea    0xec7(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makecond>:
cmp    $0x3,%edi
jl     1132 <makecond+0x22>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <output@plt>
lea    0xee8(%rip),%rdi
add    $0x8,%rsp
jmp    1030 <output@plt>
cmp    $0x2,%edi
lea    0xed5(%rip),%rax
lea    0xed7(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <output@plt>

LLVM IR (-O0):
@.str = [17 x i8] c" a|x A2; a|x A3;\00"
@.str.1 = [9 x i8] c" a|x A1;\00"
@.str.2 = [8 x i8] c" a|c 0;\00"
define void @makecond(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @output(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @output(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = call i32 @output(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c" a|x A2; a|x A3;\00"
@.str.1 = [9 x i8] c" a|x A1;\00"
@.str.2 = [8 x i8] c" a|c 0;\00"
define void @makecond(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @output(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %1
%6 = icmp eq i32 %0, 2
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %3 ], [ %7, %5 ]
%10 = tail call i32 @output(i8* %9)
ret void
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", fun(n));
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fun(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
%8 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *erealloc(void *o, size_t s) {
  o = realloc(o, s);
  if (!o) {
    fprintf(stderr, "Memory allocation failed!\n");
    exit(EXIT_FAILURE);
  } else {
    return o;
  }
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117f <erealloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <erealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Memory allocation failed!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @erealloc(i8* %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 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Memory allocation failed!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EMFILE;
int /*<<< orphan*/ errno;
int pipe(int filedes[2]) {
  (void)filedes;
  errno = EMFILE;
  return -1;
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EMFILE = global i32 0
@errno = global i32 0
define i32 @pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @EMFILE
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMFILE = global i32 0
@errno = global i32 0
define i32 @pipe(i32* nocapture readnone %0) {
%2 = load i32, i32* @EMFILE
store i32 %2, i32* @errno
ret i32 -1
}
int strcmp(const char *s1, const char *s2) {
  int r;
  while ((r = (*s1 - *s2)) == 0 && *s1) {
    s1++;
    s2++;
  }
  return r;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    113d <strcmp+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114d <strcmp+0x4d>
jmp    116a <strcmp+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
movsbl (%rdi),%ecx
movsbl (%rsi),%edx
mov    %ecx,%eax
sub    %edx,%eax
jne    1138 <strcmp+0x38>
test   %cl,%cl
je     1138 <strcmp+0x38>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rdi,%rcx,1),%edx
movsbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1138 <strcmp+0x38>
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcmp+0x20>
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %22, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %9, %12
store i32 %13, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %6
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %15, %6
%21 = phi i1 [ false, %6 ], [ %19, %15 ]
br i1 %21, label %22, label %27
22: ; preds = %20
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
br label %6
27: ; preds = %20
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
%8 = icmp ne i32 %7, 0
%9 = icmp eq i8 %3, 0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %24, label %11
11: ; preds = %2, %11
%12 = phi i8* [ %14, %11 ], [ %0, %2 ]
%13 = phi i8* [ %15, %11 ], [ %1, %2 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = load i8, i8* %15
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = icmp eq i8 %16, 0
%23 = select i1 %21, i1 true, i1 %22
br i1 %23, label %24, label %11
24: ; preds = %11, %2
%25 = phi i32 [ %7, %2 ], [ %20, %11 ]
ret i32 %25
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
void test_b() {
  int i = 256;
  while (1) {
    milli_delay(10);
  }
}


x86 assembly (clang, -O0):
<test_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x100,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    111f <test_b+0xf>

x86 assembly (clang, -O2):
<test_b>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    1120 <test_b+0x10>

LLVM IR (-O0):
define void @test_b() {
%1 = alloca i32
store i32 256, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @milli_delay(i32 10)
br label %2
}

LLVM IR (-O2):
define void @test_b() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @milli_delay(i32 10)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ complain(char *);
scalar_t__ numa_available();
void checknuma(void) {
  static int numa = -1;
  if (numa < 0) {
    if (numa_available() < 0)
      complain("This system does not support NUMA policy");
  }
  numa = 0;
}


x86 assembly (clang, -O0):
<checknuma>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f05(%rip)
jge    1153 <checknuma+0x33>
mov    $0x0,%al
call   1030 <numa_available@plt>
cmp    $0x0,%rax
jge    114e <checknuma+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <complain@plt>
jmp    1153 <checknuma+0x33>
movl   $0x0,0x2ed3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknuma>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
jne    1142 <checknuma+0x22>
xor    %eax,%eax
call   1030 <numa_available@plt>
test   %rax,%rax
jns    1142 <checknuma+0x22>
lea    0xec3(%rip),%rdi
call   1040 <complain@plt>
movb   $0x1,0x2eeb(%rip)
pop    %rax
ret

LLVM IR (-O0):
@checknuma.numa = internal global i32 -1
@.str = [41 x i8] c"This system does not support NUMA policy\00"
define void @checknuma() {
%1 = load i32, i32* @checknuma.numa
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 (...) @numa_available()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @complain(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
br label %9
9: ; preds = %8, %0
store i32 0, i32* @checknuma.numa
ret void
}

LLVM IR (-O2):
@checknuma.numa = internal unnamed_addr global i1 false
@.str = [41 x i8] c"This system does not support NUMA policy\00"
define void @checknuma() {
%1 = load i1, i1* @checknuma.numa
br i1 %1, label %7, label %2
2: ; preds = %0
%3 = tail call i64 (...) @numa_available()
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @complain(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5, %0
store i1 true, i1* @checknuma.numa
ret void
}
/* Variables and functions */
int /*<<< orphan*/ environ_prepend_path(char *);
void environ_prepend_dot_to_path(void) { environ_prepend_path("."); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @environ_prepend_dot_to_path() {
%1 = tail call i32 @environ_prepend_path(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double floor(double);
double module_libc_floor(double x) { return floor(x); }


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

x86 assembly (clang, -O2):
<module_libc_floor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @module_libc_floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @module_libc_floor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
int test_imm_8Eint32_reg(int val) { return ((val) & (0x8E << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_8Eint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_8Eint32_reg(i32 %0) {
%2 = and i32 %0, 142
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void alrm_handler(int n) { signal(SIGALRM, alrm_handler); }


x86 assembly (clang, -O0):
<alrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    0x2eb5(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alrm_handler>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rsi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @alrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGALRM
%4 = call i32 @signal(i32 %3, void (i32)* @alrm_handler)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @alrm_handler(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = tail call i32 @signal(i32 %2, void (i32)* @alrm_handler)
ret void
}
/* Variables and functions */
int tempered_type_hid_init(char **);
bool temper_type_init(char **error) { return tempered_type_hid_init(error); }


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

x86 assembly (clang, -O2):
<temper_type_init>:
jmp    1030 <tempered_type_hid_init@plt>

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

LLVM IR (-O2):
define i32 @temper_type_init(i8** %0) {
%2 = tail call i32 @tempered_type_hid_init(i8** %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x83() {
  Assert_real((isdigit(131) == 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_isdigit.c",
              660, ("isdigit should be 0 for 0x83"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x83>:
push   %rax
mov    $0x83,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x294,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x83\00"
define void @t_isdigit_0x83() {
%1 = call i64 @isdigit(i32 131)
%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 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x83\00"
define void @t_isdigit_0x83() {
%1 = tail call i64 @isdigit(i32 131)
%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 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *f();
void *g(void) { return f(); }


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

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

LLVM IR (-O0):
define i8* @g() {
%1 = call i8* (...) @f()
ret i8* %1
}

LLVM IR (-O2):
define i8* @g() {
%1 = tail call i8* (...) @f()
ret i8* %1
}
void GC_enable_incremental(void) { return; }


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

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

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

LLVM IR (-O2):
define void @GC_enable_incremental() {
ret void
}
/* Variables and functions */
bool stack_grows_down_helper(int *p) {
  int i;
  return &i < p;
}


x86 assembly (clang, -O0):
<stack_grows_down_helper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_grows_down_helper>:
lea    -0x4(%rsp),%rcx
xor    %eax,%eax
cmp    %rdi,%rcx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @stack_grows_down_helper(i32* readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp ult i32* %2, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popreal32array(char *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 32));
}


x86 assembly (clang, -O0):
<popreal32array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x5,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popreal32array>:
shl    $0x5,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popreal32array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 32
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popreal32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int ss2qrm();
int ss2qrm_() { return ss2qrm(); }


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

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

LLVM IR (-O0):
define i32 @ss2qrm_() {
%1 = call i32 (...) @ss2qrm()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ss2qrm_() {
%1 = tail call i32 (...) @ss2qrm()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int getFlashSizeKB();
uint8_t getFlashPageSizeLog2(void) { return 10 + (getFlashSizeKB() >= 256); }


x86 assembly (clang, -O0):
<getFlashPageSizeLog2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getFlashSizeKB@plt>
cmp    $0x100,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFlashPageSizeLog2>:
push   %rax
xor    %eax,%eax
call   1030 <getFlashSizeKB@plt>
xor    %ecx,%ecx
cmp    $0x100,%eax
setge  %cl
or     $0xa,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getFlashPageSizeLog2() {
%1 = call i32 (...) @getFlashSizeKB()
%2 = icmp sge i32 %1, 256
%3 = zext i1 %2 to i32
%4 = add nsw i32 10, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @getFlashPageSizeLog2() {
%1 = tail call i32 (...) @getFlashSizeKB()
%2 = icmp sgt i32 %1, 255
%3 = select i1 %2, i32 11, i32 10
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void initRand() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<initRand>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @initRand() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @initRand() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}