#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float a, b, c, d;
  printf("\n a=");
  scanf("%f", &a);
  printf("\n b=");
  scanf("%f", &b);
  c = a + b;
  if (c = 1)
    printf("\n c=1 \n");
  else {
    if (c < 1) {
      if (a < b)
        a = c / 2;
      if (b < a)
        b = c / 2;
    } else {
      if (a < b)
        a = c;
      if (b > a)
        b = c;
    }
  }
  printf("\n a=%f , b=%f \n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe7e(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1196 <main+0x76>
jmp    11a9 <main+0x89>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x132>
movss  0xe4f(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1212 <main+0xf2>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11e4 <main+0xc4>
movss  -0x10(%rbp),%xmm0
movss  0xe29(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    120d <main+0xed>
movss  -0x10(%rbp),%xmm0
movss  0xe00(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    124d <main+0x12d>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    122f <main+0x10f>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1248 <main+0x128>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    124d <main+0x12d>
jmp    1252 <main+0x132>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdb2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe74(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0A a=\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [5 x i8] c"\0A b=\00"
@.str.3 = [8 x i8] c"\0A c=1 \0A\00"
@.str.4 = [16 x i8] c"\0A a=%f , b=%f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = load float, float* %2
%11 = load float, float* %3
%12 = fadd float %10, %11
store float %12, float* %4
store float 1.000000e+00, float* %4
br i1 true, label %13, label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %47
15: ; preds = %0
%16 = load float, float* %4
%17 = fcmp olt float %16, 1.000000e+00
br i1 %17, label %18, label %33
18: ; preds = %15
%19 = load float, float* %2
%20 = load float, float* %3
%21 = fcmp olt float %19, %20
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load float, float* %4
%24 = fdiv float %23, 2.000000e+00
store float %24, float* %2
br label %25
25: ; preds = %22, %18
%26 = load float, float* %3
%27 = load float, float* %2
%28 = fcmp olt float %26, %27
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load float, float* %4
%31 = fdiv float %30, 2.000000e+00
store float %31, float* %3
br label %32
32: ; preds = %29, %25
br label %46
33: ; preds = %15
%34 = load float, float* %2
%35 = load float, float* %3
%36 = fcmp olt float %34, %35
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load float, float* %4
store float %38, float* %2
br label %39
39: ; preds = %37, %33
%40 = load float, float* %3
%41 = load float, float* %2
%42 = fcmp ogt float %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load float, float* %4
store float %44, float* %3
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45, %32
br label %47
47: ; preds = %46, %13
%48 = load float, float* %2
%49 = fpext float %48 to double
%50 = load float, float* %3
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %49, double %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A a=\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [5 x i8] c"\0A b=\00"
@.str.4 = [16 x i8] c"\0A a=%f , b=%f \0A\00"
@str = [7 x i8] c"\0A c=1 \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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %11, double %13)
ret i32 0
}