#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*/ dsii(double *, double *);
int dsrib(double rect[3][2], double bounds[3][2]) {
  int k;
  for (k = 0; k < 3; k++)
    if (!dsii(rect[k], bounds[k]))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<dsrib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    117c <dsrib+0x6c>
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rsi
call   1030 <dsii@plt>
cmp    $0x0,%eax
jne    1169 <dsrib+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1183 <dsrib+0x73>
jmp    116e <dsrib+0x5e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <dsrib+0x17>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsrib>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <dsii@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1151 <dsrib+0x41>
lea    0x10(%rbx),%rdi
lea    0x10(%r14),%rsi
call   1030 <dsii@plt>
test   %eax,%eax
je     1151 <dsrib+0x41>
add    $0x20,%rbx
add    $0x20,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <dsii@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dsrib([2 x double]* %0, [2 x double]* %1) {
%3 = alloca i32
%4 = alloca [2 x double]*
%5 = alloca [2 x double]*
%6 = alloca i32
store [2 x double]* %0, [2 x double]** %4
store [2 x double]* %1, [2 x double]** %5
store i32 0, i32* %6
br label %7
7: ; preds = %25, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load [2 x double]*, [2 x double]** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 %13
%15 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%16 = load [2 x double]*, [2 x double]** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 %18
%20 = getelementptr inbounds [2 x double], [2 x double]* %19, i64 0, i64 0
%21 = call i32 @dsii(double* %15, double* %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %10
store i32 0, i32* %3
br label %29
24: ; preds = %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %7
28: ; preds = %7
store i32 1, i32* %3
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @dsrib([2 x double]* %0, [2 x double]* %1) {
%3 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0
%4 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%5 = tail call i32 @dsii(double* %3, double* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %2
%8 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 0
%9 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 1, i64 0
%10 = tail call i32 @dsii(double* %8, double* %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %7
%13 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 2, i64 0
%14 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 2, i64 0
%15 = tail call i32 @dsii(double* %13, double* %14)
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %12, %7, %2
%19 = phi i32 [ 0, %2 ], [ 0, %7 ], [ %17, %12 ]
ret i32 %19
}