#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, int, int, int, int, int,
                          int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, *aa = &a, *bb = &b;
  scanf("%d %d", aa, bb);
  printf("%d + %d = %d\n%d - %d = %d\n%d * %d = %d\n%d / %d = %d\n", a, b,
         a + b, a, b, a - b, a, b, a * b, a, b, a / b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x60,%rsp
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0xeb2(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x24(%rbp),%ecx
add    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x24(%rbp),%r12d
sub    -0x28(%rbp),%r12d
mov    -0x24(%rbp),%r15d
mov    -0x28(%rbp),%r14d
mov    -0x24(%rbp),%ebx
imul   -0x28(%rbp),%ebx
mov    -0x24(%rbp),%r11d
mov    -0x28(%rbp),%r10d
mov    -0x24(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    -0x3c(%rbp),%edx
lea    0xe6c(%rip),%rdi
mov    %r12d,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %ebx,0x18(%rsp)
mov    %r11d,0x20(%rsp)
mov    %r10d,0x28(%rsp)
mov    %eax,0x30(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%r9d
lea    (%r9,%rsi,1),%ecx
mov    %esi,%r10d
sub    %r9d,%r10d
mov    %r9d,%r11d
imul   %esi,%r11d
mov    %esi,%eax
cltd
idiv   %r9d
sub    $0x8,%rsp
lea    0xea7(%rip),%rdi
mov    %r9d,%edx
mov    %esi,%r8d
push   %rax
push   %r9
push   %rsi
push   %r11
push   %r9
push   %rsi
push   %r10
call   1030 <printf@plt>
add    $0x40,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [53 x i8] c"%d + %d = %d\0A%d - %d = %d\0A%d * %d = %d\0A%d / %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = sub nsw i32 %6, %7
%10 = mul nsw i32 %7, %6
%11 = sdiv i32 %6, %7
%12 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %6, i32 %7, i32 %9, i32 %6, i32 %7, i32 %10, i32 %6, i32 %7, i32 %11)
ret i32 0
}