#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 *, char *, int);
void print(int a, int count) {
  int i = 0;
  int base = 1000000;
  char s[9];
  s[3] = '-';
  s[8] = '\0';
  for (; i < 8; i++) {
    if (i != 3) {
      s[i] = a / base + '0';
      a = a % base;
      base = base / 10;
    }
  }
  printf("%s %d\n", s, count);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xf4240,-0x10(%rbp)
movb   $0x2d,-0x16(%rbp)
movb   $0x0,-0x11(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1187 <print+0x77>
cmpl   $0x3,-0xc(%rbp)
je     1174 <print+0x64>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x10(%rbp)
add    $0x30,%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x19(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    1179 <print+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <print+0x24>
lea    -0x19(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
sub    $0x18,%rsp
mov    %esi,%edx
movb   $0x2d,0x12(%rsp)
movb   $0x0,0x17(%rsp)
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x32,%rcx
add    %esi,%ecx
lea    0x30(%rcx),%esi
mov    %sil,0xf(%rsp)
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
cltq
imul   $0x14f8b589,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x2d,%rcx
add    %esi,%ecx
lea    0x30(%rcx),%esi
mov    %sil,0x10(%rsp)
imul   $0x186a0,%ecx,%ecx
sub    %ecx,%eax
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x2c,%rcx
add    %esi,%ecx
lea    0x30(%rcx),%esi
mov    %sil,0x11(%rsp)
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8313,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%esi
shr    $0xf,%ecx
sar    $0x9,%esi
add    %ecx,%esi
lea    0x30(%rsi),%ecx
mov    %cl,0x13(%rsp)
imul   $0x3e8,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0x147b,%ecx,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
sar    $0x13,%ecx
add    %esi,%ecx
lea    0x30(%rcx),%esi
mov    %sil,0x14(%rsp)
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
movsbl %al,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%esi
shr    $0xf,%ecx
shr    $0xa,%esi
add    %cl,%sil
lea    0x30(%rsi),%ecx
mov    %cl,0x15(%rsp)
movzbl %sil,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
add    $0x30,%al
mov    %al,0x16(%rsp)
lea    0xdee(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s %d\0A\00"
define void @print(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [9 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 1000000, i32* %6
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 3
store i8 45, i8* %8
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 8
store i8 0, i8* %9
br label %10
10: ; preds = %31, %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %34
13: ; preds = %10
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %30
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32, i32* %6
%19 = sdiv i32 %17, %18
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 %23
store i8 %21, i8* %24
%25 = load i32, i32* %3
%26 = load i32, i32* %6
%27 = srem i32 %25, %26
store i32 %27, i32* %3
%28 = load i32, i32* %6
%29 = sdiv i32 %28, 10
store i32 %29, i32* %6
br label %30
30: ; preds = %16, %13
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %10
34: ; preds = %10
%35 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%36 = load i32, i32* %4
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %35, i32 %36)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
define void @print(i32 %0, i32 %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 3
store i8 45, i8* %5
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 8
store i8 0, i8* %6
%7 = sdiv i32 %0, 1000000
%8 = trunc i32 %7 to i8
%9 = add i8 %8, 48
store i8 %9, i8* %4
%10 = srem i32 %0, 1000000
%11 = sdiv i32 %10, 100000
%12 = trunc i32 %11 to i8
%13 = add nsw i8 %12, 48
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 1
store i8 %13, i8* %14
%15 = srem i32 %10, 100000
%16 = sdiv i32 %15, 10000
%17 = trunc i32 %16 to i8
%18 = add nsw i8 %17, 48
%19 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 2
store i8 %18, i8* %19
%20 = srem i32 %15, 10000
%21 = trunc i32 %20 to i16
%22 = sdiv i16 %21, 1000
%23 = trunc i16 %22 to i8
%24 = add nsw i8 %23, 48
%25 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 4
store i8 %24, i8* %25
%26 = trunc i32 %20 to i16
%27 = srem i16 %26, 1000
%28 = sdiv i16 %27, 100
%29 = trunc i16 %28 to i8
%30 = add nsw i8 %29, 48
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 5
store i8 %30, i8* %31
%32 = srem i16 %27, 100
%33 = trunc i16 %32 to i8
%34 = sdiv i8 %33, 10
%35 = add nsw i8 %34, 48
%36 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 6
store i8 %35, i8* %36
%37 = trunc i16 %32 to i8
%38 = srem i8 %37, 10
%39 = add nsw i8 %38, 48
%40 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 7
store i8 %39, i8* %40
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %1)
ret void
}