#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 *, ...);
double scanf(char *, double *);
int main() {
  double a, b, result_a, result_b;
  char *msg = "Większa liczba to: %.4f\n";
  printf("Podaj pierwsza liczbe: ");
  result_a = scanf("%lf", &a);
  if (result_a == 0) {
    printf("Error: blad w konwersji pierwszej liczby\n");
    exit(1);
  }
  printf("Podaj druga liczbe: ");
  result_b = scanf("%lf", &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    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119d <main+0x6d>
jp     119d <main+0x6d>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f0 <main+0xc0>
jp     11f0 <main+0xc0>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1215 <main+0xe5>
mov    -0x30(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1225 <main+0xf5>
mov    -0x30(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    116f <main+0x2f>
jnp    11bb <main+0x7b>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
ucomisd 0xe6a(%rip),%xmm0
jne    119a <main+0x5a>
jnp    11c4 <main+0x84>
movsd  0x10(%rsp),%xmm0
maxsd  0x8(%rsp),%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
lea    0xeb8(%rip),%rdi
jmp    11cb <main+0x8b>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Wi\C4\99ksza liczba to: %.4f\0A\00"
@.str.1 = [24 x i8] c"Podaj pierwsza liczbe: \00"
@.str.2 = [4 x i8] c"%lf\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 double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([26 x i8], [26 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 double @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %2)
store double %8, double* %4
%9 = load double, double* %4
%10 = fcmp oeq double %9, 0.000000e+00
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 double @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %3)
store double %16, double* %5
%17 = load double, double* %5
%18 = fcmp oeq double %17, 0.000000e+00
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 double, double* %2
%24 = load double, double* %3
%25 = fcmp ogt double %23, %24
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8*, i8** %6
%28 = load double, double* %2
%29 = call i32 (i8*, ...) @printf(i8* %27, double %28)
br label %34
30: ; preds = %22
%31 = load i8*, i8** %6
%32 = load double, double* %3
%33 = call i32 (i8*, ...) @printf(i8* %31, double %32)
br label %34
34: ; preds = %30, %26
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str = [26 x i8] c"Wi\C4\99ksza liczba to: %.4f\0A\00"
@.str.1 = [24 x i8] c"Podaj pierwsza liczbe: \00"
@.str.2 = [4 x i8] c"%lf\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 double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %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 double @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%7 = fcmp oeq double %6, 0.000000e+00
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 double @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %2)
%14 = fcmp oeq double %13, 0.000000e+00
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 double, double* %1
%20 = load double, double* %2
%21 = fcmp ogt double %19, %20
%22 = select i1 %21, double %19, double %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %22)
ret i32 0
}