#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 *, int *);
int main() {
  int a;
  int b;
  int c;
  printf("Podaj trzy liczby całkowite:\n");
  scanf("%i\n", &a);
  scanf("%i\n", &b);
  scanf("%i", &c);
  printf("Najwieksze jest: ");
  if (a > b)
    if (a > c)
      printf("%i\n", a);
    else
      printf("%i\n", c);
  else if (b > c)
    printf("%i\n", b);
  else
    printf("%i\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11bf <main+0x9f>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11a9 <main+0x89>
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ba <main+0x9a>
mov    -0x10(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11e1 <main+0xc1>
mov    -0xc(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xd2>
mov    -0x10(%rbp),%esi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe9b(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
mov    0x4(%rsp),%eax
cmp    %eax,%esi
cmovle %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Podaj trzy liczby ca\C5\82kowite:\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [18 x i8] c"Najwieksze jest: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %0
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %23
20: ; preds = %13
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %17
br label %35
24: ; preds = %0
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %34
31: ; preds = %24
%32 = load i32, i32* %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31, %28
br label %35
35: ; preds = %34, %23
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [18 x i8] c"Najwieksze jest: \00"
@str = [30 x i8] c"Podaj trzy liczby ca\C5\82kowite:\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = icmp sgt i32 %12, %13
%15 = load i32, i32* %3
%16 = select i1 %14, i32 %12, i32 %13
%17 = icmp sgt i32 %16, %15
%18 = select i1 %17, i32 %16, i32 %15
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}