#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 max(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a, b, c, d, q, w, t;
  printf("\n a=");
  scanf("%d", &a);
  printf("\n b=");
  scanf("%d", &b);
  printf("\n c=");
  scanf("%d", &c);
  printf("\n d=");
  scanf("%d", &d);
  q = max(a, b);
  w = max(a, c);
  t = max(a, d);
  a = max(q, w);
  b = max(a, t);
  printf("\n Максимальное значение=%d \n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe75(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1040 <max@plt>
mov    %eax,%r14d
mov    (%rsp),%edi
mov    0xc(%rsp),%esi
call   1040 <max@plt>
mov    %eax,%ebp
mov    (%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <max@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %ebp,%esi
call   1040 <max@plt>
mov    %eax,(%rsp)
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <max@plt>
mov    %eax,0x4(%rsp)
lea    0xe22(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0A a=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A b=\00"
@.str.3 = [5 x i8] c"\0A c=\00"
@.str.4 = [5 x i8] c"\0A d=\00"
@.str.5 = [49 x i8] c"\0A \D0\9C\D0\B0\D0\BA\D1\81\D0\B8\D0\BC\D0\B0\D0\BB\D1\8C\D0\BD\D0\BE\D0\B5 \D0\B7\D0\BD\D0\B0\D1\87\D0\B5\D0\BD\D0\B8\D0\B5=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @max(i32 %17, i32 %18)
store i32 %19, i32* %6
%20 = load i32, i32* %2
%21 = load i32, i32* %4
%22 = call i32 @max(i32 %20, i32 %21)
store i32 %22, i32* %7
%23 = load i32, i32* %2
%24 = load i32, i32* %5
%25 = call i32 @max(i32 %23, i32 %24)
store i32 %25, i32* %8
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = call i32 @max(i32 %26, i32 %27)
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = load i32, i32* %8
%31 = call i32 @max(i32 %29, i32 %30)
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A a=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A b=\00"
@.str.3 = [5 x i8] c"\0A c=\00"
@.str.4 = [5 x i8] c"\0A d=\00"
@.str.5 = [49 x i8] c"\0A \D0\9C\D0\B0\D0\BA\D1\81\D0\B8\D0\BC\D0\B0\D0\BB\D1\8C\D0\BD\D0\BE\D0\B5 \D0\B7\D0\BD\D0\B0\D1\87\D0\B5\D0\BD\D0\B8\D0\B5=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 @max(i32 %17, i32 %18)
%20 = load i32, i32* %1
%21 = load i32, i32* %3
%22 = call i32 @max(i32 %20, i32 %21)
%23 = load i32, i32* %1
%24 = load i32, i32* %4
%25 = call i32 @max(i32 %23, i32 %24)
%26 = call i32 @max(i32 %19, i32 %22)
store i32 %26, i32* %1
%27 = call i32 @max(i32 %26, i32 %25)
store i32 %27, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %27)
ret i32 0
}