#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 EOF;
int /*<<< orphan*/ atoi(char *);
int getchar();
scalar_t__ isdigit(int);
int /*<<< orphan*/ itoa(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  int character, element = 0;
  char input_string[100], number_string[100];
  while ((character = getchar()) != EOF) {
    if (isdigit(character) || character == '-')
      input_string[element++] = character;
    else {
      input_string[element] = '\0';
      itoa(number_string, atoi(input_string));
      printf("[%s] = [%s]\n", input_string, number_string);
      element = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e6e(%rip),%rcx
cmp    (%rcx),%eax
je     120a <main+0xba>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    119e <main+0x4e>
cmpl   $0x2d,-0x8(%rbp)
jne    11b9 <main+0x69>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %cl,-0x70(%rbp,%rax,1)
jmp    1205 <main+0xb5>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
lea    -0xe0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x70(%rbp),%rdi
call   1060 <atoi@plt>
mov    -0xe8(%rbp),%rdi
mov    %eax,%esi
call   1070 <itoa@plt>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xe07(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
jmp    1169 <main+0x19>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e79(%rip),%r13
cmp    0x0(%r13),%eax
jne    1189 <main+0x39>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
mov    %rsp,%r14
lea    0x70(%rsp),%r12
lea    0xe66(%rip),%r15
xor    %ebx,%ebx
jmp    11b6 <main+0x66>
xchg   %ax,%ax
lea    0x1(%rcx),%ebx
mov    %bpl,(%rsp,%rcx,1)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    0x0(%r13),%eax
je     1175 <main+0x25>
mov    %ebp,%edi
call   1030 <isdigit@plt>
movslq %ebx,%rcx
cmp    $0x2d,%ebp
je     11a0 <main+0x50>
test   %rax,%rax
jne    11a0 <main+0x50>
movb   $0x0,(%rsp,%rcx,1)
mov    %r14,%rdi
call   1060 <atoi@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1070 <itoa@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1040 <printf@plt>
xor    %ebx,%ebx
jmp    11a7 <main+0x57>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [13 x i8] c"[%s] = [%s]\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 (...) @getchar()
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %31, label %8
8: ; preds = %0, %26
%9 = phi i32 [ %28, %26 ], [ %5, %0 ]
%10 = phi i32 [ %27, %26 ], [ 0, %0 ]
%11 = call i64 @isdigit(i32 %9)
%12 = icmp ne i64 %11, 0
%13 = icmp eq i32 %9, 45
%14 = or i1 %13, %12
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = trunc i32 %9 to i8
%17 = add nsw i32 %10, 1
%18 = sext i32 %10 to i64
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %18
store i8 %16, i8* %19
br label %26
20: ; preds = %8
%21 = sext i32 %10 to i64
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %21
store i8 0, i8* %22
%23 = call i32 @atoi(i8* %3)
%24 = call i32 @itoa(i8* %4, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
br label %26
26: ; preds = %20, %15
%27 = phi i32 [ %17, %15 ], [ 0, %20 ]
%28 = call i32 (...) @getchar()
%29 = load i32, i32* @EOF
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %8
31: ; preds = %26, %0
ret i32 0
}