#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 main() {
  int a, b, c;
  float res1, res2;
  int i = 0;
  for (c = 0; c < 20; c++) {
    for (b = 0; b < 20 - c; b++) {
      a = 20 - b - c;
      i++;
      res1 = a + b + c;
      res2 = 5 * a + 0.5 * b + 0.25 * c;
      if (res1 == res2) {
        if (res1 == 20) {
          printf(" Solution is %d %d %d\n", a, b, c);
          printf(" Mon  is %d %f %f\n", a * 5, b * 0.5, c * 0.25);
          printf("==============\n");
          break;
        }
      }
    }
  }
  printf("Loop = %d\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    126f <main+0x15f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x14,%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    125c <main+0x14c>
mov    $0x14,%eax
sub    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
imul   $0x5,-0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe79(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe5c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
jne    1249 <main+0x139>
jp     1249 <main+0x139>
movss  -0x14(%rbp),%xmm0
movss  0xe39(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1244 <main+0x134>
jp     1244 <main+0x134>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x5,-0x8(%rbp),%esi
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xdfa(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xde1(%rip),%xmm2
mulsd  %xmm2,%xmm1
lea    0xe01(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125c <main+0x14c>
jmp    1249 <main+0x139>
jmp    124e <main+0x13e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x2e>
jmp    1261 <main+0x151>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <main+0x1d>
mov    -0x1c(%rbp),%esi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
mov    $0x14,%r15d
mov    $0x64,%r12d
movsd  0xeba(%rip),%xmm3
movsd  0xeba(%rip),%xmm4
movss  0xec2(%rip),%xmm5
movsd  0xeb2(%rip),%xmm6
xor    %r13d,%r13d
xor    %ebp,%ebp
jmp    120d <main+0xed>
nopl   0x0(%rax,%rax,1)
mov    %r15d,%esi
sub    %ebx,%esi
lea    0xea0(%rip),%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
movsd  %xmm2,0x8(%rsp)
movsd  %xmm7,0x10(%rsp)
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xe5f(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xe59(%rip),%xmm1
lea    0xe7d(%rip),%rdi
mov    %r14d,%esi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe3c(%rip),%xmm6
movss  0xe3c(%rip),%xmm5
movsd  0xe24(%rip),%xmm4
movsd  0xe14(%rip),%xmm3
movsd  0x8(%rsp),%xmm2
add    %ebx,%r13d
add    $0x1,%r13d
addsd  %xmm6,%xmm2
add    $0x1,%ebp
add    $0xffffffff,%r15d
add    $0xfffffffb,%r12d
cmp    $0x14,%ebp
je     1264 <main+0x144>
lea    (%r15,%r13,1),%eax
mov    %r12d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
xorps  %xmm7,%xmm7
cvtsi2sd %ebx,%xmm7
movapd %xmm7,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ucomiss %xmm5,%xmm0
jne    1256 <main+0x136>
jnp    1170 <main+0x50>
add    $0x1,%ebx
add    $0xfffffffb,%r14d
jne    1220 <main+0x100>
mov    %eax,%r13d
jmp    11f9 <main+0xd9>
lea    0xddb(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c" Solution is %d %d %d\0A\00"
@.str.1 = [19 x i8] c" Mon is %d %f %f\0A\00"
@.str.2 = [16 x i8] c"==============\0A\00"
@.str.3 = [11 x i8] c"Loop = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %4
br label %8
8: ; preds = %67, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %70
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %63, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 20, %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %66
17: ; preds = %12
%18 = load i32, i32* %3
%19 = sub nsw i32 20, %18
%20 = load i32, i32* %4
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %2
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %4
%28 = add nsw i32 %26, %27
%29 = sitofp i32 %28 to float
store float %29, float* %5
%30 = load i32, i32* %2
%31 = mul nsw i32 5, %30
%32 = sitofp i32 %31 to double
%33 = load i32, i32* %3
%34 = sitofp i32 %33 to double
%35 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %34, double %32)
%36 = load i32, i32* %4
%37 = sitofp i32 %36 to double
%38 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %37, double %35)
%39 = fptrunc double %38 to float
store float %39, float* %6
%40 = load float, float* %5
%41 = load float, float* %6
%42 = fcmp oeq float %40, %41
br i1 %42, label %43, label %62
43: ; preds = %17
%44 = load float, float* %5
%45 = fcmp oeq float %44, 2.000000e+01
br i1 %45, label %46, label %61
46: ; preds = %43
%47 = load i32, i32* %2
%48 = load i32, i32* %3
%49 = load i32, i32* %4
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %47, i32 %48, i32 %49)
%51 = load i32, i32* %2
%52 = mul nsw i32 %51, 5
%53 = load i32, i32* %3
%54 = sitofp i32 %53 to double
%55 = fmul double %54, 5.000000e-01
%56 = load i32, i32* %4
%57 = sitofp i32 %56 to double
%58 = fmul double %57, 2.500000e-01
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %52, double %55, double %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %66
61: ; preds = %43
br label %62
62: ; preds = %61, %17
br label %63
63: ; preds = %62
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %12
66: ; preds = %46, %12
br label %67
67: ; preds = %66
%68 = load i32, i32* %4
%69 = add nsw i32 %68, 1
store i32 %69, i32* %4
br label %8
70: ; preds = %8
%71 = load i32, i32* %7
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %1
ret i32 %73
}

LLVM IR (-O2):
@.str = [23 x i8] c" Solution is %d %d %d\0A\00"
@.str.1 = [19 x i8] c" Mon is %d %f %f\0A\00"
@.str.3 = [11 x i8] c"Loop = %d\0A\00"
@str = [15 x i8] c"==============\00"
define i32 @main() {
br label %1
1: ; preds = %29, %0
%2 = phi i32 [ 20, %0 ], [ %32, %29 ]
%3 = phi i32 [ 0, %0 ], [ %30, %29 ]
%4 = phi i32 [ 0, %0 ], [ %31, %29 ]
%5 = sitofp i32 %4 to double
%6 = add i32 %3, %2
br label %7
7: ; preds = %1, %26
%8 = phi i32 [ %3, %1 ], [ %12, %26 ]
%9 = phi i32 [ 0, %1 ], [ %27, %26 ]
%10 = add nuw nsw i32 %4, %9
%11 = sub nsw i32 20, %10
%12 = add nsw i32 %8, 1
%13 = mul nsw i32 %11, 5
%14 = sitofp i32 %13 to double
%15 = sitofp i32 %9 to double
%16 = tail call double @llvm.fmuladd.f64(double %15, double 5.000000e-01, double %14)
%17 = tail call double @llvm.fmuladd.f64(double %5, double 2.500000e-01, double %16)
%18 = fptrunc double %17 to float
%19 = fcmp oeq float %18, 2.000000e+01
br i1 %19, label %20, label %26
20: ; preds = %7
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %9, i32 %4)
%22 = fmul double %15, 5.000000e-01
%23 = fmul double %5, 2.500000e-01
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %13, double %22, double %23)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %29
26: ; preds = %7
%27 = add nuw nsw i32 %9, 1
%28 = icmp eq i32 %27, %2
br i1 %28, label %29, label %7
29: ; preds = %26, %20
%30 = phi i32 [ %12, %20 ], [ %6, %26 ]
%31 = add nuw nsw i32 %4, 1
%32 = add nsw i32 %2, -1
%33 = icmp eq i32 %31, 20
br i1 %33, label %34, label %1
34: ; preds = %29
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %30)
ret i32 0
}