#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, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int t[3], v[5] = {0};
  for (*v = 0; *v < 4; ++*v, printf("%d반? ", *v),
      scanf("%d %d %d", t, t + 1, t + 2), v[*v] = t[0] + t[1] + t[2])
    ;
  for (*v = 0; *v < 4; ++*v, printf("%d반 : %d개\n", *v, v[*v]))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x4,-0x30(%rbp)
jge    11b5 <main+0x85>
jmp    1165 <main+0x35>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    -0x10(%rbp),%rdx
add    $0x4,%rdx
lea    -0x10(%rbp),%rcx
add    $0x8,%rcx
lea    0xe6e(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
add    -0x8(%rbp),%ecx
movslq -0x30(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    1156 <main+0x26>
movl   $0x0,-0x30(%rbp)
cmpl   $0x4,-0x30(%rbp)
jge    11f2 <main+0xc2>
jmp    11cb <main+0x9b>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%esi
movslq -0x30(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bc <main+0x8c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0xeb1(%rip),%r12
lea    0xeb2(%rip),%r13
lea    0x4(%rsp),%rbx
xor    %ebp,%ebp
nopl   (%rax)
lea    0x1(%rbp),%esi
mov    %esi,0x10(%rsp)
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
add    0x4(%rsp),%eax
add    0xc(%rsp),%eax
movslq %ebp,%rcx
mov    %eax,0x14(%rsp,%rcx,4)
mov    0x10(%rsp),%ebp
cmp    $0x4,%ebp
jl     1160 <main+0x40>
mov    0x14(%rsp),%edx
lea    0xe68(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d\EB\B0\98? \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [15 x i8] c"%d\EB\B0\98 : %d\EA\B0\9C\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%9 = bitcast [5 x i32]* %2 to i8*
br label %10
10: ; preds = %0, %10
%11 = phi i32 [ 0, %0 ], [ %22, %10 ]
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = add nsw i32 %16, %15
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
%20 = sext i32 %12 to i64
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %20
store i32 %19, i32* %21
%22 = load i32, i32* %5
%23 = icmp slt i32 %22, 4
br i1 %23, label %10, label %24
24: ; preds = %10
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%26 = load i32, i32* %25
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %26)
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%29 = load i32, i32* %28
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %29)
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%32 = load i32, i32* %31
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %32)
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%35 = load i32, i32* %34
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %35)
ret i32 0
}