xunge/DecIR huggingface dataset:
void upcase(argument) register char *argument;
{
  register int c;
  while ((c = *argument) != 0) {
    if (islower(c)) {
      *argument = toupper(c);
    }
    argument++;
  }
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1171 <upcase+0x51>
mov    -0xc(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     1160 <upcase+0x40>
mov    -0xc(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <upcase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <upcase+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <upcase+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <upcase+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1140 <upcase+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <upcase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @upcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @islower(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %10, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret void
}
int movsbw_2(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movb $0x99, %%al\n\t"
                       "movsbw %%al,%%ax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movsbw_2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x99,%al
movsbw %al,%ax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsbw_2>:
mov    $0x12345678,%eax
mov    $0x99,%al
movsbw %al,%ax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movsbw_2() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x99, %al\0A\09movsbw %al,%ax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movsbw_2() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x99, %al\0A\09movsbw %al,%ax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
void gtk_action_group_add_radio_actions_full() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_add_radio_actions_full() {
ret void
}
/* Variables and functions */
long double rint(double);
long double rintl(long double x) { return rint((double)x); }


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <rint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <rint@plt>

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @rint(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @rint(double %2)
ret x86_fp80 %3
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int custom_getopt_internal(int, char *const *, char const *,
                           struct option const *, int *);
int custom_getopt_long(int argc, char *const *argv, const char *options,
                       const struct option *long_options, int *opt_index) {
  return custom_getopt_internal(argc, argv, options, long_options, opt_index);
}


x86 assembly (clang, -O0):
<custom_getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <custom_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_getopt_long>:
jmp    1030 <custom_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @custom_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @custom_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @custom_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @custom_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CAN1_RX1_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @CAN1_RX1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @CAN1_RX1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int test_imm_95int16_reg(short val) {
  return ((val) & (-0x95 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_95int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff6b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_95int16_reg>:
test   $0xff6b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_95int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -149
%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_95int16_reg(i16 signext %0) {
%2 = and i16 %0, -149
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cysetjmp(struct cyjmp_struct *env) {
  __asm__ volatile("\n"
                   "\tleaq cysetjmp%=(%%rip), %%rcx\n"
                   "\tmovq %%rsp, 0(%0)\n"
                   "\tmovq %%rbp, 8(%0)\n"
                   "\tmovq %%rcx, 16(%0)\n"
                   "cysetjmp%=:\n"
                   :
                   : "b"(env)
                   : "%rax", "%rcx", "%rdx", "%rsi", "%rdi", "%r8", "%r9",
                     "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc",
                     "memory");
  return 0;
}


x86 assembly (clang, -O0):
<cysetjmp>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,-0x30(%rbp)
mov    -0x30(%rbp),%rbx
lea    0xb(%rip),%rcx
mov    %rsp,(%rbx)
mov    %rbp,0x8(%rbx)
mov    %rcx,0x10(%rbx)

x86 assembly (clang, -O2):
<cysetjmp>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
lea    0xb(%rip),%rcx
mov    %rsp,(%rbx)
mov    %rbp,0x8(%rbx)
mov    %rcx,0x10(%rbx)

LLVM IR (-O0):
%struct.cyjmp_struct = type opaque
define i32 @cysetjmp(%struct.cyjmp_struct* %0) {
%2 = alloca %struct.cyjmp_struct*
store %struct.cyjmp_struct* %0, %struct.cyjmp_struct** %2
%3 = load %struct.cyjmp_struct*, %struct.cyjmp_struct** %2
ret i32 0
}

LLVM IR (-O2):
%struct.cyjmp_struct = type opaque
define i32 @cysetjmp(%struct.cyjmp_struct* %0) {
tail call void asm sideeffect "\0A\09leaq cysetjmp${:uid}(%rip), %rcx\0A\09movq %rsp, 0($0)\0A\09movq %rbp, 8($0)\0A\09movq %rcx, 16($0)\0Acysetjmp${:uid}:\0A", "{bx},~{rax},~{rcx},~{rdx},~{rsi},~{rdi},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.cyjmp_struct* %0)
ret i32 0
}
char to_lower_case(char letter) {
  if (letter >= 65 && letter <= 90)
    letter += 32;
  return letter;
}


x86 assembly (clang, -O0):
<to_lower_case>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112e <to_lower_case+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     112e <to_lower_case+0x2e>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower_case>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @to_lower_case(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @to_lower_case(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
long double __attribute__((no)) fcmovbe(long flags) {
  long double out;
  asm("\n"
      "	push	%1"
      "\n"
      "	popf"
      "\n"
      "	fldpi"
      "\n"
      "	fld1"
      "\n"
      "	"
      "fcmovbe"
      " %%st(1), %%st"
      "\n"
      "	ffree	%%st(1)"
      "\n"
      : "=t"(out)
      : "r"(flags));
  return out;
}


x86 assembly (clang, -O0):
<fcmovbe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
push   %rax
popf
fldpi
fld1
fcmovbe %st(1),%st
ffree  %st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmovbe>:
push   %rdi
popf
fldpi
fld1
fcmovbe %st(1),%st
ffree  %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fcmovbe(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovbe %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fcmovbe(i64 %0) {
%2 = tail call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovbe %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int strlen(char *);
void backspace(char s[]) {
  int len = strlen(s);
  s[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @backspace(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @backspace(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *dupstr(const char *str) {
  char *ret;
  ret = strdup(str);
  if (!ret)
    err(3, "Memory allocation error");
  return (ret);
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <dupstr+0x35>
mov    $0x3,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <dupstr+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x3,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Memory allocation error\00"
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @err(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"Memory allocation error\00"
define noalias i8* @dupstr(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M21_f(char *s) {
  debug("M21_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M21_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M21_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M21_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M21_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M21_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M21_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void output_header(char ch) { putc(ch, stdout); }


x86 assembly (clang, -O0):
<output_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_header>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @output_header(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* @stdout
%5 = call i32 @putc(i8 signext %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @output_header(i8 signext %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @putc(i8 signext %0, i32 %2)
ret void
}
void MD5_memset(unsigned char *output, int value, unsigned int len) {
  unsigned int i;
  for (i = 0; i < len; i++)
    ((char *)output)[i] = (char)value;
}


x86 assembly (clang, -O0):
<MD5_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    113e <MD5_memset+0x3e>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <MD5_memset+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MD5_memset>:
test   %edx,%edx
je     1120 <MD5_memset+0x10>
push   %rax
mov    %edx,%edx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @MD5_memset(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int test_fn(int a[16]) { printf("a = %p sizeof = %d\n", a, sizeof(a)); }


x86 assembly (clang, -O0):
<test_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x8,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fn>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
mov    $0x8,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"a = %p sizeof = %d\0A\00"
define i32 @test_fn(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %4, i32 8)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [20 x i8] c"a = %p sizeof = %d\0A\00"
define i32 @test_fn(i32* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %0, i32 8)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gnu_get_libc_version();
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(int argc, char *argv[]) { puts(gnu_get_libc_version()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <gnu_get_libc_version@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gnu_get_libc_version@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @gnu_get_libc_version()
%6 = call i32 @puts(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @gnu_get_libc_version()
%4 = tail call i32 @puts(i32 %3)
ret i32 0
}
dude2(n, m) int n;
int m;
{ printf("B: %d %d\n", n, m); }


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

x86 assembly (clang, -O2):
<dude2>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"B: %d %d\0A\00"
define i32 @dude2(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
void gen_convert_primary_reg_value_to_bool(void) { gen_call("_bool"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"_bool\00"
define void @gen_convert_primary_reg_value_to_bool() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
const double tiny() { return 1.0e-20; }


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

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

LLVM IR (-O0):
define double @tiny() {
ret double 0x3BC79CA10C924223
}

LLVM IR (-O2):
define double @tiny() {
ret double 0x3BC79CA10C924223
}
linkhandler0(linkid, newcost) int linkid, newcost;
{}


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

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

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

LLVM IR (-O2):
define i32 @linkhandler0(i32 %0, i32 %1) {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
short get_XFontSetExtents_max_ink_extent_y(void *_p) {
  return (short)((XFontSetExtents *)_p)->max_ink_extent.y;
}


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

x86 assembly (clang, -O2):
<get_XFontSetExtents_max_ink_extent_y>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define signext i16 @get_XFontSetExtents_max_ink_extent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
int intlen(int);
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int i;
  for (i = 1; i < 10000; i *= 10 - 1) {
    printf("%d -> %d\n", i, intlen(i));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    1167 <main+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <intlen@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
imul   $0x9,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1030 <intlen@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <intlen@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x51,%edi
call   1030 <intlen@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x2d9,%edi
call   1030 <intlen@plt>
mov    %rbx,%rdi
mov    $0x2d9,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x19a1,%edi
call   1030 <intlen@plt>
mov    %rbx,%rdi
mov    $0x19a1,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d -> %d\0A\00"
define void @main() {
%1 = tail call i32 @intlen(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 %1)
%3 = tail call i32 @intlen(i32 9)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 %3)
%5 = tail call i32 @intlen(i32 81)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 81, i32 %5)
%7 = tail call i32 @intlen(i32 729)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 729, i32 %7)
%9 = tail call i32 @intlen(i32 6561)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6561, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void str07(char *buf, const char *newBuf) {
  const char *str = "test";
  strcat(buf, "bla");
  strcat(buf, str);
  strcat(buf, newBuf);
  strcpy(buf, newBuf);
}


x86 assembly (clang, -O0):
<str07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str07>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed4(%rip),%rsi
call   1040 <strcat@plt>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [4 x i8] c"bla\00"
define void @str07(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %3
%7 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [4 x i8] c"bla\00"
define void @str07(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %0, i8* %1)
%6 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct stat {
  int st_mtime;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int wrapc_filemtime(int f) {
  struct stat s;
  if (fstat(f, (struct stat *)&s) == 0)
    return s.st_mtime;
  else
    return -1;
}


x86 assembly (clang, -O0):
<wrapc_filemtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%rax
jne    113c <wrapc_filemtime+0x2c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <wrapc_filemtime+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapc_filemtime>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @wrapc_filemtime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @wrapc_filemtime(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_general();
int /*<<< orphan*/ test_lengthStack();
int /*<<< orphan*/ test_peekStack();
int /*<<< orphan*/ test_popStack();
int /*<<< orphan*/ test_resetStack();
int /*<<< orphan*/ test_voidStack();
int main(int argc, char *argv[]) {
  test_voidStack();
  test_resetStack();
  test_peekStack();
  test_popStack();
  test_lengthStack();
  test_general();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_voidStack@plt>
mov    $0x0,%al
call   1040 <test_resetStack@plt>
mov    $0x0,%al
call   1050 <test_peekStack@plt>
mov    $0x0,%al
call   1080 <test_popStack@plt>
mov    $0x0,%al
call   1060 <test_lengthStack@plt>
mov    $0x0,%al
call   1070 <test_general@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_voidStack@plt>
xor    %eax,%eax
call   1040 <test_resetStack@plt>
xor    %eax,%eax
call   1050 <test_peekStack@plt>
xor    %eax,%eax
call   1080 <test_popStack@plt>
xor    %eax,%eax
call   1060 <test_lengthStack@plt>
xor    %eax,%eax
call   1070 <test_general@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_voidStack()
%7 = call i32 (...) @test_resetStack()
%8 = call i32 (...) @test_peekStack()
%9 = call i32 (...) @test_popStack()
%10 = call i32 (...) @test_lengthStack()
%11 = call i32 (...) @test_general()
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_voidStack()
%4 = tail call i32 (...) @test_resetStack()
%5 = tail call i32 (...) @test_peekStack()
%6 = tail call i32 (...) @test_popStack()
%7 = tail call i32 (...) @test_lengthStack()
%8 = tail call i32 (...) @test_general()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
char *strcpy(char *dst, const char *src) {
  char *p = dst;
  while ((*p++ = *src++) != 0)
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int f(int a) {
  switch (a & 1) {
  case 0:
  case 1:
    return 3;
  case 2:
    return 5;
  case 3:
    return 7;
  case 4:
    return 11;
  case 5:
    return 13;
  case 6:
    return 17;
  case 7:
    return 19;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%eax
ja     117d <f+0x7d>
mov    -0x10(%rbp),%rax
lea    0xedb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    117d <f+0x7d>
movl   $0x5,-0x4(%rbp)
jmp    117d <f+0x7d>
movl   $0x7,-0x4(%rbp)
jmp    117d <f+0x7d>
movl   $0xb,-0x4(%rbp)
jmp    117d <f+0x7d>
movl   $0xd,-0x4(%rbp)
jmp    117d <f+0x7d>
movl   $0x11,-0x4(%rbp)
jmp    117d <f+0x7d>
movl   $0x13,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 1
switch i32 %5, label %13 [
i32 0, label %6
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
]
6: ; preds = %1, %1
store i32 3, i32* %2
br label %13
7: ; preds = %1
store i32 5, i32* %2
br label %13
8: ; preds = %1
store i32 7, i32* %2
br label %13
9: ; preds = %1
store i32 11, i32* %2
br label %13
10: ; preds = %1
store i32 13, i32* %2
br label %13
11: ; preds = %1
store i32 17, i32* %2
br label %13
12: ; preds = %1
store i32 19, i32* %2
br label %13
13: ; preds = %6, %7, %8, %9, %10, %11, %12, %1
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ have_a_very_merry_interrupt();
int main() {
  foo();
  have_a_very_merry_interrupt();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <have_a_very_merry_interrupt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @have_a_very_merry_interrupt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @have_a_very_merry_interrupt()
ret i32 0
}
/* Variables and functions */
scalar_t__ NewPtrClear(int);
unsigned char *gNewPtrClear(int size) {
  unsigned char *p = (unsigned char *)NewPtrClear(size + 8);
  return p;
}


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

x86 assembly (clang, -O2):
<gNewPtrClear>:
add    $0x8,%edi
jmp    1030 <NewPtrClear@plt>

LLVM IR (-O0):
define i8* @gNewPtrClear(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 8
%6 = call i64 @NewPtrClear(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @gNewPtrClear(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = tail call i64 @NewPtrClear(i32 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x6b() {
  Assert_real((isxdigit(107) == 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_isxdigit.c",
              540, ("isxdigit should be 0 for k"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x21c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for k\00"
define void @t_isxdigit_0x6b() {
%1 = call i64 @isxdigit(i32 107)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for k\00"
define void @t_isxdigit_0x6b() {
%1 = tail call i64 @isxdigit(i32 107)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long __normal___udivdi3(unsigned long long, unsigned long long);
unsigned long long __wrap___udivdi3(unsigned long long a,
                                    unsigned long long b) {
  return __normal___udivdi3(a, b);
}


x86 assembly (clang, -O0):
<__wrap___udivdi3>:
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 <__normal___udivdi3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap___udivdi3>:
jmp    1030 <__normal___udivdi3@plt>

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

LLVM IR (-O2):
define i64 @__wrap___udivdi3(i64 %0, i64 %1) {
%3 = tail call i64 @__normal___udivdi3(i64 %0, i64 %1)
ret i64 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t get_random(void) {
  static uint16_t lfsr = 0xACE1u;
  unsigned bit;
  bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 5)) & 1;
  lfsr = (lfsr >> 1) | (bit << 15);
  return lfsr;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
sar    $0x0,%eax
mov    0x2f0d(%rip),%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    0x2f02(%rip),%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
mov    0x2ef7(%rip),%ecx
sar    $0x5,%ecx
xor    %ecx,%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x2ee6(%rip),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0xf,%ecx
or     %ecx,%eax
mov    %eax,0x2ed5(%rip)
mov    0x2ecf(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
shr    $0x2,%eax
xor    %ecx,%eax
mov    %ecx,%edx
shr    $0x3,%edx
mov    %ecx,%esi
shr    $0x5,%esi
xor    %edx,%esi
xor    %eax,%esi
sar    %ecx
shl    $0xf,%esi
movzwl %si,%eax
or     %ecx,%eax
mov    %eax,0x2ef5(%rip)
ret

LLVM IR (-O0):
@get_random.lfsr = internal global i32 44257
define i32 @get_random() {
%1 = alloca i32
%2 = load i32, i32* @get_random.lfsr
%3 = ashr i32 %2, 0
%4 = load i32, i32* @get_random.lfsr
%5 = ashr i32 %4, 2
%6 = xor i32 %3, %5
%7 = load i32, i32* @get_random.lfsr
%8 = ashr i32 %7, 3
%9 = xor i32 %6, %8
%10 = load i32, i32* @get_random.lfsr
%11 = ashr i32 %10, 5
%12 = xor i32 %9, %11
%13 = and i32 %12, 1
store i32 %13, i32* %1
%14 = load i32, i32* @get_random.lfsr
%15 = ashr i32 %14, 1
%16 = load i32, i32* %1
%17 = shl i32 %16, 15
%18 = or i32 %15, %17
store i32 %18, i32* @get_random.lfsr
%19 = load i32, i32* @get_random.lfsr
ret i32 %19
}

LLVM IR (-O2):
@get_random.lfsr = internal unnamed_addr global i32 44257
define i32 @get_random() {
%1 = load i32, i32* @get_random.lfsr
%2 = lshr i32 %1, 2
%3 = xor i32 %2, %1
%4 = lshr i32 %1, 3
%5 = xor i32 %3, %4
%6 = lshr i32 %1, 5
%7 = xor i32 %5, %6
%8 = ashr i32 %1, 1
%9 = shl i32 %7, 15
%10 = and i32 %9, 32768
%11 = or i32 %10, %8
store i32 %11, i32* @get_random.lfsr
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: primecheck [OPTION] <integer>\n\n");
  printf("\t-c\t\tSpecify number of threads to use\n");
  printf("\t-h\t\tPrint this help and exit\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: primecheck [OPTION] <integer>\0A\0A\00"
@.str.1 = [39 x i8] c"\09-c\09\09Specify number of threads to use\0A\00"
@.str.2 = [31 x i8] c"\09-h\09\09Print this help and exit\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [38 x i8] c"Usage: primecheck [OPTION] <integer>\0A\00"
@str.3 = [38 x i8] c"\09-c\09\09Specify number of threads to use\00"
@str.4 = [30 x i8] c"\09-h\09\09Print this help and exit\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int write_raw_byte(char value, void *_buffer, int offset) {
  *((char *)_buffer + offset) = value;
  return ++offset;
}


x86 assembly (clang, -O0):
<write_raw_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_raw_byte>:
movslq %edx,%rax
mov    %dil,(%rsi,%rax,1)
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @write_raw_byte(i8 signext %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 %7, i8* %11
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @write_raw_byte(i8 signext %0, i8* nocapture writeonly %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %0, i8* %5
%6 = add nsw i32 %2, 1
ret i32 %6
}