int main() {
  int x = 10;
  int y = 5;
  int a = soma(x, y);
  printf("%5d + %05d = %05d\n", x, y, a);
  printf("%05d + %05d = %05d\n", 100, 2, 102);
  printf("%05d + %05d = %05d\n", 500, 350000, 4000);
  printf("Isso é um float: %25.15f\n", 7 / 5.0);
  printf("Isso é um float: %.4f\n", extract(3.1415));
  printf("O 3o Digito de %d é %d\n", 15738, extract3Digit(15738));
  printf("Hello %s\n", "world!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1050 <soma@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x64,%esi
mov    $0x2,%edx
mov    $0x66,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
mov    $0x1f4,%esi
mov    $0x55730,%edx
mov    $0xfa0,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe72(%rip),%rdi
movsd  0xe3b(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe24(%rip),%xmm0
mov    $0x1,%al
call   1060 <extract@plt>
mov    %eax,%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3d7a,%edi
mov    $0x0,%al
call   1030 <extract3Digit@plt>
mov    %eax,%edx
lea    0xe62(%rip),%rdi
mov    $0x3d7a,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <soma@plt>
lea    0xeb7(%rip),%rdi
mov    $0xa,%esi
mov    $0x5,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x2,%edx
mov    $0x66,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1f4,%esi
mov    $0x55730,%edx
mov    $0xfa0,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
movsd  0xe4c(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe45(%rip),%xmm0
mov    $0x1,%al
call   1060 <extract@plt>
lea    0xe81(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3d7a,%edi
xor    %eax,%eax
call   1030 <extract3Digit@plt>
lea    0xe7d(%rip),%rdi
mov    $0x3d7a,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
lea    0xe84(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%5d + %05d = %05d\0A\00"
@.str.1 = [20 x i8] c"%05d + %05d = %05d\0A\00"
@.str.2 = [27 x i8] c"Isso \C3\A9 um float: %25.15f\0A\00"
@.str.3 = [24 x i8] c"Isso \C3\A9 um float: %.4f\0A\00"
@.str.4 = [25 x i8] c"O 3o Digito de %d \C3\A9 %d\0A\00"
@.str.5 = [10 x i8] c"Hello %s\0A\00"
@.str.6 = [7 x i8] c"world!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @soma to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 2, i32 102)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 500, i32 350000, i32 4000)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double 1.400000e+00)
%15 = call i32 (double, ...) bitcast (i32 (...)* @extract to i32 (double, ...)*)(double 3.141500e+00)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 (i32, ...) bitcast (i32 (...)* @extract3Digit to i32 (i32, ...)*)(i32 15738)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 15738, i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%5d + %05d = %05d\0A\00"
@.str.1 = [20 x i8] c"%05d + %05d = %05d\0A\00"
@.str.2 = [27 x i8] c"Isso \C3\A9 um float: %25.15f\0A\00"
@.str.3 = [24 x i8] c"Isso \C3\A9 um float: %.4f\0A\00"
@.str.4 = [25 x i8] c"O 3o Digito de %d \C3\A9 %d\0A\00"
@.str.5 = [10 x i8] c"Hello %s\0A\00"
@.str.6 = [7 x i8] c"world!\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @soma to i32 (i32, i32, ...)*)(i32 10, i32 5)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10, i32 5, i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 2, i32 102)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 500, i32 350000, i32 4000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double 1.400000e+00)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @extract to i32 (double, ...)*)(double 3.141500e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @extract3Digit to i32 (i32, ...)*)(i32 15738)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 15738, i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}