#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 ((Src == NULL) || (Dest == NULL))
    return (-1);
  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)
cmpq   $0x0,-0x10(%rbp)
je     1142 <SDL_imageFilterSobelXShiftRight+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    114e <SDL_imageFilterSobelXShiftRight+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    119f <SDL_imageFilterSobelXShiftRight+0x8f>
cmpl   $0x8,-0x20(%rbp)
jl     116f <SDL_imageFilterSobelXShiftRight+0x5f>
cmpl   $0x3,-0x1c(%rbp)
jl     116f <SDL_imageFilterSobelXShiftRight+0x5f>
movzbl -0x21(%rbp),%eax
cmp    $0x7,%eax
jle    117b <SDL_imageFilterSobelXShiftRight+0x6b>
movl   $0xffffffff,-0x4(%rbp)
jmp    119f <SDL_imageFilterSobelXShiftRight+0x8f>
mov    $0x0,%al
call   1030 <SDL_imageFilterMMXdetect@plt>
cmp    $0x0,%rax
je     1198 <SDL_imageFilterSobelXShiftRight+0x88>
movl   $0x0,-0x4(%rbp)
jmp    119f <SDL_imageFilterSobelXShiftRight+0x8f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_imageFilterSobelXShiftRight>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1141 <SDL_imageFilterSobelXShiftRight+0x31>
test   %rsi,%rsi
je     1141 <SDL_imageFilterSobelXShiftRight+0x31>
cmp    $0x3,%edx
jl     1141 <SDL_imageFilterSobelXShiftRight+0x31>
cmp    $0x8,%ecx
jl     1141 <SDL_imageFilterSobelXShiftRight+0x31>
cmp    $0x7,%r8b
ja     1141 <SDL_imageFilterSobelXShiftRight+0x31>
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 i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %5
%15 = load i8*, i8** %8
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %14, %5
store i32 -1, i32* %6
br label %34
18: ; preds = %14
%19 = load i32, i32* %10
%20 = icmp slt i32 %19, 8
br i1 %20, label %28, label %21
21: ; preds = %18
%22 = load i32, i32* %9
%23 = icmp slt i32 %22, 3
br i1 %23, label %28, label %24
24: ; preds = %21
%25 = load i8, i8* %11
%26 = zext i8 %25 to i32
%27 = icmp sgt i32 %26, 7
br i1 %27, label %28, label %29
28: ; preds = %24, %21, %18
store i32 -1, i32* %6
br label %34
29: ; preds = %24
%30 = call i64 (...) @SDL_imageFilterMMXdetect()
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 0, i32* %6
br label %34
33: ; preds = %29
store i32 -1, i32* %6
br label %34
34: ; preds = %33, %32, %28, %17
%35 = load i32, i32* %6
ret i32 %35
}

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