#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 *, int *);
int main() {
  int code, calls;
  printf("Enter The 5-digit Costumer Number (0 To Quit): ");
  scanf("%d", &code);
  while (code) {
    printf("Enter the Number of Calls: ");
    scanf("%d", &calls);
    printf("*****%d****** \n", code);
    calls = calls >= 100 ? calls : calls + 100;
    printf("BILL AMT: %.2f \n", 250 + (float)(calls - 100) * 1.25);
    printf("Enter The 5-digit Costumer Number (0 To Quit): ");
    scanf("%d", &code);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1201 <main+0xe1>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x64,-0xc(%rbp)
jl     119b <main+0x7b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11a4 <main+0x84>
mov    -0xc(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe40(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe3c(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
je     11fa <main+0xda>
lea    0xee7(%rip),%rbx
lea    0x4(%rsp),%r15
lea    0xefa(%rip),%r12
lea    0xf03(%rip),%r13
lea    0xe9d(%rip),%rbp
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
lea    0x64(%rax),%ecx
cmp    $0x64,%eax
cmovge %eax,%ecx
mov    %ecx,0x4(%rsp)
add    $0xffffff9c,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe33(%rip),%xmm0
addsd  0xe33(%rip),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Enter The 5-digit Costumer Number (0 To Quit): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Enter the Number of Calls: \00"
@.str.3 = [16 x i8] c"*****%d****** \0A\00"
@.str.4 = [17 x i8] c"BILL AMT: %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %31
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 100
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = load i32, i32* %3
br label %21
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 100
br label %21
21: ; preds = %18, %16
%22 = phi i32 [ %17, %16 ], [ %20, %18 ]
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 100
%25 = sitofp i32 %24 to float
%26 = fpext float %25 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 1.250000e+00, double 2.500000e+02)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %6
31: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Enter The 5-digit Costumer Number (0 To Quit): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Enter the Number of Calls: \00"
@.str.3 = [16 x i8] c"*****%d****** \0A\00"
@.str.4 = [17 x i8] c"BILL AMT: %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 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), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %27, label %9
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 99
%16 = add nsw i32 %14, 100
%17 = select i1 %15, i32 %14, i32 %16
store i32 %17, i32* %2
%18 = add nsw i32 %17, -100
%19 = sitofp i32 %18 to float
%20 = fpext float %19 to double
%21 = call double @llvm.fmuladd.f64(double %20, double 1.250000e+00, double 2.500000e+02)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%25 = load i32, i32* %1
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %9
27: ; preds = %9, %0
ret i32 0
}