#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*/ customprint(char *);
int getchar();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int character = 0;
  int stored = 0;
  for (character = getchar(); character != EOF; character = getchar()) {
    while (stored < character) {
      customprint("+");
      stored++;
    }
    while (stored > character) {
      customprint("-");
      stored--;
    }
    customprint(".");
  }
  while (stored < 10) {
    customprint("+");
    stored++;
  }
  while (stored > 10) {
    customprint("-");
    stored--;
  }
  customprint(".");
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%eax
je     11e1 <main+0xb1>
jmp    1175 <main+0x45>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    119b <main+0x6b>
lea    0xe78(%rip),%rdi
call   1030 <customprint@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1175 <main+0x45>
jmp    11a0 <main+0x70>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11c6 <main+0x96>
lea    0xe4f(%rip),%rdi
call   1030 <customprint@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11a0 <main+0x70>
lea    0xe37(%rip),%rdi
call   1030 <customprint@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    115e <main+0x2e>
jmp    11e6 <main+0xb6>
cmpl   $0xa,-0x18(%rbp)
jge    120a <main+0xda>
lea    0xe09(%rip),%rdi
call   1030 <customprint@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e6 <main+0xb6>
jmp    120f <main+0xdf>
cmpl   $0xa,-0x18(%rbp)
jle    1233 <main+0x103>
lea    0xde2(%rip),%rdi
call   1030 <customprint@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    120f <main+0xdf>
lea    0xdca(%rip),%rdi
call   1030 <customprint@plt>
lea    0xdc0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r12d,%r12d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
je     11d8 <main+0xa8>
lea    0xea5(%rip),%r13
lea    0xea2(%rip),%r14
lea    0xe99(%rip),%r15
xor    %ebp,%ebp
jmp    118d <main+0x5d>
nopl   (%rax)
mov    %r14,%rdi
call   1040 <customprint@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %r12d,%ebp
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%eax
je     11d2 <main+0xa2>
mov    %eax,%r12d
cmp    %eax,%ebp
jge    11b0 <main+0x80>
mov    %r12d,%ebx
sub    %ebp,%ebx
nopl   0x0(%rax)
mov    %r13,%rdi
call   1040 <customprint@plt>
add    $0xffffffff,%ebx
jne    11a0 <main+0x70>
jmp    1170 <main+0x40>
nop
jle    1170 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
call   1040 <customprint@plt>
add    $0xffffffff,%ebp
cmp    %r12d,%ebp
jg     11c0 <main+0x90>
jmp    1170 <main+0x40>
cmp    $0x9,%r12d
jg     1224 <main+0xf4>
add    $0xfffffff6,%r12d
lea    0xe1d(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
call   1040 <customprint@plt>
inc    %r12d
jne    11f0 <main+0xc0>
lea    0xe00(%rip),%rdi
call   1040 <customprint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0xa,%r12d
je     11fd <main+0xcd>
add    $0x1,%r12d
lea    0xdcd(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   1040 <customprint@plt>
add    $0xffffffff,%r12d
cmp    $0xb,%r12d
ja     1240 <main+0x110>
jmp    11fd <main+0xcd>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
br label %9
9: ; preds = %33, %2
%10 = load i32, i32* %6
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %35
13: ; preds = %9
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %14
22: ; preds = %14
br label %23
23: ; preds = %27, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = icmp sgt i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* %7
%30 = add nsw i32 %29, -1
store i32 %30, i32* %7
br label %23
31: ; preds = %23
%32 = call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = call i32 (...) @getchar()
store i32 %34, i32* %6
br label %9
35: ; preds = %9
br label %36
36: ; preds = %39, %35
%37 = load i32, i32* %7
%38 = icmp slt i32 %37, 10
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %36
43: ; preds = %36
br label %44
44: ; preds = %47, %43
%45 = load i32, i32* %7
%46 = icmp sgt i32 %45, 10
br i1 %46, label %47, label %51
47: ; preds = %44
%48 = call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%49 = load i32, i32* %7
%50 = add nsw i32 %49, -1
store i32 %50, i32* %7
br label %44
51: ; preds = %44
%52 = call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%53 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %26
%7 = phi i32 [ %8, %26 ], [ 0, %2 ]
%8 = phi i32 [ %28, %26 ], [ %3, %2 ]
%9 = icmp slt i32 %7, %8
br i1 %9, label %16, label %14
10: ; preds = %26
%11 = icmp slt i32 %8, 10
br i1 %11, label %12, label %31
12: ; preds = %2, %10
%13 = phi i32 [ 0, %2 ], [ %8, %10 ]
br label %33
14: ; preds = %6
%15 = icmp sgt i32 %7, %8
br i1 %15, label %21, label %26
16: ; preds = %6, %16
%17 = phi i32 [ %19, %16 ], [ %7, %6 ]
%18 = tail call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = add i32 %17, 1
%20 = icmp eq i32 %19, %8
br i1 %20, label %26, label %16
21: ; preds = %14, %21
%22 = phi i32 [ %24, %21 ], [ %7, %14 ]
%23 = tail call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = add nsw i32 %22, -1
%25 = icmp sgt i32 %24, %8
br i1 %25, label %21, label %26
26: ; preds = %21, %16, %14
%27 = tail call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = tail call i32 (...) @getchar()
%29 = load i32, i32* @EOF
%30 = icmp eq i32 %28, %29
br i1 %30, label %10, label %6
31: ; preds = %10
%32 = icmp eq i32 %8, 10
br i1 %32, label %43, label %38
33: ; preds = %12, %33
%34 = phi i32 [ %36, %33 ], [ %13, %12 ]
%35 = tail call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%36 = add i32 %34, 1
%37 = icmp eq i32 %36, 10
br i1 %37, label %43, label %33
38: ; preds = %31, %38
%39 = phi i32 [ %41, %38 ], [ %8, %31 ]
%40 = tail call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%41 = add nsw i32 %39, -1
%42 = icmp ugt i32 %39, 11
br i1 %42, label %38, label %43
43: ; preds = %38, %33, %31
%44 = tail call i32 @customprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%45 = tail call i32 @putchar(i32 10)
ret i32 0
}