#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
main() {
  int i = 3, j = 5;
  int *p;
  int *q;
  p = &i;
  q = &j;
  printf("resposta A\n");
  printf("resultado = p(%d) == i (%d)\n", *p, i);
  printf("\n");
  printf("resposta B\n");
  printf("resultado de *p - *q = %d\n", (*p - *q));
  printf("\n");
  printf("Resposta C\n");
  printf("o resultado de (12 + *p)/(*q)+7 = %d", (12 + *p) / (*q) + 7);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
sub    (%rax),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0xc,%eax
mov    -0x18(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,%esi
add    $0x7,%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf15(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
mov    $0x3,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xef2(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9b(%rip),%rdi
mov    $0xfffffffe,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8d(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"resposta A\0A\00"
@.str.1 = [29 x i8] c"resultado = p(%d) == i (%d)\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [12 x i8] c"resposta B\0A\00"
@.str.4 = [27 x i8] c"resultado de *p - *q = %d\0A\00"
@.str.5 = [12 x i8] c"Resposta C\0A\00"
@.str.6 = [37 x i8] c"o resultado de (12 + *p)/(*q)+7 = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 3, i32* %1
store i32 5, i32* %2
store i32* %1, i32** %3
store i32* %2, i32** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = sub nsw i32 %13, %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32*, i32** %3
%21 = load i32, i32* %20
%22 = add nsw i32 12, %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %23
%25 = sdiv i32 %22, %24
%26 = add nsw i32 %25, 7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%28 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"resultado = p(%d) == i (%d)\0A\00"
@.str.4 = [27 x i8] c"resultado de *p - *q = %d\0A\00"
@.str.6 = [37 x i8] c"o resultado de (12 + *p)/(*q)+7 = %d\00"
@str = [11 x i8] c"resposta A\00"
@str.7 = [11 x i8] c"resposta B\00"
@str.8 = [11 x i8] c"Resposta C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 3)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 -2)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 10)
%9 = tail call i32 (...) @getch()
ret i32 0
}