#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 */
typedef void *fdata1;
typedef int data1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int data1 = 5, data2 = 10;
  int result;
  float fdata1 = 5.0, fdata2 = 10.0;
  float fresult;
  ((result) = (data1) + (data2));
  printf("The result is %d\n", result);
  ((result) = (1) + (1));
  printf("The result is %d\n", result);
  ((fresult) = (fdata1) + (fdata2));
  printf("The floating result is %f\n", fresult);
  ((result) = (fdata1) + (fdata2));
  printf("The mixed result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
cvttss2si -0x1c(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
@.str.1 = [27 x i8] c"The floating result is %f\0A\00"
@.str.2 = [24 x i8] c"The mixed result is %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 float
store i32 0, i32* %1
store i32 5, i32* %2
store i32 10, i32* %3
store float 5.000000e+00, float* %5
store float 1.000000e+01, float* %6
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 2, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load float, float* %5
%16 = load float, float* %6
%17 = fadd float %15, %16
store float %17, float* %7
%18 = load float, float* %7
%19 = fptosi float %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load float, float* %5
%22 = load float, float* %6
%23 = fadd float %21, %22
%24 = fptosi float %23 to i32
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
@.str.1 = [27 x i8] c"The floating result is %f\0A\00"
@.str.2 = [24 x i8] c"The mixed result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 15)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 15)
ret i32 0
}