#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 atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[4][10];
  char n = 0;
  char i;
  int num[4];
  int sum = 0;
  for (i = 0; i < 4; i++) {
    scanf("%s", s[i]);
  }
  for (i = 0; i < 4; i++) {
    num[i] = atoi(s[i]);
    sum += num[i];
  }
  printf("%d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x31(%rbp)
movl   $0x0,-0x54(%rbp)
movb   $0x0,-0x32(%rbp)
movsbl -0x32(%rbp),%eax
cmp    $0x4,%eax
jge    1184 <main+0x54>
movsbq -0x32(%rbp),%rax
lea    -0x30(%rbp),%rsi
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xe8e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x32(%rbp),%al
add    $0x1,%al
mov    %al,-0x32(%rbp)
jmp    114e <main+0x1e>
movb   $0x0,-0x32(%rbp)
movsbl -0x32(%rbp),%eax
cmp    $0x4,%eax
jge    11d1 <main+0xa1>
movsbq -0x32(%rbp),%rax
lea    -0x30(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
movsbq -0x32(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
movsbq -0x32(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x32(%rbp),%al
add    $0x1,%al
mov    %al,-0x32(%rbp)
jmp    1188 <main+0x58>
mov    -0x54(%rbp),%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xebc(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
lea    0xa(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
lea    0x14(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
lea    0x1e(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    %r14,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <atoi@plt>
add    %eax,%ebx
mov    %r12,%rdi
call   1050 <atoi@plt>
add    %eax,%ebx
mov    %r13,%rdi
call   1050 <atoi@plt>
add    %eax,%ebx
lea    0xe52(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x [10 x i8]]
%2 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 3, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @atoi(i8* %2)
%11 = call i32 @atoi(i8* %4)
%12 = add nsw i32 %11, %10
%13 = call i32 @atoi(i8* %6)
%14 = add nsw i32 %13, %12
%15 = call i32 @atoi(i8* %8)
%16 = add nsw i32 %15, %14
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}