#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 *);
void main() {
  int max(int, int);
  int min(int, int);
  int add(int, int);
  int process(int, int, int (*fun)());
  int a, b;
  printf("enter a and b:\n");
  scanf("%d %d", &a, &b);
  printf("max=");
  process(a, b, max);
  printf("min=");
  process(a, b, min);
  printf("sum=");
  process(a, b, add);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e6f(%rip),%rdx
call   1040 <process@plt>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e49(%rip),%rdx
call   1040 <process@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e23(%rip),%rdx
call   1040 <process@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    0x2e65(%rip),%rdx
call   1050 <process@plt>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    0x2e3e(%rip),%rdx
call   1050 <process@plt>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    0x2e17(%rip),%rdx
call   1050 <process@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"enter a and b:\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [5 x i8] c"max=\00"
@.str.3 = [5 x i8] c"min=\00"
@.str.4 = [5 x i8] c"sum=\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @process(i32 %6, i32 %7, i32 (...)* bitcast (i32 (i32, i32)* @max to i32 (...)*))
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @process(i32 %10, i32 %11, i32 (...)* bitcast (i32 (i32, i32)* @min to i32 (...)*))
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @process(i32 %14, i32 %15, i32 (...)* bitcast (i32 (i32, i32)* @add to i32 (...)*))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [5 x i8] c"max=\00"
@.str.3 = [5 x i8] c"min=\00"
@.str.4 = [5 x i8] c"sum=\00"
@str = [15 x i8] c"enter a and b:\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @process(i32 %8, i32 %9, i32 (...)* bitcast (i32 (i32, i32)* @max to i32 (...)*))
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @process(i32 %12, i32 %13, i32 (...)* bitcast (i32 (i32, i32)* @min to i32 (...)*))
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = call i32 @process(i32 %16, i32 %17, i32 (...)* bitcast (i32 (i32, i32)* @add to i32 (...)*))
ret void
}