void max_of_squares(long *in1, long *in2, long *out) {
  long max;
  if (cut((long)(labs(*in1) > labs(*in2)))) {
    max = labs(*in1);
  } else {
    max = labs(*in2);
  }
  printf("%s:%d: "
         "max is %ld, computing its square.."
         "\n",
         __FUNCTION__, 113, max);
  *out = (max * max);
}


x86 assembly (clang, -O0):
<max_of_squares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <labs@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <labs@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rdi
mov    $0x0,%al
call   1050 <cut@plt>
cmp    $0x0,%eax
je     119a <max_of_squares+0x6a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <labs@plt>
mov    %rax,-0x20(%rbp)
jmp    11aa <max_of_squares+0x7a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <labs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
lea    0xe4b(%rip),%rdi
lea    0xe6f(%rip),%rsi
mov    $0x71,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rcx
imul   -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_of_squares>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    %rax,%rcx
neg    %rcx
cmovs  %rax,%rcx
mov    (%rsi),%rax
mov    %rax,%rdx
neg    %rdx
cmovs  %rax,%rdx
xor    %edi,%edi
cmp    %rdx,%rcx
seta   %dil
xor    %eax,%eax
call   1040 <cut@plt>
test   %eax,%eax
cmove  %r15,%rbx
mov    (%rbx),%rbx
mov    %rbx,%rcx
neg    %rcx
cmovs  %rbx,%rcx
lea    0xe8e(%rip),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x71,%edx
xor    %eax,%eax
call   1030 <printf@plt>
imul   %rbx,%rbx
mov    %rbx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"%s:%d: max is %ld, computing its square..\0A\00"
@__FUNCTION__.max_of_squares = [15 x i8] c"max_of_squares\00"
define void @max_of_squares(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = call i64 @labs(i64 %9)
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = call i64 @labs(i64 %12)
%14 = icmp sgt i64 %10, %13
%15 = zext i1 %14 to i32
%16 = sext i32 %15 to i64
%17 = call i32 (i64, ...) bitcast (i32 (...)* @cut to i32 (i64, ...)*)(i64 %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %3
%20 = load i64*, i64** %4
%21 = load i64, i64* %20
%22 = call i64 @labs(i64 %21)
store i64 %22, i64* %7
br label %27
23: ; preds = %3
%24 = load i64*, i64** %5
%25 = load i64, i64* %24
%26 = call i64 @labs(i64 %25)
store i64 %26, i64* %7
br label %27
27: ; preds = %23, %19
%28 = load i64, i64* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.max_of_squares, i64 0, i64 0), i32 113, i64 %28)
%30 = load i64, i64* %7
%31 = load i64, i64* %7
%32 = mul nsw i64 %30, %31
%33 = load i64*, i64** %6
store i64 %32, i64* %33
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"%s:%d: max is %ld, computing its square..\0A\00"
@__FUNCTION__.max_of_squares = [15 x i8] c"max_of_squares\00"
define void @max_of_squares(i64* nocapture %0, i64* nocapture %1, i64* nocapture writeonly %2) {
%4 = load i64, i64* %0
%5 = tail call i64 @llvm.abs.i64(i64 %4, i1 true)
%6 = load i64, i64* %1
%7 = tail call i64 @llvm.abs.i64(i64 %6, i1 true)
%8 = icmp ugt i64 %5, %7
%9 = zext i1 %8 to i64
%10 = tail call i32 (i64, ...) bitcast (i32 (...)* @cut to i32 (i64, ...)*)(i64 %9)
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i64* %1, i64* %0
%13 = load i64, i64* %12
%14 = tail call i64 @llvm.abs.i64(i64 %13, i1 true)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.max_of_squares, i64 0, i64 0), i32 113, i64 %14)
%16 = mul i64 %13, %13
store i64 %16, i64* %2
ret void
}