#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 EXIT_SUCCESS;
float calculateExpression(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y, i;
  float result;
  printf("Please enter 2 integers: \n");
  scanf("%d %d", &x, &y);
  for (i = 0; i < 10000; ++i) {
    result = calculateExpression(x, y);
  }
  printf("Result of the expression is %f\n", result);
  return EXIT_SUCCESS;
}


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    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2710,-0x10(%rbp)
jge    1193 <main+0x63>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <calculateExpression@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1168 <main+0x38>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    $0x2710,%ebx
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <calculateExpression@plt>
add    $0xffffffff,%ebx
jne    1170 <main+0x30>
cvtss2sd %xmm0,%xmm0
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter 2 integers: \0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [32 x i8] c"Result of the expression is %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
store i32 0, i32* %4
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 10000
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call float @calculateExpression(i32 %12, i32 %13)
store float %14, float* %5
br label %15
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %8
18: ; preds = %8
%19 = load float, float* %5
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = load i32, i32* @EXIT_SUCCESS
ret i32 %22
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [32 x i8] c"Result of the expression is %f\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"Please enter 2 integers: \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 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
br label %7
7: ; preds = %0, %7
%8 = phi i32 [ 0, %0 ], [ %12, %7 ]
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call float @calculateExpression(i32 %9, i32 %10)
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, 10000
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = fpext float %11 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}