#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 *, ...);
void printNumber(char *number) {
  char *tmpNumber = number;
  int flag = 0;
  while (*tmpNumber) {
    if (*tmpNumber < '0' || *tmpNumber > '9') {
      printf("Wrong number\n");
      return;
    }
    if (flag == 0 && *tmpNumber == '0') {
      ++tmpNumber;
      continue;
    } else if (flag == 0 && (*tmpNumber > '0' && *tmpNumber <= '9')) {
      flag = 1;
      printf("%c", *tmpNumber);
    } else {
      printf("%c", *tmpNumber);
    }
    ++tmpNumber;
  }
  printf(" ");
}


x86 assembly (clang, -O0):
<printNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     120c <printNumber+0xfc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1158 <printNumber+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    116b <printNumber+0x5b>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121a <printNumber+0x10a>
cmpl   $0x0,-0x14(%rbp)
jne    1196 <printNumber+0x86>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1196 <printNumber+0x86>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <printNumber+0x1b>
cmpl   $0x0,-0x14(%rbp)
jne    11e1 <printNumber+0xd1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jle    11e1 <printNumber+0xd1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     11e1 <printNumber+0xd1>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <printNumber+0xe6>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fb <printNumber+0xeb>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <printNumber+0x1b>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNumber>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1176 <printNumber+0x56>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ecx,%ecx
mov    $0x1,%r14d
jmp    1162 <printNumber+0x42>
nopl   0x0(%rax,%rax,1)
cmp    $0x31,%al
mov    %ecx,%ebp
cmovae %r14d,%ebp
test   %ecx,%ecx
cmovne %ecx,%ebp
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
mov    %ebp,%ecx
test   %al,%al
je     1176 <printNumber+0x56>
lea    -0x3a(%rax),%edx
cmp    $0xf5,%dl
jbe    1184 <printNumber+0x64>
test   %ecx,%ecx
jne    1140 <printNumber+0x20>
xor    %ebp,%ebp
cmp    $0x30,%al
je     1155 <printNumber+0x35>
jmp    1140 <printNumber+0x20>
mov    $0x20,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xe75(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Wrong number\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c" \00"
define void @printNumber(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %57, %30, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %60
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 48
br i1 %14, label %20, label %15
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sgt i32 %18, 57
br i1 %19, label %20, label %22
20: ; preds = %15, %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %62
22: ; preds = %15
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %22
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 48
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
br label %6
33: ; preds = %25, %22
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %51
36: ; preds = %33
%37 = load i8*, i8** %3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp sgt i32 %39, 48
br i1 %40, label %41, label %51
41: ; preds = %36
%42 = load i8*, i8** %3
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp sle i32 %44, 57
br i1 %45, label %46, label %51
46: ; preds = %41
store i32 1, i32* %4
%47 = load i8*, i8** %3
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %49)
br label %56
51: ; preds = %41, %36, %33
%52 = load i8*, i8** %3
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %51, %46
br label %57
57: ; preds = %56
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %3
br label %6
60: ; preds = %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %62
62: ; preds = %60, %20
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Wrong number\00"
define void @printNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %27, label %4
4: ; preds = %1, %16
%5 = phi i8 [ %19, %16 ], [ %2, %1 ]
%6 = phi i32 [ %17, %16 ], [ 0, %1 ]
%7 = phi i8* [ %18, %16 ], [ %0, %1 ]
%8 = add i8 %5, -58
%9 = icmp ult i8 %8, -10
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %29
12: ; preds = %4
%13 = icmp eq i32 %6, 0
%14 = icmp eq i8 %5, 48
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %16, label %21
16: ; preds = %21, %12
%17 = phi i32 [ 0, %12 ], [ %24, %21 ]
%18 = getelementptr inbounds i8, i8* %7, i64 1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %27, label %4
21: ; preds = %12
%22 = icmp ugt i8 %5, 48
%23 = select i1 %13, i1 %22, i1 false
%24 = select i1 %23, i32 1, i32 %6
%25 = zext i8 %5 to i32
%26 = tail call i32 @putchar(i32 %25)
br label %16
27: ; preds = %16, %1
%28 = tail call i32 @putchar(i32 32)
br label %29
29: ; preds = %27, %10
ret void
}