#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 *, ...);
void main() {
  int a, b;
  int min(int, int);
  int max(int, int);
  int sum(int, int);
  void process(int x, int y, int (*fun)());
  a = 5, b = 8;
  printf("a=%d,b=%d\n", a, b);
  printf("max=");
  process(a, b, max);
  printf("min=");
  process(a, b, min);
  printf("sum=");
  process(a, b, sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e73(%rip),%rdx
call   1040 <process@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e4b(%rip),%rdx
call   1040 <process@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e43(%rip),%rdx
call   1040 <process@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rdx
mov    $0x5,%edi
mov    $0x8,%esi
call   1040 <process@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rdx
mov    $0x5,%edi
mov    $0x8,%esi
call   1040 <process@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e52(%rip),%rdx
mov    $0x5,%edi
mov    $0x8,%esi
pop    %rax
jmp    1040 <process@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d,b=%d\0A\00"
@.str.1 = [5 x i8] c"max=\00"
@.str.2 = [5 x i8] c"min=\00"
@.str.3 = [5 x i8] c"sum=\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5, i32 8)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
tail call void @process(i32 5, i32 8, i32 (...)* bitcast (i32 (i32, i32)* @max to i32 (...)*))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
tail call void @process(i32 5, i32 8, i32 (...)* bitcast (i32 (i32, i32)* @min to i32 (...)*))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
tail call void @process(i32 5, i32 8, i32 (...)* bitcast (i32 (i32, i32)* @sum to i32 (...)*))
ret void
}