#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);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int a, b, c;
  float fsmax(float x, float y);
  scanf("%d %d", &a, &b);
  c = max(a, b);
  printf("Max is %d\n", c);
  c = fsmax(3.9, 4.2);
  printf("Max is %d\n", c);
  printf("Max is %f\n", c);
  printf("Max is %d\n", fsmax(3.9, 4.2));
  printf("Max float is %f\n", fsmax(3.5, 5.2));
  printf("Max float is %f\n", 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
movss  0xe87(%rip),%xmm0
movss  0xe83(%rip),%xmm1
call   1060 <fsmax@plt>
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
movss  0xe4d(%rip),%xmm0
movss  0xe49(%rip),%xmm1
call   1060 <fsmax@plt>
cvttss2si %xmm0,%esi
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
movss  0xe20(%rip),%xmm0
movss  0xe1c(%rip),%xmm1
call   1060 <fsmax@plt>
cvttss2si %xmm0,%esi
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
lea    0xe28(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <max@plt>
lea    0xeac(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xe84(%rip),%xmm0
movss  0xe80(%rip),%xmm1
call   1060 <fsmax@plt>
cvttss2si %xmm0,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
movss  0xe53(%rip),%xmm0
movss  0xe4f(%rip),%xmm1
call   1060 <fsmax@plt>
cvttss2si %xmm0,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe3a(%rip),%xmm0
movss  0xe36(%rip),%xmm1
call   1060 <fsmax@plt>
cvttss2si %xmm0,%esi
lea    0xe46(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"Max is %d\0A\00"
@.str.2 = [11 x i8] c"Max is %f\0A\00"
@.str.3 = [17 x i8] c"Max float is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @max(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call float @fsmax(float 0x400F333340000000, float 0x4010CCCCC0000000)
%11 = fptosi float %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call float @fsmax(float 0x400F333340000000, float 0x4010CCCCC0000000)
%17 = fptosi float %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call float @fsmax(float 3.500000e+00, float 0x4014CCCCC0000000)
%20 = fptosi float %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"Max is %d\0A\00"
@.str.2 = [11 x i8] c"Max is %f\0A\00"
@.str.3 = [17 x i8] c"Max float is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @max(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call float @fsmax(float 0x400F333340000000, float 0x4010CCCCC0000000)
%11 = fptosi float %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%14 = call float @fsmax(float 0x400F333340000000, float 0x4010CCCCC0000000)
%15 = fptosi float %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call float @fsmax(float 3.500000e+00, float 0x4014CCCCC0000000)
%18 = fptosi float %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 5)
ret i32 0
}