setnum(prm, x, y, max) int x, y, *prm, max;
{
  {};
  if (y < 0)
    return (y);
  if (x > max) {
    printf("\n?Sorry, %d is the maximum\n", max);
    return (-2);
  }
  if ((y = cmcfm()) < 0)
    return (y);
  *prm = x;
  return (0);
}


x86 assembly (clang, -O0):
<setnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    114a <setnum+0x2a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <setnum+0x81>
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1173 <setnum+0x53>
mov    -0x1c(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    11a1 <setnum+0x81>
mov    $0x0,%al
call   1040 <cmcfm@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1191 <setnum+0x71>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <setnum+0x81>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnum>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
test   %edx,%edx
js     115e <setnum+0x3e>
mov    %esi,%ebp
cmp    %ecx,%esi
jle    1147 <setnum+0x27>
lea    0xec9(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xfffffffe,%ebx
jmp    115e <setnum+0x3e>
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <cmcfm@plt>
test   %eax,%eax
js     115c <setnum+0x3c>
mov    %ebp,(%r14)
jmp    115e <setnum+0x3e>
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0A?Sorry, %d is the maximum\0A\00"
define i32 @setnum(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i32, i32* %8
store i32 %13, i32* %5
br label %29
14: ; preds = %4
%15 = load i32, i32* %7
%16 = load i32, i32* %9
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %9
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %19)
store i32 -2, i32* %5
br label %29
21: ; preds = %14
%22 = call i32 (...) @cmcfm()
store i32 %22, i32* %8
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32, i32* %8
store i32 %25, i32* %5
br label %29
26: ; preds = %21
%27 = load i32, i32* %7
%28 = load i32*, i32** %6
store i32 %27, i32* %28
store i32 0, i32* %5
br label %29
29: ; preds = %26, %24, %18, %12
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A?Sorry, %d is the maximum\0A\00"
define i32 @setnum(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, 0
br i1 %5, label %14, label %6
6: ; preds = %4
%7 = icmp sgt i32 %1, %3
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %14
10: ; preds = %6
%11 = tail call i32 (...) @cmcfm()
%12 = icmp slt i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
store i32 %1, i32* %0
br label %14
14: ; preds = %10, %4, %13, %8
%15 = phi i32 [ -2, %8 ], [ 0, %13 ], [ %2, %4 ], [ %11, %10 ]
ret i32 %15
}