#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 max(int, int);
int min(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 1;
  int b = 2;
  int maxNumber = max(a, b);
  int minNumber = min(a, b);
  printf("%d和%d最大数为:%d\n", a, b, maxNumber);
  printf("%d和%d最小数为:%d\n", a, b, minNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <max@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <min@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <max@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <min@plt>
mov    %eax,%ebp
lea    0xea4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%d\E5\92\8C%d\E6\9C\80\E5\A4\A7\E6\95\B0\E4\B8\BA:%d\0A\00"
@.str.1 = [24 x i8] c"%d\E5\92\8C%d\E6\9C\80\E5\B0\8F\E6\95\B0\E4\B8\BA:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @max(i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @min(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%d\E5\92\8C%d\E6\9C\80\E5\A4\A7\E6\95\B0\E4\B8\BA:%d\0A\00"
@.str.1 = [24 x i8] c"%d\E5\92\8C%d\E6\9C\80\E5\B0\8F\E6\95\B0\E4\B8\BA:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 1, i32 2)
%2 = tail call i32 @min(i32 1, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2, i32 %2)
ret i32 0
}