#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*/ printf(char *, int, int, ...);
int main() {
  int x = 10, y = 8;
  printf("Simples calculo com valores de x = %d e y = %d\n\n", x, y);
  printf("%d / %d = %d\n", x, y, x / y);
  printf("%d * %d = %d\n", x, y, x * y);
  printf("%d + %d = %d\n", x, y, x + y);
  printf("%d - %d = %d\n", x, y, x - y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0xa,%esi
mov    $0x8,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0xa,%esi
mov    $0x8,%edx
mov    $0x50,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0xa,%esi
mov    $0x8,%edx
mov    $0x12,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0xa,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Simples calculo com valores de x = %d e y = %d\0A\0A\00"
@.str.1 = [14 x i8] c"%d / %d = %d\0A\00"
@.str.2 = [14 x i8] c"%d * %d = %d\0A\00"
@.str.3 = [14 x i8] c"%d + %d = %d\0A\00"
@.str.4 = [14 x i8] c"%d - %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 8, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = sdiv i32 %8, %9
%11 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = mul nsw i32 %14, %15
%17 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13, i32 %16)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = add nsw i32 %20, %21
%23 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %18, i32 %19, i32 %22)
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
%29 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %24, i32 %25, i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"Simples calculo com valores de x = %d e y = %d\0A\0A\00"
@.str.1 = [14 x i8] c"%d / %d = %d\0A\00"
@.str.2 = [14 x i8] c"%d * %d = %d\0A\00"
@.str.3 = [14 x i8] c"%d + %d = %d\0A\00"
@.str.4 = [14 x i8] c"%d - %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 10, i32 8)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 8, i32 1)
%3 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 10, i32 8, i32 80)
%4 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 10, i32 8, i32 18)
%5 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 8, i32 2)
ret i32 0
}