#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, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  int *p1, *p2, *p, a, b;
  scanf("%d %d", &a, &b);
  p1 = &a;
  p2 = &b;
  if (a < b) {
    p = p1;
    p1 = p2;
    p2 = p;
  }
  printf("\na=%d,b=%d\n\n", a, b);
  printf("max=%d,min=%d\n", *p1, *p2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x1c(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1170 <main+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
lea    0xec1(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
cmp    %ebp,%ebx
mov    (%rsp),%edx
mov    0x4(%rsp),%eax
mov    %eax,%esi
cmovl  %edx,%esi
cmovl  %eax,%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [13 x i8] c"\0Aa=%d,b=%d\0A\0A\00"
@.str.2 = [15 x i8] c"max=%d,min=%d\0A\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5)
store i32* %4, i32** %1
store i32* %5, i32** %2
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32*, i32** %1
store i32* %11, i32** %3
%12 = load i32*, i32** %2
store i32* %12, i32** %1
%13 = load i32*, i32** %3
store i32* %13, i32** %2
br label %14
14: ; preds = %10, %0
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16)
%18 = load i32*, i32** %1
%19 = load i32, i32* %18
%20 = load i32*, i32** %2
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %21)
ret void
}

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