#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 scanf(char *, int *);
int main(void) {
  int a, b, c, max;
  printf("入力1: ");
  if (scanf("%d%*[^\n]", &a) != 1) {
    return 1;
  }
  printf("入力2: ");
  if (scanf("%d%*[^\n]", &b) != 1) {
    return 1;
  }
  printf("入力3: ");
  if (scanf("%d%*[^\n]", &c) != 1) {
    return 1;
  }
  max = (a > b) ? a : b;
  max = (max > c) ? max : c;
  printf("最大値: %d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1162 <main+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1226 <main+0x106>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1195 <main+0x75>
movl   $0x1,-0x4(%rbp)
jmp    1226 <main+0x106>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     11c8 <main+0xa8>
movl   $0x1,-0x4(%rbp)
jmp    1226 <main+0x106>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11df <main+0xbf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11e5 <main+0xc5>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1202 <main+0xe2>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1208 <main+0xe8>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%ebx
cmp    $0x1,%eax
jne    11bc <main+0x9c>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11bc <main+0x9c>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11bc <main+0x9c>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
mov    0x4(%rsp),%eax
cmp    %eax,%esi
cmovle %eax,%esi
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\E5\85\A5\E5\8A\9B1: \00"
@.str.1 = [9 x i8] c"%d%*[^\0A]\00"
@.str.2 = [10 x i8] c"\E5\85\A5\E5\8A\9B2: \00"
@.str.3 = [10 x i8] c"\E5\85\A5\E5\8A\9B3: \00"
@.str.4 = [15 x i8] c"\E6\9C\80\E5\A4\A7\E5\80\A4: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %41
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %41
15: ; preds = %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%18 = icmp ne i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %1
br label %41
20: ; preds = %15
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %2
br label %28
26: ; preds = %20
%27 = load i32, i32* %3
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
store i32 %29, i32* %5
%30 = load i32, i32* %5
%31 = load i32, i32* %4
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = load i32, i32* %5
br label %37
35: ; preds = %28
%36 = load i32, i32* %4
br label %37
37: ; preds = %35, %33
%38 = phi i32 [ %34, %33 ], [ %36, %35 ]
store i32 %38, i32* %5
%39 = load i32, i32* %5
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %39)
store i32 0, i32* %1
br label %41
41: ; preds = %37, %19, %14, %9
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [10 x i8] c"\E5\85\A5\E5\8A\9B1: \00"
@.str.1 = [9 x i8] c"%d%*[^\0A]\00"
@.str.2 = [10 x i8] c"\E5\85\A5\E5\8A\9B2: \00"
@.str.3 = [10 x i8] c"\E5\85\A5\E5\8A\9B3: \00"
@.str.4 = [15 x i8] c"\E6\9C\80\E5\A4\A7\E5\80\A4: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %27
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load i32, i32* %1
%20 = load i32, i32* %2
%21 = icmp sgt i32 %19, %20
%22 = select i1 %21, i32 %19, i32 %20
%23 = load i32, i32* %3
%24 = icmp sgt i32 %22, %23
%25 = select i1 %24, i32 %22, i32 %23
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %14, %10, %0, %18
%28 = phi i32 [ 0, %18 ], [ 1, %0 ], [ 1, %10 ], [ 1, %14 ]
ret i32 %28
}