#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 myint[2], sum_myint, diff_myint, prod_myint, quot_myint, remainder_myint;
  printf("Give me an integer\n");
  scanf("%d", &myint[0]);
  printf("Ya got another one?\n");
  scanf("%d", &myint[1]);
  sum_myint = myint[0] + myint[1];
  diff_myint = myint[0] - myint[1];
  prod_myint = myint[0] * myint[1];
  quot_myint = myint[0] / myint[1];
  remainder_myint = myint[0] % myint[1];
  printf("the sume %d\nThe difference %d\n", sum_myint, diff_myint);
  printf("It multiplied %d\nIt division %d\nThe remainder %d", prod_myint,
         quot_myint, remainder_myint);
  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    -0xc(%rbp),%rsi
lea    0xf2e(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rsi
add    $0x4,%rsi
lea    0xf0c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edi
mov    %ecx,%eax
cltd
idiv   %edi
mov    %eax,%ebx
mov    %edx,%r14d
lea    (%rdi,%rcx,1),%esi
mov    %edi,%ebp
imul   %ecx,%ebp
mov    %ecx,%edx
sub    %edi,%edx
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Give me an integer\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Ya got another one?\0A\00"
@.str.3 = [31 x i8] c"the sume %d\0AThe difference %d\0A\00"
@.str.4 = [49 x i8] c"It multiplied %d\0AIt division %d\0AThe remainder %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%17 = load i32, i32* %16
%18 = add nsw i32 %15, %17
store i32 %18, i32* %3
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%22 = load i32, i32* %21
%23 = sub nsw i32 %20, %22
store i32 %23, i32* %4
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%27 = load i32, i32* %26
%28 = mul nsw i32 %25, %27
store i32 %28, i32* %5
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%30 = load i32, i32* %29
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%32 = load i32, i32* %31
%33 = sdiv i32 %30, %32
store i32 %33, i32* %6
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%35 = load i32, i32* %34
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%37 = load i32, i32* %36
%38 = srem i32 %35, %37
store i32 %38, i32* %7
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %39, i32 %40)
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %42, i32 %43, i32 %44)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"the sume %d\0AThe difference %d\0A\00"
@.str.4 = [49 x i8] c"It multiplied %d\0AIt division %d\0AThe remainder %d\00"
@str = [19 x i8] c"Give me an integer\00"
@str.5 = [20 x i8] c"Ya got another one?\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %7
%11 = add nsw i32 %10, %9
%12 = sub nsw i32 %9, %10
%13 = mul nsw i32 %10, %9
%14 = sdiv i32 %9, %10
%15 = srem i32 %9, %10
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %12)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
ret i32 0
}