#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(char *, double *, double *, double *);
int main(void) {
  double x, y, z, valSum, largest;
  printf("세 실수를 과학적 표기법으로 입력해주세요. 구분은 ,(콤마)로 합니다. ");
  scanf("%lf, %lf, %lf", &x, &y, &z);
  valSum = x + y + z;
  largest = (z > (x > y ? x : y) ? z : (x > y ? x : y));
  printf("10진법 표기법으로 표현하면, 합 = %lf, 최대값은 %lf입니다.\n", valSum,
         largest);
  printf("과학적 표기법으로 표현하면, 합 = %e, 최대값은 %e입니다.  \n", valSum,
         largest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1192 <main+0x72>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    119c <main+0x7c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11bf <main+0x9f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11f2 <main+0xd2>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11de <main+0xbe>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11e8 <main+0xc8>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe60(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe96(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm3
movapd %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
maxsd  %xmm3,%xmm0
maxsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xee8(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf24(%rip),%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [95 x i8] c"\EC\84\B8 \EC\8B\A4\EC\88\98\EB\A5\BC \EA\B3\BC\ED\95\99\EC\A0\81 \ED\91\9C\EA\B8\B0\EB\B2\95\EC\9C\BC\EB\A1\9C \EC\9E\85\EB\A0\A5\ED\95\B4\EC\A3\BC\EC\84\B8\EC\9A\94. \EA\B5\AC\EB\B6\84\EC\9D\80 ,(\EC\BD\A4\EB\A7\88)\EB\A1\9C \ED\95\A9\EB\8B\88\EB\8B\A4. \00"
@.str.1 = [14 x i8] c"%lf, %lf, %lf\00"
@.str.2 = [78 x i8] c"10\EC\A7\84\EB\B2\95 \ED\91\9C\EA\B8\B0\EB\B2\95\EC\9C\BC\EB\A1\9C \ED\91\9C\ED\98\84\ED\95\98\EB\A9\B4, \ED\95\A9 = %lf, \EC\B5\9C\EB\8C\80\EA\B0\92\EC\9D\80 %lf\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\00"
@.str.3 = [79 x i8] c"\EA\B3\BC\ED\95\99\EC\A0\81 \ED\91\9C\EA\B8\B0\EB\B2\95\EC\9C\BC\EB\A1\9C \ED\91\9C\ED\98\84\ED\95\98\EB\A9\B4, \ED\95\A9 = %e, \EC\B5\9C\EB\8C\80\EA\B0\92\EC\9D\80 %e\EC\9E\85\EB\8B\88\EB\8B\A4. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fadd double %9, %10
%12 = load double, double* %4
%13 = fadd double %11, %12
store double %13, double* %5
%14 = load double, double* %4
%15 = load double, double* %2
%16 = load double, double* %3
%17 = fcmp ogt double %15, %16
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = load double, double* %2
br label %22
20: ; preds = %0
%21 = load double, double* %3
br label %22
22: ; preds = %20, %18
%23 = phi double [ %19, %18 ], [ %21, %20 ]
%24 = fcmp ogt double %14, %23
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = load double, double* %4
br label %37
27: ; preds = %22
%28 = load double, double* %2
%29 = load double, double* %3
%30 = fcmp ogt double %28, %29
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load double, double* %2
br label %35
33: ; preds = %27
%34 = load double, double* %3
br label %35
35: ; preds = %33, %31
%36 = phi double [ %32, %31 ], [ %34, %33 ]
br label %37
37: ; preds = %35, %25
%38 = phi double [ %26, %25 ], [ %36, %35 ]
store double %38, double* %6
%39 = load double, double* %5
%40 = load double, double* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), double %39, double %40)
%42 = load double, double* %5
%43 = load double, double* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0), double %42, double %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [95 x i8] c"\EC\84\B8 \EC\8B\A4\EC\88\98\EB\A5\BC \EA\B3\BC\ED\95\99\EC\A0\81 \ED\91\9C\EA\B8\B0\EB\B2\95\EC\9C\BC\EB\A1\9C \EC\9E\85\EB\A0\A5\ED\95\B4\EC\A3\BC\EC\84\B8\EC\9A\94. \EA\B5\AC\EB\B6\84\EC\9D\80 ,(\EC\BD\A4\EB\A7\88)\EB\A1\9C \ED\95\A9\EB\8B\88\EB\8B\A4. \00"
@.str.1 = [14 x i8] c"%lf, %lf, %lf\00"
@.str.2 = [78 x i8] c"10\EC\A7\84\EB\B2\95 \ED\91\9C\EA\B8\B0\EB\B2\95\EC\9C\BC\EB\A1\9C \ED\91\9C\ED\98\84\ED\95\98\EB\A9\B4, \ED\95\A9 = %lf, \EC\B5\9C\EB\8C\80\EA\B0\92\EC\9D\80 %lf\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\00"
@.str.3 = [79 x i8] c"\EA\B3\BC\ED\95\99\EC\A0\81 \ED\91\9C\EA\B8\B0\EB\B2\95\EC\9C\BC\EB\A1\9C \ED\91\9C\ED\98\84\ED\95\98\EB\A9\B4, \ED\95\A9 = %e, \EC\B5\9C\EB\8C\80\EA\B0\92\EC\9D\80 %e\EC\9E\85\EB\8B\88\EB\8B\A4. \0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fadd double %9, %10
%12 = load double, double* %3
%13 = fadd double %11, %12
%14 = fcmp ogt double %9, %10
%15 = select i1 %14, double %9, double %10
%16 = fcmp ogt double %12, %15
%17 = select i1 %16, double %12, double %15
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), double %13, double %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0), double %13, double %17)
ret i32 0
}