#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 */
char getchar();
int /*<<< orphan*/ printf(char *, int, int, int);
ln_1(void) {
  int c, nl = 1, tabs = 0, blanks = 0;
  while ((c = getchar()) != '~')
    switch (c) {
    case ' ':
      blanks++;
      break;
    case '\t':
      tabs++;
      break;
    case '\n':
      nl++;
      break;
    default:
      continue;
    }
  printf("Tabs = %d\nBlaks = %d\nNl = %i", tabs, blanks, nl);
  while (c = getchar() != '10')
    continue;
}


x86 assembly (clang, -O0):
<ln_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x7e,%eax
je     11bd <ln_1+0x9d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x9,%eax
je     1197 <ln_1+0x77>
jmp    1167 <ln_1+0x47>
mov    -0x18(%rbp),%eax
sub    $0xa,%eax
je     11a5 <ln_1+0x85>
jmp    1178 <ln_1+0x58>
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
jne    11b3 <ln_1+0x93>
jmp    1189 <ln_1+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b8 <ln_1+0x98>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b8 <ln_1+0x98>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <ln_1+0x98>
jmp    113d <ln_1+0x1d>
jmp    113d <ln_1+0x1d>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x3130,%eax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x8(%rbp)
test   $0x1,%al
jne    11fc <ln_1+0xdc>
jmp    1201 <ln_1+0xe1>
jmp    11d2 <ln_1+0xb2>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_1>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%r14d
xor    %ebp,%ebp
xor    %ebx,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x7e,%al
je     115d <ln_1+0x3d>
movsbl %al,%eax
cmp    $0x9,%eax
je     1152 <ln_1+0x32>
cmp    $0xa,%eax
je     1157 <ln_1+0x37>
cmp    $0x20,%eax
jne    1130 <ln_1+0x10>
add    $0x1,%ebx
jmp    1130 <ln_1+0x10>
add    $0x1,%ebp
jmp    1130 <ln_1+0x10>
add    $0x1,%r14d
jmp    1130 <ln_1+0x10>
lea    0xe9c(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1170 <ln_1+0x50>

LLVM IR (-O0):
@.str = [29 x i8] c"Tabs = %d\0ABlaks = %d\0ANl = %i\00"
define i32 @ln_1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 1, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %21, %0
%7 = call signext i8 (...) @getchar()
%8 = sext i8 %7 to i32
store i32 %8, i32* %2
%9 = icmp ne i32 %8, 126
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %2
switch i32 %11, label %21 [
i32 32, label %12
i32 9, label %15
i32 10, label %18
]
12: ; preds = %10
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
br label %22
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %22
18: ; preds = %10
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %22
21: ; preds = %10
br label %6
22: ; preds = %18, %15, %12
br label %6
23: ; preds = %6
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %33, %23
%29 = call signext i8 (...) @getchar()
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 12592
%32 = zext i1 %31 to i32
store i32 %32, i32* %2
br i1 %31, label %33, label %34
33: ; preds = %28
br label %28
34: ; preds = %28
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str = [29 x i8] c"Tabs = %d\0ABlaks = %d\0ANl = %i\00"
define i32 @ln_1() {
br label %1
1: ; preds = %19, %0
%2 = phi i32 [ %20, %19 ], [ 1, %0 ]
%3 = phi i32 [ %6, %19 ], [ 0, %0 ]
%4 = phi i32 [ %9, %19 ], [ 0, %0 ]
br label %5
5: ; preds = %1, %17
%6 = phi i32 [ %3, %1 ], [ %18, %17 ]
%7 = phi i32 [ %4, %1 ], [ %9, %17 ]
br label %8
8: ; preds = %5, %15
%9 = phi i32 [ %16, %15 ], [ %7, %5 ]
br label %10
10: ; preds = %8, %13
%11 = tail call signext i8 (...) @getchar()
%12 = icmp eq i8 %11, 126
br i1 %12, label %21, label %13
13: ; preds = %10
%14 = sext i8 %11 to i32
switch i32 %14, label %10 [
i32 32, label %15
i32 9, label %17
i32 10, label %19
]
15: ; preds = %13
%16 = add nsw i32 %9, 1
br label %8
17: ; preds = %13
%18 = add nsw i32 %6, 1
br label %5
19: ; preds = %13
%20 = add nuw nsw i32 %2, 1
br label %1
21: ; preds = %10
%22 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %2)
br label %23
23: ; preds = %23, %21
%24 = tail call signext i8 (...) @getchar()
br label %23
}