#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 main() {
  int num1, num2, soma, multiplicacao, divisao, subtracao;
  num1 = 4;
  num2 = 8;
  soma = num1 + num2;
  multiplicacao = num1 * num2;
  divisao = num1 / num2;
  subtracao = num2 - num1;
  printf("\n soma=%d", soma);
  printf("\n multiplicacao=%d", multiplicacao);
  printf("\n divisao=%d", divisao);
  printf("\n subtracao=%d", subtracao);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x4,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"\0A soma=%d\00"
@.str.1 = [19 x i8] c"\0A multiplicacao=%d\00"
@.str.2 = [13 x i8] c"\0A divisao=%d\00"
@.str.3 = [15 x i8] c"\0A subtracao=%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 32)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret i32 0
}