#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 */
scalar_t__ SDL_imageFilterMMXdetect();
int SDL_imageFilterSobelXShiftRight(unsigned char *Src, unsigned char *Dest,
                                    int rows, int columns,
                                    unsigned char NRightShift) {
  if ((columns < 8) || (rows < 3) || (NRightShift > 7))
    return (-1);
  if ((SDL_imageFilterMMXdetect())) {
    return (0);
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<SDL_imageFilterSobelXShiftRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8b,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %al,-0x21(%rbp)
cmpl   $0x8,-0x20(%rbp)
jl     114d <SDL_imageFilterSobelXShiftRight+0x3d>
cmpl   $0x3,-0x1c(%rbp)
jl     114d <SDL_imageFilterSobelXShiftRight+0x3d>
movzbl -0x21(%rbp),%eax
cmp    $0x7,%eax
jle    1159 <SDL_imageFilterSobelXShiftRight+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <SDL_imageFilterSobelXShiftRight+0x6d>
mov    $0x0,%al
call   1030 <SDL_imageFilterMMXdetect@plt>
cmp    $0x0,%rax
je     1176 <SDL_imageFilterSobelXShiftRight+0x66>
movl   $0x0,-0x4(%rbp)
jmp    117d <SDL_imageFilterSobelXShiftRight+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_imageFilterSobelXShiftRight>:
mov    $0xffffffff,%eax
cmp    $0x3,%edx
jl     1137 <SDL_imageFilterSobelXShiftRight+0x27>
cmp    $0x8,%ecx
jl     1137 <SDL_imageFilterSobelXShiftRight+0x27>
cmp    $0x7,%r8b
ja     1137 <SDL_imageFilterSobelXShiftRight+0x27>
push   %rax
xor    %eax,%eax
call   1030 <SDL_imageFilterMMXdetect@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @SDL_imageFilterSobelXShiftRight(i8* %0, i8* %1, i32 %2, i32 %3, i8 zeroext %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8 %4, i8* %11
%12 = load i32, i32* %10
%13 = icmp slt i32 %12, 8
br i1 %13, label %21, label %14
14: ; preds = %5
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 3
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = load i8, i8* %11
%19 = zext i8 %18 to i32
%20 = icmp sgt i32 %19, 7
br i1 %20, label %21, label %22
21: ; preds = %17, %14, %5
store i32 -1, i32* %6
br label %27
22: ; preds = %17
%23 = call i64 (...) @SDL_imageFilterMMXdetect()
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 0, i32* %6
br label %27
26: ; preds = %22
store i32 -1, i32* %6
br label %27
27: ; preds = %26, %25, %21
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @SDL_imageFilterSobelXShiftRight(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i8 zeroext %4) {
%6 = icmp slt i32 %3, 8
%7 = icmp slt i32 %2, 3
%8 = or i1 %7, %6
%9 = icmp ugt i8 %4, 7
%10 = or i1 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = tail call i64 (...) @SDL_imageFilterMMXdetect()
%13 = icmp eq i64 %12, 0
%14 = sext i1 %13 to i32
br label %15
15: ; preds = %11, %5
%16 = phi i32 [ -1, %5 ], [ %14, %11 ]
ret i32 %16
}