#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 speed(int isp, int ip) {
  if (isp < 0 || isp > 10 || ip < 0 || ip > 10)
    return (1);
  if (ip)
    printf("!%d%c", isp, 0);
  else
    printf("!%d %d%c", isp, ip, 0);
  return (0);
}


x86 assembly (clang, -O0):
<speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1146 <speed+0x36>
cmpl   $0xa,-0x8(%rbp)
jg     1146 <speed+0x36>
cmpl   $0x0,-0xc(%rbp)
jl     1146 <speed+0x36>
cmpl   $0xa,-0xc(%rbp)
jle    1152 <speed+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1191 <speed+0x81>
cmpl   $0x0,-0xc(%rbp)
je     1174 <speed+0x64>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <speed+0x7a>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe85(%rip),%rdi
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speed>:
push   %rbx
mov    $0x1,%ebx
cmp    $0xa,%edi
ja     1152 <speed+0x42>
cmp    $0xa,%esi
ja     1152 <speed+0x42>
mov    %edi,%eax
test   %esi,%esi
je     113c <speed+0x2c>
lea    0xed3(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1152 <speed+0x42>
lea    0xec3(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"!%d%c\00"
@.str.1 = [9 x i8] c"!%d %d%c\00"
define i32 @speed(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 10
%4 = icmp ugt i32 %1, 10
%5 = or i1 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0)
br label %12
10: ; preds = %6
%11 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 0, i32 0)
br label %12
12: ; preds = %8, %10, %2
%13 = phi i32 [ 1, %2 ], [ 0, %10 ], [ 0, %8 ]
ret i32 %13
}