#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 *, double *);
int main(int argc, const char *argv[]) {
  double start, rate;
  printf("Interest calculation program.\n");
  printf("Starting balance? ");
  scanf("%lf", &start);
  printf("Annual interest rate percentage? ");
  scanf("%lf", &rate);
  printf("Balance after one year: %.0lf\n", start * (1 + 0.01 * rate));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe6e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe6a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x1,%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    0xf2c(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xe77(%rip),%xmm0
addsd  0xe77(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Interest calculation program.\0A\00"
@.str.1 = [19 x i8] c"Starting balance? \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [34 x i8] c"Annual interest rate percentage? \00"
@.str.4 = [31 x i8] c"Balance after one year: %.0lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %7)
%13 = load double, double* %6
%14 = load double, double* %7
%15 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %14, double 1.000000e+00)
%16 = fmul double %13, %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Starting balance? \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [34 x i8] c"Annual interest rate percentage? \00"
@.str.4 = [31 x i8] c"Balance after one year: %.0lf\0A\00"
@str = [30 x i8] c"Interest calculation program.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %3)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @llvm.fmuladd.f64(double %13, double 1.000000e-02, double 1.000000e+00)
%15 = fmul double %12, %14
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %15)
ret i32 0
}