#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf_s(char *, int *, int);
int main(void) {
  int userInput = 0;
  int sum = 0;
  int i = 0;
  for (i = 0; i < 5; i++) {
    printf("%d¹øÂ° Á¤¼ö¸¦ ÀÔ·ÂÇÏ¼¼¿ä: ", i + 1);
    scanf_s("%d", &userInput, 1);
    while (userInput < 1) {
      printf("1°ú °°°Å³ª Å« ¼ö¸¦ ÀÔ·ÂÇÏ¼¼¿ä: ");
      scanf_s("%d", &userInput, 1);
    }
    sum += userInput;
  }
  printf("ÇÕÀº %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11c7 <main+0xa7>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
cmpl   $0x1,-0x8(%rbp)
jge    11b0 <main+0x90>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
jmp    117e <main+0x5e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <main+0x2b>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec6(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%r13d
test   %r13d,%r13d
jg     11a4 <main+0x84>
lea    0xec5(%rip),%r14
lea    0xebb(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%r13d
test   %r13d,%r13d
jle    1180 <main+0x60>
lea    0xe55(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jg     1212 <main+0xf2>
lea    0xe56(%rip),%r14
lea    0xe4c(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jle    11f0 <main+0xd0>
lea    0xde7(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe03(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%r14d
test   %r14d,%r14d
jg     1284 <main+0x164>
lea    0xde6(%rip),%r12
lea    0xddc(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%r14d
test   %r14d,%r14d
jle    1260 <main+0x140>
lea    0xd75(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd91(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jg     12f6 <main+0x1d6>
lea    0xd73(%rip),%r15
lea    0x4(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xd5b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jle    12d0 <main+0x1b0>
lea    0xd03(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd1f(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jg     1366 <main+0x246>
lea    0xd01(%rip),%r15
lea    0x4(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xceb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1340 <main+0x220>
add    %r13d,%ebp
add    %ebp,%r14d
add    %r14d,%ebx
add    %eax,%ebx
lea    0xcf2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"%d\C2\B9\C3\B8\C3\82\C2\B0 \C3\81\C2\A4\C2\BC\C3\B6\C2\B8\C2\A6 \C3\80\C3\94\C2\B7\C3\82\C3\87\C3\8F\C2\BC\C2\BC\C2\BF\C3\A4: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [56 x i8] c"1\C2\B0\C3\BA \C2\B0\C2\B0\C2\B0\C3\85\C2\B3\C2\AA \C3\85\C2\AB \C2\BC\C3\B6\C2\B8\C2\A6 \C3\80\C3\94\C2\B7\C3\82\C3\87\C3\8F\C2\BC\C2\BC\C2\BF\C3\A4: \00"
@.str.3 = [13 x i8] c"\C3\87\C3\95\C3\80\C2\BA %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %4
br label %5
5: ; preds = %23, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32 1)
br label %13
13: ; preds = %16, %8
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32 1)
br label %13
19: ; preds = %13
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, %20
store i32 %22, i32* %3
br label %23
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"%d\C2\B9\C3\B8\C3\82\C2\B0 \C3\81\C2\A4\C2\BC\C3\B6\C2\B8\C2\A6 \C3\80\C3\94\C2\B7\C3\82\C3\87\C3\8F\C2\BC\C2\BC\C2\BF\C3\A4: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [56 x i8] c"1\C2\B0\C3\BA \C2\B0\C2\B0\C2\B0\C3\85\C2\B3\C2\AA \C3\85\C2\AB \C2\BC\C3\B6\C2\B8\C2\A6 \C3\80\C3\94\C2\B7\C3\82\C3\87\C3\8F\C2\BC\C2\BC\C2\BF\C3\A4: \00"
@.str.3 = [13 x i8] c"\C3\87\C3\95\C3\80\C2\BA %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 1
br i1 %11, label %7, label %12
12: ; preds = %7, %0
%13 = phi i32 [ %5, %0 ], [ %10, %7 ]
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 2)
%15 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %12, %18
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%21 = load i32, i32* %1
%22 = icmp slt i32 %21, 1
br i1 %22, label %18, label %23
23: ; preds = %18, %12
%24 = phi i32 [ %16, %12 ], [ %21, %18 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 3)
%26 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%27 = load i32, i32* %1
%28 = icmp slt i32 %27, 1
br i1 %28, label %29, label %34
29: ; preds = %23, %29
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 1
br i1 %33, label %29, label %34
34: ; preds = %29, %23
%35 = phi i32 [ %27, %23 ], [ %32, %29 ]
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 4)
%37 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%38 = load i32, i32* %1
%39 = icmp slt i32 %38, 1
br i1 %39, label %40, label %45
40: ; preds = %34, %40
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%43 = load i32, i32* %1
%44 = icmp slt i32 %43, 1
br i1 %44, label %40, label %45
45: ; preds = %40, %34
%46 = phi i32 [ %38, %34 ], [ %43, %40 ]
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 5)
%48 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%49 = load i32, i32* %1
%50 = icmp slt i32 %49, 1
br i1 %50, label %51, label %56
51: ; preds = %45, %51
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%53 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 1)
%54 = load i32, i32* %1
%55 = icmp slt i32 %54, 1
br i1 %55, label %51, label %56
56: ; preds = %51, %45
%57 = phi i32 [ %49, %45 ], [ %54, %51 ]
%58 = add nsw i32 %24, %13
%59 = add nsw i32 %35, %58
%60 = add nsw i32 %46, %59
%61 = add nsw i32 %57, %60
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %61)
ret i32 0
}