#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 *, char, char, char);
int main(int argc, char *argv[]) {
  double dSmall = 2, dBig = 100;
  int iSmall = 2, iBig = 100;
  char cSmall = 'a', cBig = 'z';
  printf("max(%.2f,%.2f) = %.2f\n", dSmall, dBig,
         ((dSmall) > (dBig) ? (dSmall) : (dBig)));
  printf("max(%d,%d) = %d\n", iSmall, iBig,
         ((iSmall) > (iBig) ? (iSmall) : (iBig)));
  printf("max(%c,%c) = %c\n", cSmall, cBig,
         ((cSmall) > (cBig) ? (cSmall) : (cBig)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x4000000000000000,%rax
mov    %rax,-0x18(%rbp)
movabs $0x4059000000000000,%rax
mov    %rax,-0x20(%rbp)
movl   $0x2,-0x24(%rbp)
movl   $0x64,-0x28(%rbp)
movb   $0x61,-0x29(%rbp)
movb   $0x7a,-0x2a(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %al,-0x2c(%rbp)
movsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x2b(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    118b <main+0x7b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1195 <main+0x85>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x2b(%rbp),%cl
mov    -0x2c(%rbp),%dl
movsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%eax
lea    0xe55(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %al,-0x3a(%rbp)
mov    -0x28(%rbp),%eax
mov    %al,-0x39(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    11dc <main+0xcc>
mov    -0x24(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    11e2 <main+0xd2>
mov    -0x28(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x39(%rbp),%cl
mov    -0x3a(%rbp),%dl
mov    -0x40(%rbp),%eax
lea    0xe25(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <printf@plt>
mov    -0x29(%rbp),%al
mov    %al,-0x42(%rbp)
mov    -0x2a(%rbp),%al
mov    %al,-0x41(%rbp)
movsbl -0x29(%rbp),%eax
movsbl -0x2a(%rbp),%ecx
cmp    %ecx,%eax
jle    1228 <main+0x118>
movsbl -0x29(%rbp),%eax
mov    %eax,-0x48(%rbp)
jmp    122f <main+0x11f>
movsbl -0x2a(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x41(%rbp),%cl
mov    -0x42(%rbp),%dl
mov    -0x48(%rbp),%eax
lea    0xde9(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x2,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x61,%esi
mov    $0x7a,%edx
mov    $0x7a,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"max(%.2f,%.2f) = %.2f\0A\00"
@.str.1 = [17 x i8] c"max(%d,%d) = %d\0A\00"
@.str.2 = [17 x i8] c"max(%c,%c) = %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 2.000000e+00, double* %6
store double 1.000000e+02, double* %7
store i32 2, i32* %8
store i32 100, i32* %9
store i8 97, i8* %10
store i8 122, i8* %11
%12 = load double, double* %6
%13 = fptosi double %12 to i8
%14 = load double, double* %7
%15 = fptosi double %14 to i8
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fcmp ogt double %16, %17
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = load double, double* %6
br label %23
21: ; preds = %2
%22 = load double, double* %7
br label %23
23: ; preds = %21, %19
%24 = phi double [ %20, %19 ], [ %22, %21 ]
%25 = fptosi double %24 to i8
%26 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %13, i8 signext %15, i8 signext %25)
%27 = load i32, i32* %8
%28 = trunc i32 %27 to i8
%29 = load i32, i32* %9
%30 = trunc i32 %29 to i8
%31 = load i32, i32* %8
%32 = load i32, i32* %9
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %36
34: ; preds = %23
%35 = load i32, i32* %8
br label %38
36: ; preds = %23
%37 = load i32, i32* %9
br label %38
38: ; preds = %36, %34
%39 = phi i32 [ %35, %34 ], [ %37, %36 ]
%40 = trunc i32 %39 to i8
%41 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8 signext %28, i8 signext %30, i8 signext %40)
%42 = load i8, i8* %10
%43 = load i8, i8* %11
%44 = load i8, i8* %10
%45 = sext i8 %44 to i32
%46 = load i8, i8* %11
%47 = sext i8 %46 to i32
%48 = icmp sgt i32 %45, %47
br i1 %48, label %49, label %52
49: ; preds = %38
%50 = load i8, i8* %10
%51 = sext i8 %50 to i32
br label %55
52: ; preds = %38
%53 = load i8, i8* %11
%54 = sext i8 %53 to i32
br label %55
55: ; preds = %52, %49
%56 = phi i32 [ %51, %49 ], [ %54, %52 ]
%57 = trunc i32 %56 to i8
%58 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8 signext %42, i8 signext %43, i8 signext %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"max(%.2f,%.2f) = %.2f\0A\00"
@.str.1 = [17 x i8] c"max(%d,%d) = %d\0A\00"
@.str.2 = [17 x i8] c"max(%c,%c) = %c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext 2, i8 signext 100, i8 signext 100)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8 signext 2, i8 signext 100, i8 signext 100)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8 signext 97, i8 signext 122, i8 signext 122)
ret i32 0
}