#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 abs(int);
int max(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int a, b;
  printf("input two num(a,b):");
  scanf("%d,%d", &a, &b);
  printf("%d,%d\n", a, b);
  printf("sum=%d\n", a + b);
  printf("diff=%d\n", a - b);
  printf("product=%d\n", a * b);
  printf("quotient=%d\n", a / b);
  printf("\tremainder=%d\n", a % b);
  printf("|diff|=%d\n", abs(a - b));
  printf("biggger=%d\n", max(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
sub    -0x18(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
imul   -0x18(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %edx,%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
sub    -0x18(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <max@plt>
mov    %eax,%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
sub    (%rsp),%esi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
lea    0xe87(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
lea    0xe7c(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
sub    (%rsp),%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <max@plt>
lea    0xe5e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"input two num(a,b):\00"
@.str.1 = [6 x i8] c"%d,%d\00"
@.str.2 = [7 x i8] c"%d,%d\0A\00"
@.str.3 = [8 x i8] c"sum=%d\0A\00"
@.str.4 = [9 x i8] c"diff=%d\0A\00"
@.str.5 = [12 x i8] c"product=%d\0A\00"
@.str.6 = [13 x i8] c"quotient=%d\0A\00"
@.str.7 = [15 x i8] c"\09remainder=%d\0A\00"
@.str.8 = [11 x i8] c"|diff|=%d\0A\00"
@.str.9 = [12 x i8] c"biggger=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = mul nsw i32 %21, %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = sdiv i32 %25, %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = srem i32 %29, %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = sub nsw i32 %33, %34
%36 = call i32 @abs(i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = call i32 @max(i32 %38, i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"input two num(a,b):\00"
@.str.1 = [6 x i8] c"%d,%d\00"
@.str.2 = [7 x i8] c"%d,%d\0A\00"
@.str.3 = [8 x i8] c"sum=%d\0A\00"
@.str.4 = [9 x i8] c"diff=%d\0A\00"
@.str.5 = [12 x i8] c"product=%d\0A\00"
@.str.6 = [13 x i8] c"quotient=%d\0A\00"
@.str.7 = [15 x i8] c"\09remainder=%d\0A\00"
@.str.8 = [11 x i8] c"|diff|=%d\0A\00"
@.str.9 = [12 x i8] c"biggger=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = mul nsw i32 %21, %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = sdiv i32 %24, %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = srem i32 %28, %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = sub nsw i32 %32, %33
%35 = call i32 @llvm.abs.i32(i32 %34, i1 true)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = call i32 @max(i32 %37, i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %39)
ret i32 0
}