#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 */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/);
int getc(int /*<<< orphan*/);
int scanf(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ skipspaces();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  int c;
  skipspaces();
  if ((c = getc(stdin)) != '[') {
    return 1;
  }
  while (1) {
    uint8_t x;
    skipspaces();
    if (scanf("%di8", &x) != 1) {
      return 1;
    }
    fputc(x, stdout);
    skipspaces();
    if ((c = getc(stdin)) == ']') {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <skipspaces@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1060 <getc@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x5b,%eax
je     117c <main+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    11f0 <main+0xb0>
jmp    1181 <main+0x41>
mov    $0x0,%al
call   1040 <skipspaces@plt>
lea    0xe71(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     11ad <main+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    11f0 <main+0xb0>
mov    -0xc(%rbp),%edi
mov    0x2e21(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    $0x0,%al
call   1040 <skipspaces@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
call   1060 <getc@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x5d,%eax
jne    11eb <main+0xab>
movl   $0x0,-0x4(%rbp)
jmp    11f0 <main+0xb0>
jmp    1181 <main+0x41>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <skipspaces@plt>
mov    0x2e8e(%rip),%r15
mov    (%r15),%edi
call   1060 <getc@plt>
mov    $0x1,%ebp
cmp    $0x5b,%eax
jne    11cf <main+0x8f>
lea    0xe8d(%rip),%r14
lea    0xc(%rsp),%rbx
mov    0x2e59(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <skipspaces@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11ca <main+0x8a>
mov    0xc(%rsp),%edi
mov    (%r12),%esi
call   1030 <fputc@plt>
xor    %eax,%eax
call   1040 <skipspaces@plt>
mov    (%r15),%edi
call   1060 <getc@plt>
cmp    $0x5d,%eax
jne    1190 <main+0x50>
jmp    11cf <main+0x8f>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"%di8\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @skipspaces()
%5 = load i32, i32* @stdin
%6 = call i32 @getc(i32 %5)
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 91
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %25
9: ; preds = %0
br label %10
10: ; preds = %9, %24
%11 = call i32 (...) @skipspaces()
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %25
15: ; preds = %10
%16 = load i32, i32* %3
%17 = load i32, i32* @stdout
%18 = call i32 @fputc(i32 %16, i32 %17)
%19 = call i32 (...) @skipspaces()
%20 = load i32, i32* @stdin
%21 = call i32 @getc(i32 %20)
store i32 %21, i32* %2
%22 = icmp eq i32 %21, 93
br i1 %22, label %23, label %24
23: ; preds = %15
store i32 0, i32* %1
br label %25
24: ; preds = %15
br label %10
25: ; preds = %23, %14, %8
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"%di8\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (...) @skipspaces()
%3 = load i32, i32* @stdin
%4 = tail call i32 @getc(i32 %3)
%5 = icmp eq i32 %4, 91
br i1 %5, label %6, label %21
6: ; preds = %0
%7 = bitcast i32* %1 to i8*
br label %8
8: ; preds = %6, %13
%9 = call i32 (...) @skipspaces()
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = icmp eq i32 %10, 1
br i1 %11, label %13, label %12
12: ; preds = %8
br label %21
13: ; preds = %8
%14 = load i32, i32* %1
%15 = load i32, i32* @stdout
%16 = call i32 @fputc(i32 %14, i32 %15)
%17 = call i32 (...) @skipspaces()
%18 = load i32, i32* @stdin
%19 = call i32 @getc(i32 %18)
%20 = icmp eq i32 %19, 93
br i1 %20, label %21, label %8
21: ; preds = %13, %12, %0
%22 = phi i32 [ 1, %0 ], [ 1, %12 ], [ 0, %13 ]
ret i32 %22
}