#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ mvprintw(int, int, char *, int);
void printInt(int y, int x, int num, int bonus) {
  if (num > 99)
    mvprintw(y, x - 4, "%d", num);
  else if (num > 9)
    mvprintw(y, x - 3, "%d", num);
  else
    mvprintw(y, x - 2, "%d", num);
  if (bonus < 63 && bonus)
    addch('v');
}


x86 assembly (clang, -O0):
<printInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x63,-0xc(%rbp)
jle    115b <printInt+0x3b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x4,%esi
mov    -0xc(%rbp),%ecx
lea    0xeaf(%rip),%rdx
call   1040 <mvprintw@plt>
jmp    119f <printInt+0x7f>
cmpl   $0x9,-0xc(%rbp)
jle    1182 <printInt+0x62>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x3,%esi
mov    -0xc(%rbp),%ecx
lea    0xe88(%rip),%rdx
call   1040 <mvprintw@plt>
jmp    119a <printInt+0x7a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
mov    -0xc(%rbp),%ecx
lea    0xe6b(%rip),%rdx
call   1040 <mvprintw@plt>
jmp    119f <printInt+0x7f>
cmpl   $0x3f,-0x10(%rbp)
jge    11bd <printInt+0x9d>
cmpl   $0x0,-0x10(%rbp)
je     11bd <printInt+0x9d>
mov    $0x76,%edi
call   1030 <addch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInt>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ecx
xor    %eax,%eax
cmp    $0xa,%edx
setge  %al
mov    $0xfffffffe,%edx
sub    %eax,%edx
cmp    $0x64,%ecx
mov    $0xfffffffc,%eax
cmovl  %edx,%eax
add    %eax,%esi
lea    0xeb8(%rip),%rdx
call   1040 <mvprintw@plt>
cmp    $0x3e,%ebx
jg     1161 <printInt+0x41>
test   %ebx,%ebx
je     1161 <printInt+0x41>
mov    $0x76,%edi
pop    %rbx
jmp    1030 <addch@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printInt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = icmp sgt i32 %9, 99
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 4
%15 = load i32, i32* %7
%16 = call i32 @mvprintw(i32 %12, i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %33
17: ; preds = %4
%18 = load i32, i32* %7
%19 = icmp sgt i32 %18, 9
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = sub nsw i32 %22, 3
%24 = load i32, i32* %7
%25 = call i32 @mvprintw(i32 %21, i32 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %32
26: ; preds = %17
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = sub nsw i32 %28, 2
%30 = load i32, i32* %7
%31 = call i32 @mvprintw(i32 %27, i32 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %26, %20
br label %33
33: ; preds = %32, %11
%34 = load i32, i32* %8
%35 = icmp slt i32 %34, 63
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i32, i32* %8
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @addch(i8 signext 118)
br label %41
41: ; preds = %39, %36, %33
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printInt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, 99
%6 = icmp sgt i32 %2, 9
%7 = select i1 %6, i32 -3, i32 -2
%8 = select i1 %5, i32 -4, i32 %7
%9 = add nsw i32 %8, %1
%10 = tail call i32 @mvprintw(i32 %0, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%11 = icmp slt i32 %3, 63
%12 = icmp ne i32 %3, 0
%13 = and i1 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = tail call i32 @addch(i8 signext 118)
br label %16
16: ; preds = %14, %4
ret void
}