#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 a1, a2, intSum, intDiff, intProd, intQuot, intMod;
  a1 = a2 = intSum = intDiff = intProd = intQuot = intMod = -999;
  printf("Please provide a number for the first integer: \n");
  scanf(" %d", &a1);
  printf("Please provide a number for the second integer: \n");
  scanf(" %d", &a2);
  intSum = a1 + a2;
  printf("The number for the sum of the two integers is %d\n\n", intSum);
  if (a1 > a2) {
    intDiff = a1 - a2;
  } else {
    intDiff = a2 - a1;
  }
  printf("The number for the difference of the two integers is %d\n\n",
         intDiff);
  intProd = a1 * a2;
  printf("The number for the product of the two integers is %d\n\n", intProd);
  if (a1 == 0 || a2 == 0) {
    printf(
        "\nYou cannot any number divide by zero because it produces a non-real "
        "result. Any zero dived by any integer is equal to zero.\n\n");
  } else if (a1 > a2) {
    intQuot = a1 / a2;
    printf("The number for the quotient of the two integers is %d\n\n",
           intQuot);
  } else {
    intQuot = a2 / a1;
    printf("The number for the quotient of the two integers is %d\n\n",
           intQuot);
  }
  if (a1 == 0 || a2 == 0) {
    printf("No remainder. \n\n");
  } else if (a1 > a2) {
    intMod = a1 % a2;
    printf("The number for the remainder of the two integers is %d\n\n",
           intMod);
  } else {
    intMod = a2 % a1;
    printf("The number for the remainder of the two integers is %d\n\n",
           intMod);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffc19,-0x20(%rbp)
movl   $0xfffffc19,-0x1c(%rbp)
movl   $0xfffffc19,-0x18(%rbp)
movl   $0xfffffc19,-0x14(%rbp)
movl   $0xfffffc19,-0x10(%rbp)
movl   $0xfffffc19,-0xc(%rbp)
movl   $0xfffffc19,-0x8(%rbp)
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11d0 <main+0xb0>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11d9 <main+0xb9>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1219 <main+0xf9>
cmpl   $0x0,-0xc(%rbp)
jne    122c <main+0x10c>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1278 <main+0x158>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1258 <main+0x138>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xf3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1273 <main+0x153>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1278 <main+0x158>
cmpl   $0x0,-0x8(%rbp)
je     128c <main+0x16c>
cmpl   $0x0,-0xc(%rbp)
jne    129f <main+0x17f>
lea    0xf2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12eb <main+0x1cb>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    12cb <main+0x1ab>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xf14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e6 <main+0x1c6>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12eb <main+0x1cb>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xfffffc19,0x8(%rsp)
ff
movl   $0xfffffc19,0xc(%rsp)
ff
lea    0xfcd(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xfdd(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%eax
mov    %esi,%ecx
sub    %eax,%ecx
neg    %ecx
sub    %eax,%esi
cmovle %ecx,%esi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
imul   0xc(%rsp),%esi
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
je     11e7 <main+0xb7>
mov    0x8(%rsp),%esi
test   %esi,%esi
je     11e7 <main+0xb7>
cmp    %esi,%ecx
jle    11f5 <main+0xc5>
mov    %ecx,%eax
cltd
idiv   %esi
jmp    11fa <main+0xca>
lea    0xf9c(%rip),%rdi
call   1030 <puts@plt>
jmp    120a <main+0xda>
mov    %esi,%eax
cltd
idiv   %ecx
lea    0xea7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
je     1225 <main+0xf5>
mov    0x8(%rsp),%esi
test   %esi,%esi
je     1225 <main+0xf5>
cmp    %esi,%ecx
jle    1233 <main+0x103>
mov    %ecx,%eax
cltd
idiv   %esi
jmp    1238 <main+0x108>
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
jmp    1248 <main+0x118>
mov    %esi,%eax
cltd
idiv   %ecx
lea    0xea1(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Please provide a number for the first integer: \0A\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [50 x i8] c"Please provide a number for the second integer: \0A\00"
@.str.3 = [51 x i8] c"The number for the sum of the two integers is %d\0A\0A\00"
@.str.4 = [58 x i8] c"The number for the difference of the two integers is %d\0A\0A\00"
@.str.5 = [55 x i8] c"The number for the product of the two integers is %d\0A\0A\00"
@.str.6 = [127 x i8] c"\0AYou cannot any number divide by zero because it produces a non-real result. Any zero dived by any integer is equal to zero.\0A\0A\00"
@.str.7 = [56 x i8] c"The number for the quotient of the two integers is %d\0A\0A\00"
@.str.8 = [17 x i8] c"No remainder. \0A\0A\00"
@.str.9 = [57 x i8] c"The number for the remainder of the two integers is %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 -999, i32* %8
store i32 -999, i32* %7
store i32 -999, i32* %6
store i32 -999, i32* %5
store i32 -999, i32* %4
store i32 -999, i32* %3
store i32 -999, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %0
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %5
br label %29
25: ; preds = %0
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
store i32 %28, i32* %5
br label %29
29: ; preds = %25, %21
%30 = load i32, i32* %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = mul nsw i32 %32, %33
store i32 %34, i32* %6
%35 = load i32, i32* %6
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %29
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39, %29
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.6, i64 0, i64 0))
br label %61
44: ; preds = %39
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = icmp sgt i32 %45, %46
br i1 %47, label %48, label %54
48: ; preds = %44
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = sdiv i32 %49, %50
store i32 %51, i32* %7
%52 = load i32, i32* %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i32 %52)
br label %60
54: ; preds = %44
%55 = load i32, i32* %3
%56 = load i32, i32* %2
%57 = sdiv i32 %55, %56
store i32 %57, i32* %7
%58 = load i32, i32* %7
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %54, %48
br label %61
61: ; preds = %60, %42
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 0
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = load i32, i32* %3
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64, %61
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %86
69: ; preds = %64
%70 = load i32, i32* %2
%71 = load i32, i32* %3
%72 = icmp sgt i32 %70, %71
br i1 %72, label %73, label %79
73: ; preds = %69
%74 = load i32, i32* %2
%75 = load i32, i32* %3
%76 = srem i32 %74, %75
store i32 %76, i32* %8
%77 = load i32, i32* %8
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i32 %77)
br label %85
79: ; preds = %69
%80 = load i32, i32* %3
%81 = load i32, i32* %2
%82 = srem i32 %80, %81
store i32 %82, i32* %8
%83 = load i32, i32* %8
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i32 %83)
br label %85
85: ; preds = %79, %73
br label %86
86: ; preds = %85, %67
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %d\00"
@.str.3 = [51 x i8] c"The number for the sum of the two integers is %d\0A\0A\00"
@.str.4 = [58 x i8] c"The number for the difference of the two integers is %d\0A\0A\00"
@.str.5 = [55 x i8] c"The number for the product of the two integers is %d\0A\0A\00"
@.str.7 = [56 x i8] c"The number for the quotient of the two integers is %d\0A\0A\00"
@.str.9 = [57 x i8] c"The number for the remainder of the two integers is %d\0A\0A\00"
@str = [48 x i8] c"Please provide a number for the first integer: \00"
@str.10 = [49 x i8] c"Please provide a number for the second integer: \00"
@str.11 = [16 x i8] c"No remainder. \0A\00"
@str.12 = [126 x i8] c"\0AYou cannot any number divide by zero because it produces a non-real result. Any zero dived by any integer is equal to zero.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 -999, i32* %2
store i32 -999, i32* %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.10, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
%16 = sub nsw i32 %13, %14
%17 = sub nsw i32 %14, %13
%18 = select i1 %15, i32 %16, i32 %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = mul nsw i32 %21, %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %1
%25 = icmp eq i32 %24, 0
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 0
%28 = select i1 %25, i1 true, i1 %27
br i1 %28, label %29, label %31
29: ; preds = %0
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str.12, i64 0, i64 0))
br label %39
31: ; preds = %0
%32 = icmp sgt i32 %24, %26
br i1 %32, label %33, label %36
33: ; preds = %31
%34 = sdiv i32 %24, %26
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i32 %34)
br label %39
36: ; preds = %31
%37 = sdiv i32 %26, %24
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %33, %36, %29
%40 = load i32, i32* %1
%41 = icmp eq i32 %40, 0
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 0
%44 = select i1 %41, i1 true, i1 %43
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
br label %55
47: ; preds = %39
%48 = icmp sgt i32 %40, %42
br i1 %48, label %49, label %52
49: ; preds = %47
%50 = srem i32 %40, %42
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i32 %50)
br label %55
52: ; preds = %47
%53 = srem i32 %42, %40
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %49, %52, %45
ret i32 0
}