#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *);
int main() {
  int a, b, result_a, result_b;
  char *msg = "Większa liczba to: %d\n";
  printf("Podaj pierwsza liczbe: ");
  result_a = scanf("%d", &a);
  if (result_a == 0) {
    printf("Error: blad w konwersji pierwszej liczby\n");
    exit(1);
  }
  printf("Podaj druga liczbe: ");
  result_b = scanf("%d", &b);
  if (result_b == 0) {
    printf("Error: blad w konwersji drugiej liczby\n");
    exit(1);
  }
  if (a > b) {
    printf(msg, a);
  } else {
    printf(msg, b);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    118d <main+0x5d>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11d0 <main+0xa0>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11ef <main+0xbf>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fd <main+0xcd>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
test   %eax,%eax
je     11a3 <main+0x63>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
test   %eax,%eax
je     11ac <main+0x6c>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec5(%rip),%rdi
jmp    11b3 <main+0x73>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Wi\C4\99ksza liczba to: %d\0A\00"
@.str.1 = [24 x i8] c"Podaj pierwsza liczbe: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [42 x i8] c"Error: blad w konwersji pierwszej liczby\0A\00"
@.str.4 = [21 x i8] c"Podaj druga liczbe: \00"
@.str.5 = [40 x i8] c"Error: blad w konwersji drugiej liczby\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %14
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8*, i8** %6
%28 = load i32, i32* %2
%29 = call i32 (i8*, ...) @printf(i8* %27, i32 %28)
br label %34
30: ; preds = %22
%31 = load i8*, i8** %6
%32 = load i32, i32* %3
%33 = call i32 (i8*, ...) @printf(i8* %31, i32 %32)
br label %34
34: ; preds = %30, %26
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str = [24 x i8] c"Wi\C4\99ksza liczba to: %d\0A\00"
@.str.1 = [24 x i8] c"Podaj pierwsza liczbe: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.4 = [21 x i8] c"Podaj druga liczbe: \00"
@str = [39 x i8] c"Error: blad w konwersji drugiej liczby\00"
@str.6 = [41 x i8] c"Error: blad w konwersji pierwszej liczby\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %11
%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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}