#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 */
double chia(int, int);
int cong(int, int);
double nhan(int, int);
int /*<<< orphan*/ printf(char *, double);
int tru(int, int);
int main(int argc, char *argv[]) {
  int a = 10;
  int b = 5;
  printf("\n tong 2 so la %d", cong(a, b));
  printf("\n hieu 2 so la %d", tru(a, b));
  printf("\n tich 2 so la %f", nhan(a, b));
  printf("\n chia 2 so la %f", chia(a, b));
  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)
movl   $0xa,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <cong@plt>
cvtsi2sd %eax,%xmm0
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1070 <tru@plt>
cvtsi2sd %eax,%xmm0
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <nhan@plt>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <chia@plt>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x5,%esi
call   1050 <cong@plt>
cvtsi2sd %eax,%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x5,%esi
call   1070 <tru@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x5,%esi
call   1060 <nhan@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x5,%esi
call   1040 <chia@plt>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0A tong 2 so la %d\00"
@.str.1 = [18 x i8] c"\0A hieu 2 so la %d\00"
@.str.2 = [18 x i8] c"\0A tich 2 so la %f\00"
@.str.3 = [18 x i8] c"\0A chia 2 so la %f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 5, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @cong(i32 %8, i32 %9)
%11 = sitofp i32 %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 @tru(i32 %13, i32 %14)
%16 = sitofp i32 %15 to double
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call double @nhan(i32 %18, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = call double @chia(i32 %22, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A tong 2 so la %d\00"
@.str.1 = [18 x i8] c"\0A hieu 2 so la %d\00"
@.str.2 = [18 x i8] c"\0A tich 2 so la %f\00"
@.str.3 = [18 x i8] c"\0A chia 2 so la %f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @cong(i32 10, i32 5)
%4 = sitofp i32 %3 to double
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %4)
%6 = tail call i32 @tru(i32 10, i32 5)
%7 = sitofp i32 %6 to double
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = tail call double @nhan(i32 10, i32 5)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = tail call double @chia(i32 10, i32 5)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %11)
ret i32 0
}