#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num1, num2;
  int soma, sub, mult;
  float divi;
  printf("Digite o 1 numero\n");
  scanf("%d", &num1);
  printf("Digite o 2 numero\n");
  scanf("%d", &num2);
  soma = num1 + num2;
  sub = num1 - num2;
  mult = num1 * num2;
  divi = (float)num1 / num2;
  printf("\nA soma dos números é: %d + %d = %d", num1, num2, soma);
  printf("\nA subtração dos números é: %d - %d = %d", num1, num2, sub);
  printf("\nA multiplicação dos números é: %d * %d = %d", num1, num2, mult);
  printf("\nA divisão dos números é: %d / %d = %f\n", num1, num2, divi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf63(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xf72(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf64(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
mov    %esi,%ebp
sub    %edx,%ebp
mov    %edx,%ebx
imul   %esi,%ebx
cvtsi2ss %esi,%xmm1
cvtsi2ss %edx,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0x14(%rsp)
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xe74(%rip),%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xe89(%rip),%rdi
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite o 1 numero\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Digite o 2 numero\0A\00"
@.str.3 = [38 x i8] c"\0AA soma dos n\C3\BAmeros \C3\A9: %d + %d = %d\00"
@.str.4 = [45 x i8] c"\0AA subtra\C3\A7\C3\A3o dos n\C3\BAmeros \C3\A9: %d - %d = %d\00"
@.str.5 = [49 x i8] c"\0AA multiplica\C3\A7\C3\A3o dos n\C3\BAmeros \C3\A9: %d * %d = %d\00"
@.str.6 = [43 x i8] c"\0AA divis\C3\A3o dos n\C3\BAmeros \C3\A9: %d / %d = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %2
%22 = sitofp i32 %21 to float
%23 = load i32, i32* %3
%24 = sitofp i32 %23 to float
%25 = fdiv float %22, %24
store float %25, float* %7
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %27, i32 %28)
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = load i32, i32* %5
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %30, i32 %31, i32 %32)
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = load i32, i32* %6
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %34, i32 %35, i32 %36)
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = load float, float* %7
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i32 %38, i32 %39, double %41)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [38 x i8] c"\0AA soma dos n\C3\BAmeros \C3\A9: %d + %d = %d\00"
@.str.4 = [45 x i8] c"\0AA subtra\C3\A7\C3\A3o dos n\C3\BAmeros \C3\A9: %d - %d = %d\00"
@.str.5 = [49 x i8] c"\0AA multiplica\C3\A7\C3\A3o dos n\C3\BAmeros \C3\A9: %d * %d = %d\00"
@.str.6 = [43 x i8] c"\0AA divis\C3\A3o dos n\C3\BAmeros \C3\A9: %d / %d = %f\0A\00"
@str = [18 x i8] c"Digite o 1 numero\00"
@str.7 = [18 x i8] c"Digite o 2 numero\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = sub nsw i32 %9, %10
%13 = mul nsw i32 %10, %9
%14 = sitofp i32 %9 to float
%15 = sitofp i32 %10 to float
%16 = fdiv float %14, %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %18, i32 %19, i32 %12)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22, i32 %13)
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = fpext float %16 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i32 %24, i32 %25, double %26)
ret i32 0
}