#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);
int main(void) {
  int var1, var2, resultado;
  var1 = 2;
  var2 = 11;
  resultado = var1 + var2;
  printf("%d + %d = %d \n", var1, var2, resultado);
  resultado = var2 - var1;
  printf("%d - %d = %d\n", var2, var1, resultado);
  resultado = var1 * var2;
  printf("%d * %d = %d\n", var1, var2, resultado);
  resultado = var2 / var1;
  printf("%d / %d = %d\n", var2, var1, resultado);
  resultado = var2 % var1;
  printf("Resto (de %d / %d) = %d\n", var2, var1, resultado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0xb,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe78(%rip),%rdi
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    $0x2,%esi
mov    $0xb,%edx
mov    $0xd,%ecx
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0xb,%esi
mov    $0x2,%edx
mov    $0x9,%ecx
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x2,%esi
mov    $0xb,%edx
mov    $0x16,%ecx
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0xb,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0xb,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d + %d = %d \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 = [25 x i8] c"Resto (de %d / %d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 11, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = mul nsw i32 %19, %20
store i32 %21, i32* %4
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = sdiv i32 %26, %27
store i32 %28, i32* %4
%29 = load i32, i32* %3
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30, i32 %31)
%33 = load i32, i32* %3
%34 = load i32, i32* %2
%35 = srem i32 %33, %34
store i32 %35, i32* %4
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = load i32, i32* %4
%39 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %36, i32 %37, i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d + %d = %d \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 = [25 x i8] c"Resto (de %d / %d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2, i32 11, i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 11, i32 2, i32 9)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 11, i32 22)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 11, i32 2, i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 11, i32 2, i32 1)
ret i32 0
}