#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*/ printf(char *, int, char);
int /*<<< orphan*/ putchar(char);
void _print_mincore_helper(char c, int count) {
  switch (count) {
  default:
    printf(":%d%c:", count, c);
    break;
  case 3:
    putchar(c);
  case 2:
    putchar(c);
  case 1:
    putchar(c);
    break;
  }
}


x86 assembly (clang, -O0):
<_print_mincore_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1191 <_print_mincore_helper+0x71>
jmp    1145 <_print_mincore_helper+0x25>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1188 <_print_mincore_helper+0x68>
jmp    1156 <_print_mincore_helper+0x36>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     117f <_print_mincore_helper+0x5f>
jmp    1167 <_print_mincore_helper+0x47>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
movsbl -0x1(%rbp),%edx
call   1040 <printf@plt>
jmp    119a <_print_mincore_helper+0x7a>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_mincore_helper>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%esi
je     1142 <_print_mincore_helper+0x22>
cmp    $0x2,%esi
je     113a <_print_mincore_helper+0x1a>
cmp    $0x3,%esi
jne    114b <_print_mincore_helper+0x2b>
movsbl %bl,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>
movsbl %bl,%edx
lea    0xeab(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c":%d%c:\00"
define void @_print_mincore_helper(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %6 [
i32 3, label %10
i32 2, label %13
i32 1, label %16
]
6: ; preds = %2
%7 = load i32, i32* %4
%8 = load i8, i8* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i8 signext %8)
br label %19
10: ; preds = %2
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %2, %10
%14 = load i8, i8* %3
%15 = call i32 @putchar(i8 signext %14)
br label %16
16: ; preds = %2, %13
%17 = load i8, i8* %3
%18 = call i32 @putchar(i8 signext %17)
br label %19
19: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c":%d%c:\00"
define void @_print_mincore_helper(i8 signext %0, i32 %1) {
switch i32 %1, label %3 [
i32 3, label %5
i32 2, label %7
i32 1, label %9
]
3: ; preds = %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i8 signext %0)
br label %11
5: ; preds = %2
%6 = tail call i32 @putchar(i8 signext %0)
br label %7
7: ; preds = %2, %5
%8 = tail call i32 @putchar(i8 signext %0)
br label %9
9: ; preds = %2, %7
%10 = tail call i32 @putchar(i8 signext %0)
br label %11
11: ; preds = %9, %3
ret void
}