#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, float *, float *);
int main(void) {
  float x, y;
  printf("pls input two digits: ");
  while (scanf("%f%f", &x, &y) != 2 || getchar() != '\n') {
    while (getchar() != '\n')
      ;
    printf("input invalid!\n");
    printf("pls input two digits: ");
  }
  printf("the MIN one is: %f\n", (((x) > (y)) ? (y) : (x)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x2,%ecx
mov    %al,-0xd(%rbp)
jne    1184 <main+0x54>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1194 <main+0x64>
jmp    11d2 <main+0xa2>
jmp    1199 <main+0x69>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     11b1 <main+0x81>
jmp    1199 <main+0x69>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114d <main+0x1d>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11f0 <main+0xc0>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11fa <main+0xca>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe22(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeac(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb2(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
lea    0xeba(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    11a0 <main+0x60>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
je     11bf <main+0x7f>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    11a0 <main+0x60>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <main+0x40>
movss  0x8(%rsp),%xmm0
minss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe46(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"pls input two digits: \00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [16 x i8] c"input invalid!\0A\00"
@.str.3 = [20 x i8] c"the MIN one is: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %20, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%7 = icmp ne i32 %6, 2
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = call signext i8 (...) @getchar()
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ true, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %23
14: ; preds = %12
br label %15
15: ; preds = %19, %14
%16 = call signext i8 (...) @getchar()
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 10
br i1 %18, label %19, label %20
19: ; preds = %15
br label %15
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
23: ; preds = %12
%24 = load float, float* %2
%25 = load float, float* %3
%26 = fcmp ogt float %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load float, float* %3
br label %31
29: ; preds = %23
%30 = load float, float* %2
br label %31
31: ; preds = %29, %27
%32 = phi float [ %28, %27 ], [ %30, %29 ]
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"pls input two digits: \00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.3 = [20 x i8] c"the MIN one is: %f\0A\00"
@str = [15 x i8] c"input invalid!\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %16, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 10
br i1 %11, label %19, label %12
12: ; preds = %6, %9
br label %13
13: ; preds = %12, %13
%14 = call signext i8 (...) @getchar()
%15 = icmp eq i8 %14, 10
br i1 %15, label %16, label %13
16: ; preds = %13
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
19: ; preds = %9
%20 = load float, float* %1
%21 = load float, float* %2
%22 = fcmp ogt float %20, %21
%23 = select i1 %22, float %21, float %20
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %24)
ret i32 0
}