#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 getint();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int main() {
  int a;
  a = getint();
  int b;
  b = getint();
  putint(a + b);
  putchar(10);
  putint(a - b);
  putchar(10);
  putint(a * b);
  putchar(10);
  putint(a / b);
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
imul   -0xc(%rbp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getint@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <getint@plt>
mov    %eax,%ebx
lea    (%rbx,%r14,1),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
sub    %ebx,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
imul   %r14d,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14d,%eax
cltd
idiv   %ebx
mov    %eax,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getint()
store i32 %4, i32* %2
%5 = call i32 (...) @getint()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = call i32 @putint(i32 %8)
%10 = call i32 @putchar(i32 10)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
%14 = call i32 @putint(i32 %13)
%15 = call i32 @putchar(i32 10)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = mul nsw i32 %16, %17
%19 = call i32 @putint(i32 %18)
%20 = call i32 @putchar(i32 10)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = sdiv i32 %21, %22
%24 = call i32 @putint(i32 %23)
%25 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getint()
%2 = tail call i32 (...) @getint()
%3 = add nsw i32 %2, %1
%4 = tail call i32 @putint(i32 %3)
%5 = tail call i32 @putchar(i32 10)
%6 = sub nsw i32 %1, %2
%7 = tail call i32 @putint(i32 %6)
%8 = tail call i32 @putchar(i32 10)
%9 = mul nsw i32 %2, %1
%10 = tail call i32 @putint(i32 %9)
%11 = tail call i32 @putchar(i32 10)
%12 = sdiv i32 %1, %2
%13 = tail call i32 @putint(i32 %12)
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}