#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 */
float fabs(int /*<<< orphan*/);
int /*<<< orphan*/ fmod(float, float);
int test_registration(float origx, float origy, float origz, float width) {
  float xreg, xreg1, yreg, yreg1, zreg, zreg1;
  xreg = fabs(fmod(origx + 0.00001 * width, width));
  xreg1 = fabs(fmod(origx - 0.00001 * width, width));
  yreg = fabs(fmod(origy + 0.00001 * width, width));
  yreg1 = fabs(fmod(origy - 0.00001 * width, width));
  zreg = fabs(fmod(origz + 0.00001 * width, width));
  zreg1 = fabs(fmod(origz - 0.00001 * width, width));
  if (xreg1 < xreg)
    xreg = xreg1;
  if (yreg1 < yreg)
    yreg = yreg1;
  if (zreg1 < zreg)
    zreg = zreg1;
  if (xreg + yreg + zreg > 0.0001 * width)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<test_registration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe6e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdc2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd7e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    12c1 <test_registration+0x1a1>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x24(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    12de <test_registration+0x1be>
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x2c(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    12fb <test_registration+0x1db>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xcf1(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1339 <test_registration+0x219>
movl   $0x0,-0x4(%rbp)
jmp    1340 <test_registration+0x220>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_registration>:
sub    $0x48,%rsp
movss  %xmm2,0x28(%rsp)
movss  %xmm1,0xc(%rsp)
cvtss2sd %xmm0,%xmm4
movsd  %xmm4,0x20(%rsp)
movaps %xmm3,%xmm1
movss  %xmm3,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xea8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
addsd  %xmm4,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,0x34(%rsp)
movsd  0xe80(%rip),%xmm0
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,0xc(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,0x18(%rsp)
movss  0x28(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  %xmm0,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
movss  0x20(%rsp),%xmm1
minss  0x34(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
minss  0xc(%rsp),%xmm2
addss  %xmm1,%xmm2
minss  0x10(%rsp),%xmm0
addss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  0xd5f(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setbe  %al
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @test_registration(float %0, float %1, float %2, float %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = load float, float* %9
%19 = fpext float %18 to double
%20 = call double @llvm.fmuladd.f64(double 1.000000e-05, double %19, double %17)
%21 = fptrunc double %20 to float
%22 = load float, float* %9
%23 = call i32 @fmod(float %21, float %22)
%24 = call float @fabs(i32 %23)
store float %24, float* %10
%25 = load float, float* %6
%26 = fpext float %25 to double
%27 = load float, float* %9
%28 = fpext float %27 to double
%29 = call double @llvm.fmuladd.f64(double -1.000000e-05, double %28, double %26)
%30 = fptrunc double %29 to float
%31 = load float, float* %9
%32 = call i32 @fmod(float %30, float %31)
%33 = call float @fabs(i32 %32)
store float %33, float* %11
%34 = load float, float* %7
%35 = fpext float %34 to double
%36 = load float, float* %9
%37 = fpext float %36 to double
%38 = call double @llvm.fmuladd.f64(double 1.000000e-05, double %37, double %35)
%39 = fptrunc double %38 to float
%40 = load float, float* %9
%41 = call i32 @fmod(float %39, float %40)
%42 = call float @fabs(i32 %41)
store float %42, float* %12
%43 = load float, float* %7
%44 = fpext float %43 to double
%45 = load float, float* %9
%46 = fpext float %45 to double
%47 = call double @llvm.fmuladd.f64(double -1.000000e-05, double %46, double %44)
%48 = fptrunc double %47 to float
%49 = load float, float* %9
%50 = call i32 @fmod(float %48, float %49)
%51 = call float @fabs(i32 %50)
store float %51, float* %13
%52 = load float, float* %8
%53 = fpext float %52 to double
%54 = load float, float* %9
%55 = fpext float %54 to double
%56 = call double @llvm.fmuladd.f64(double 1.000000e-05, double %55, double %53)
%57 = fptrunc double %56 to float
%58 = load float, float* %9
%59 = call i32 @fmod(float %57, float %58)
%60 = call float @fabs(i32 %59)
store float %60, float* %14
%61 = load float, float* %8
%62 = fpext float %61 to double
%63 = load float, float* %9
%64 = fpext float %63 to double
%65 = call double @llvm.fmuladd.f64(double -1.000000e-05, double %64, double %62)
%66 = fptrunc double %65 to float
%67 = load float, float* %9
%68 = call i32 @fmod(float %66, float %67)
%69 = call float @fabs(i32 %68)
store float %69, float* %15
%70 = load float, float* %11
%71 = load float, float* %10
%72 = fcmp olt float %70, %71
br i1 %72, label %73, label %75
73: ; preds = %4
%74 = load float, float* %11
store float %74, float* %10
br label %75
75: ; preds = %73, %4
%76 = load float, float* %13
%77 = load float, float* %12
%78 = fcmp olt float %76, %77
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = load float, float* %13
store float %80, float* %12
br label %81
81: ; preds = %79, %75
%82 = load float, float* %15
%83 = load float, float* %14
%84 = fcmp olt float %82, %83
br i1 %84, label %85, label %87
85: ; preds = %81
%86 = load float, float* %15
store float %86, float* %14
br label %87
87: ; preds = %85, %81
%88 = load float, float* %10
%89 = load float, float* %12
%90 = fadd float %88, %89
%91 = load float, float* %14
%92 = fadd float %90, %91
%93 = fpext float %92 to double
%94 = load float, float* %9
%95 = fpext float %94 to double
%96 = fmul double 1.000000e-04, %95
%97 = fcmp ogt double %93, %96
br i1 %97, label %98, label %99
98: ; preds = %87
store i32 0, i32* %5
br label %100
99: ; preds = %87
store i32 1, i32* %5
br label %100
100: ; preds = %99, %98
%101 = load i32, i32* %5
ret i32 %101
}

LLVM IR (-O2):
define i32 @test_registration(float %0, float %1, float %2, float %3) {
%5 = fpext float %0 to double
%6 = fpext float %3 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e-05, double %5)
%8 = fptrunc double %7 to float
%9 = tail call i32 @fmod(float %8, float %3)
%10 = tail call float @fabs(i32 %9)
%11 = tail call double @llvm.fmuladd.f64(double %6, double -1.000000e-05, double %5)
%12 = fptrunc double %11 to float
%13 = tail call i32 @fmod(float %12, float %3)
%14 = tail call float @fabs(i32 %13)
%15 = fpext float %1 to double
%16 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e-05, double %15)
%17 = fptrunc double %16 to float
%18 = tail call i32 @fmod(float %17, float %3)
%19 = tail call float @fabs(i32 %18)
%20 = tail call double @llvm.fmuladd.f64(double %6, double -1.000000e-05, double %15)
%21 = fptrunc double %20 to float
%22 = tail call i32 @fmod(float %21, float %3)
%23 = tail call float @fabs(i32 %22)
%24 = fpext float %2 to double
%25 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e-05, double %24)
%26 = fptrunc double %25 to float
%27 = tail call i32 @fmod(float %26, float %3)
%28 = tail call float @fabs(i32 %27)
%29 = tail call double @llvm.fmuladd.f64(double %6, double -1.000000e-05, double %24)
%30 = fptrunc double %29 to float
%31 = tail call i32 @fmod(float %30, float %3)
%32 = tail call float @fabs(i32 %31)
%33 = fcmp olt float %14, %10
%34 = select i1 %33, float %14, float %10
%35 = fcmp olt float %23, %19
%36 = select i1 %35, float %23, float %19
%37 = fcmp olt float %32, %28
%38 = select i1 %37, float %32, float %28
%39 = fadd float %34, %36
%40 = fadd float %39, %38
%41 = fpext float %40 to double
%42 = fmul double %6, 1.000000e-04
%43 = fcmp uge double %42, %41
%44 = zext i1 %43 to i32
ret i32 %44
}