#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 *, int *);
int main() {
  int a, b, c;
  printf("Wprowadź trzy liczby całkowite: \n");
  scanf("%d %d %d", &a, &b, &c);
  printf("Suma wynosi: %d\n", a + b + c);
  printf("Iloczyn wynosi: %d\n", a * b * c);
  if (a < b && a < c) {
    printf("Najmniejsza liczba to: %d\n", a);
  } else if (b < a && b < c) {
    printf("Najmniejsza liczba to: %d\n", b);
  } else {
    printf("Najmniejsza liczba to: %d\n", c);
  }
  if (a > b && a > c) {
    printf("Największa liczba to: %d\n", a);
  } else if (b > a && b > c) {
    printf("Największa liczba to: %d\n", b);
  } else {
    printf("Największa liczba to: %d\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    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b3 <main+0x93>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b3 <main+0x93>
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e1 <main+0xc1>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e1 <main+0xc1>
mov    -0xc(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xd2>
mov    -0x10(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1225 <main+0x105>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1225 <main+0x105>
mov    -0x8(%rbp),%esi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1269 <main+0x149>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1253 <main+0x133>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1253 <main+0x133>
mov    -0xc(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1264 <main+0x144>
mov    -0x10(%rbp),%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1269 <main+0x149>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x10(%rsp),%esi
add    0x14(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
imul   0xc(%rsp),%esi
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
mov    %ecx,%edx
cmovl  %eax,%edx
mov    0x14(%rsp),%edi
cmp    %edi,%eax
cmovge %ecx,%edx
cmp    %ecx,%edi
mov    %edx,%esi
cmovl  %edi,%esi
cmp    %eax,%edi
cmovge %edx,%esi
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
mov    %ecx,%edx
cmovg  %eax,%edx
mov    0x14(%rsp),%edi
cmp    %edi,%eax
cmovle %ecx,%edx
cmp    %ecx,%edi
mov    %edx,%esi
cmovg  %edi,%esi
cmp    %eax,%edi
cmovle %edx,%esi
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Wprowad\C5\BA trzy liczby ca\C5\82kowite: \0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [17 x i8] c"Suma wynosi: %d\0A\00"
@.str.3 = [20 x i8] c"Iloczyn wynosi: %d\0A\00"
@.str.4 = [27 x i8] c"Najmniejsza liczba to: %d\0A\00"
@.str.5 = [27 x i8] c"Najwi\C4\99ksza liczba to: %d\0A\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 ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %29
22: ; preds = %0
%23 = load i32, i32* %2
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %27)
br label %44
29: ; preds = %22, %0
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %40
33: ; preds = %29
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = load i32, i32* %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %38)
br label %43
40: ; preds = %33, %29
%41 = load i32, i32* %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %37
br label %44
44: ; preds = %43, %26
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = icmp sgt i32 %45, %46
br i1 %47, label %48, label %55
48: ; preds = %44
%49 = load i32, i32* %2
%50 = load i32, i32* %4
%51 = icmp sgt i32 %49, %50
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* %2
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %53)
br label %70
55: ; preds = %48, %44
%56 = load i32, i32* %3
%57 = load i32, i32* %2
%58 = icmp sgt i32 %56, %57
br i1 %58, label %59, label %66
59: ; preds = %55
%60 = load i32, i32* %3
%61 = load i32, i32* %4
%62 = icmp sgt i32 %60, %61
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i32, i32* %3
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %64)
br label %69
66: ; preds = %59, %55
%67 = load i32, i32* %4
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %66, %63
br label %70
70: ; preds = %69, %52
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [17 x i8] c"Suma wynosi: %d\0A\00"
@.str.3 = [20 x i8] c"Iloczyn wynosi: %d\0A\00"
@.str.4 = [27 x i8] c"Najmniejsza liczba to: %d\0A\00"
@.str.5 = [27 x i8] c"Najwi\C4\99ksza liczba to: %d\0A\00"
@str = [35 x i8] c"Wprowad\C5\BA 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 ([35 x i8], [35 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, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, %15
%18 = load i32, i32* %3
%19 = mul nsw i32 %17, %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = icmp slt i32 %21, %22
%24 = load i32, i32* %3
%25 = icmp slt i32 %21, %24
%26 = select i1 %23, i1 %25, i1 false
%27 = icmp slt i32 %22, %21
%28 = icmp slt i32 %22, %24
%29 = select i1 %27, i1 %28, i1 false
%30 = select i1 %29, i32 %22, i32 %24
%31 = select i1 %26, i32 %21, i32 %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = icmp sgt i32 %33, %34
%36 = load i32, i32* %3
%37 = icmp sgt i32 %33, %36
%38 = select i1 %35, i1 %37, i1 false
%39 = icmp sgt i32 %34, %33
%40 = icmp sgt i32 %34, %36
%41 = select i1 %39, i1 %40, i1 false
%42 = select i1 %41, i32 %34, i32 %36
%43 = select i1 %38, i32 %33, i32 %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %43)
ret i32 0
}