#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 /*<<< orphan*/ scanf(char *, char *);
int main() {
  int a, b, c;
  char buf[100];
  int i, len;
  int done = 0;
  i = 0;
  while (1) {
    scanf("%c", &buf[i]);
    if (buf[i] == '+')
      break;
  }
  len = i;
  a = 0;
  for (i = 0; i < len; i++) {
    a = buf[i];
    a = a * 10;
  }
  a = a / 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x84(%rbp)
movslq -0x84(%rbp),%rax
lea    -0x80(%rbp),%rsi
add    %rax,%rsi
lea    0xeb5(%rip),%rdi
call   1030 <scanf@plt>
movslq -0x84(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x2b,%eax
jne    116a <main+0x5a>
jmp    116f <main+0x5f>
jmp    1136 <main+0x26>
mov    -0x84(%rbp),%eax
mov    %eax,-0x88(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    11c8 <main+0xb8>
movslq -0x84(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    118c <main+0x7c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xee2(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmpb   $0x2b,(%rsp)
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %8
store i32 0, i32* %6
br label %9
9: ; preds = %0, %21
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %11
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 43
br i1 %19, label %20, label %21
20: ; preds = %9
br label %22
21: ; preds = %9
br label %9
22: ; preds = %20
%23 = load i32, i32* %6
store i32 %23, i32* %7
store i32 0, i32* %2
store i32 0, i32* %6
br label %24
24: ; preds = %36, %22
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %39
28: ; preds = %24
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = mul nsw i32 %34, 10
store i32 %35, i32* %2
br label %36
36: ; preds = %28
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %24
39: ; preds = %24
%40 = load i32, i32* %2
%41 = sdiv i32 %40, 10
store i32 %41, i32* %2
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 43
br i1 %6, label %7, label %3
7: ; preds = %3
ret i32 0
}