#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 b();
n() {
  int c;
  c = b() * 3;
  c += b() / 2;
  c = c * 3 + b() / 2;
  return c == 0   ? ' '
         : c == 1 ? '\n'
         : c == 2 ? '	'
         : c < 33 ? c + 'a' - 3
                  : (c - 32) * 3 + ' ' + b() / 2;
}


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <b@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1171 <n+0x61>
mov    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    11f4 <n+0xe4>
cmpl   $0x1,-0x4(%rbp)
jne    1188 <n+0x78>
mov    $0xa,%eax
mov    %eax,-0x10(%rbp)
jmp    11ee <n+0xde>
cmpl   $0x2,-0x4(%rbp)
jne    119f <n+0x8f>
mov    $0x9,%eax
mov    %eax,-0x14(%rbp)
jmp    11e8 <n+0xd8>
cmpl   $0x21,-0x4(%rbp)
jge    11ba <n+0xaa>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    11e2 <n+0xd2>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x3,%eax,%eax
add    $0x20,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n>:
push   %rbx
xor    %eax,%eax
call   1030 <b@plt>
lea    (%rax,%rax,2),%ebx
xor    %eax,%eax
call   1030 <b@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    %ebx,%ecx
lea    (%rcx,%rcx,2),%ebx
xor    %eax,%eax
call   1030 <b@plt>
mov    %eax,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %ebx,%eax
cmp    $0x3,%eax
jae    1155 <n+0x45>
cltq
lea    0xeb0(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret
cmp    $0x20,%eax
jg     115f <n+0x4f>
add    $0x5e,%eax
pop    %rbx
ret
lea    (%rax,%rax,2),%ebx
xor    %eax,%eax
call   1030 <b@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
lea    (%rcx,%rbx,1),%eax
add    $0xffffffc0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @n() {
%1 = alloca i32
%2 = call i32 (...) @b()
%3 = mul nsw i32 %2, 3
store i32 %3, i32* %1
%4 = call i32 (...) @b()
%5 = sdiv i32 %4, 2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 3
%10 = call i32 (...) @b()
%11 = sdiv i32 %10, 2
%12 = add nsw i32 %9, %11
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %0
br label %45
16: ; preds = %0
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %16
br label %43
20: ; preds = %16
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %24
23: ; preds = %20
br label %41
24: ; preds = %20
%25 = load i32, i32* %1
%26 = icmp slt i32 %25, 33
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 97
%30 = sub nsw i32 %29, 3
br label %39
31: ; preds = %24
%32 = load i32, i32* %1
%33 = sub nsw i32 %32, 32
%34 = mul nsw i32 %33, 3
%35 = add nsw i32 %34, 32
%36 = call i32 (...) @b()
%37 = sdiv i32 %36, 2
%38 = add nsw i32 %35, %37
br label %39
39: ; preds = %31, %27
%40 = phi i32 [ %30, %27 ], [ %38, %31 ]
br label %41
41: ; preds = %39, %23
%42 = phi i32 [ 9, %23 ], [ %40, %39 ]
br label %43
43: ; preds = %41, %19
%44 = phi i32 [ 10, %19 ], [ %42, %41 ]
br label %45
45: ; preds = %43, %15
%46 = phi i32 [ 32, %15 ], [ %44, %43 ]
ret i32 %46
}

LLVM IR (-O2):
@switch.table.n = [3 x i32] [i32 32, i32 10, i32 9]
define i32 @n() {
%1 = tail call i32 (...) @b()
%2 = mul nsw i32 %1, 3
%3 = tail call i32 (...) @b()
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, %2
%6 = mul nsw i32 %5, 3
%7 = tail call i32 (...) @b()
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %6, %8
%10 = icmp ult i32 %9, 3
br i1 %10, label %21, label %11
11: ; preds = %0
%12 = icmp slt i32 %9, 33
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = add nsw i32 %9, 94
br label %25
15: ; preds = %11
%16 = mul i32 %9, 3
%17 = add i32 %16, -64
%18 = tail call i32 (...) @b()
%19 = sdiv i32 %18, 2
%20 = add nsw i32 %17, %19
br label %25
21: ; preds = %0
%22 = sext i32 %9 to i64
%23 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.n, i64 0, i64 %22
%24 = load i32, i32* %23
br label %25
25: ; preds = %21, %13, %15
%26 = phi i32 [ %14, %13 ], [ %20, %15 ], [ %24, %21 ]
ret i32 %26
}