#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*/ EXIT_SUCCESS;
double add_six(double, double, double, int, int, int);
int add_two(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mem_a(int **, int const);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ put_a(int *, int const);
int /*<<< orphan*/ set_a(int *, int const);
int main(void) {
  printf("sum2 = %d \n", add_two(31, 7));
  printf("sum6 = %f \n", add_six(0.1, 0.2, 0.3, 4, 5, 6));
  const int N = 10;
  int *a;
  mem_a(&a, N);
  set_a(a, N);
  put_a(a, N);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f,%edi
mov    $0x7,%esi
call   1060 <add_two@plt>
cvtsi2sd %eax,%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe5a(%rip),%xmm0
movsd  0xe5a(%rip),%xmm1
movsd  0xe5a(%rip),%xmm2
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1080 <add_six@plt>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <mem_a@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <set_a@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1070 <put_a@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f,%edi
mov    $0x7,%esi
call   1060 <add_two@plt>
cvtsi2sd %eax,%xmm0
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe68(%rip),%xmm0
movsd  0xe68(%rip),%xmm1
movsd  0xe68(%rip),%xmm2
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1080 <add_six@plt>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <mem_a@plt>
mov    (%rsp),%rdi
mov    $0xa,%esi
call   1050 <set_a@plt>
mov    (%rsp),%rdi
mov    $0xa,%esi
call   1070 <put_a@plt>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"sum2 = %d \0A\00"
@.str.1 = [12 x i8] c"sum6 = %f \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 @add_two(i32 31, i32 7)
%5 = sitofp i32 %4 to double
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %5)
%7 = call double @add_six(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, i32 4, i32 5, i32 6)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %7)
store i32 10, i32* %2
%9 = call i32 @mem_a(i32** %3, i32 10)
%10 = load i32*, i32** %3
%11 = call i32 @set_a(i32* %10, i32 10)
%12 = load i32*, i32** %3
%13 = call i32 @put_a(i32* %12, i32 10)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"sum2 = %d \0A\00"
@.str.1 = [12 x i8] c"sum6 = %f \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32*
%2 = tail call i32 @add_two(i32 31, i32 7)
%3 = sitofp i32 %2 to double
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double @add_six(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, i32 4, i32 5, i32 6)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = bitcast i32** %1 to i8*
%8 = call i32 @mem_a(i32** %1, i32 10)
%9 = load i32*, i32** %1
%10 = call i32 @set_a(i32* %9, i32 10)
%11 = load i32*, i32** %1
%12 = call i32 @put_a(i32* %11, i32 10)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = call i32 @exit(i32 %13)
unreachable
}