#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__ Util_is_zero(double);
void check3(double *a, double *b, double *c, double *d) {
  *a = Util_is_zero(*a) ? 1.0e-10 : *a;
  *b = Util_is_zero(*b) ? 1.0e-10 : *b;
  *c = Util_is_zero(*c) ? 1.0e-10 : *c;
  if (d)
    *d = Util_is_zero(*d) ? 1.0e-10 : *d;
}


x86 assembly (clang, -O0):
<check3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <Util_is_zero@plt>
cmp    $0x0,%rax
je     1151 <check3+0x41>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115e <check3+0x4e>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <Util_is_zero@plt>
cmp    $0x0,%rax
je     1194 <check3+0x84>
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11a1 <check3+0x91>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <Util_is_zero@plt>
cmp    $0x0,%rax
je     11d7 <check3+0xc7>
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11e4 <check3+0xd4>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     123f <check3+0x12f>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <Util_is_zero@plt>
cmp    $0x0,%rax
je     1225 <check3+0x115>
movsd  0xde5(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1232 <check3+0x122>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check3>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <Util_is_zero@plt>
movsd  0xecb(%rip),%xmm0
test   %rax,%rax
jne    113e <check3+0x2e>
movsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%r12),%xmm0
call   1030 <Util_is_zero@plt>
movsd  0xeab(%rip),%xmm0
test   %rax,%rax
jne    1160 <check3+0x50>
movsd  (%r12),%xmm0
movsd  %xmm0,(%r12)
movsd  (%r15),%xmm0
call   1030 <Util_is_zero@plt>
test   %rax,%rax
movsd  0xe85(%rip),%xmm0
jne    1182 <check3+0x72>
movsd  (%r15),%xmm0
movsd  %xmm0,(%r15)
test   %r14,%r14
je     11af <check3+0x9f>
movsd  (%r14),%xmm0
call   1030 <Util_is_zero@plt>
test   %rax,%rax
je     11a5 <check3+0x95>
movsd  0xe5d(%rip),%xmm0
jmp    11aa <check3+0x9a>
movsd  (%r14),%xmm0
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @check3(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = call i64 @Util_is_zero(double %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %4
br label %17
14: ; preds = %4
%15 = load double*, double** %5
%16 = load double, double* %15
br label %17
17: ; preds = %14, %13
%18 = phi double [ 1.000000e-10, %13 ], [ %16, %14 ]
%19 = load double*, double** %5
store double %18, double* %19
%20 = load double*, double** %6
%21 = load double, double* %20
%22 = call i64 @Util_is_zero(double %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %17
br label %28
25: ; preds = %17
%26 = load double*, double** %6
%27 = load double, double* %26
br label %28
28: ; preds = %25, %24
%29 = phi double [ 1.000000e-10, %24 ], [ %27, %25 ]
%30 = load double*, double** %6
store double %29, double* %30
%31 = load double*, double** %7
%32 = load double, double* %31
%33 = call i64 @Util_is_zero(double %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %28
br label %39
36: ; preds = %28
%37 = load double*, double** %7
%38 = load double, double* %37
br label %39
39: ; preds = %36, %35
%40 = phi double [ 1.000000e-10, %35 ], [ %38, %36 ]
%41 = load double*, double** %7
store double %40, double* %41
%42 = load double*, double** %8
%43 = icmp ne double* %42, null
br i1 %43, label %44, label %56
44: ; preds = %39
%45 = load double*, double** %8
%46 = load double, double* %45
%47 = call i64 @Util_is_zero(double %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %44
br label %53
50: ; preds = %44
%51 = load double*, double** %8
%52 = load double, double* %51
br label %53
53: ; preds = %50, %49
%54 = phi double [ 1.000000e-10, %49 ], [ %52, %50 ]
%55 = load double*, double** %8
store double %54, double* %55
br label %56
56: ; preds = %53, %39
ret void
}

LLVM IR (-O2):
define void @check3(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* %3) {
%5 = load double, double* %0
%6 = tail call i64 @Util_is_zero(double %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load double, double* %0
br label %10
10: ; preds = %4, %8
%11 = phi double [ %9, %8 ], [ 1.000000e-10, %4 ]
store double %11, double* %0
%12 = load double, double* %1
%13 = tail call i64 @Util_is_zero(double %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load double, double* %1
br label %17
17: ; preds = %10, %15
%18 = phi double [ %16, %15 ], [ 1.000000e-10, %10 ]
store double %18, double* %1
%19 = load double, double* %2
%20 = tail call i64 @Util_is_zero(double %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = load double, double* %2
br label %24
24: ; preds = %17, %22
%25 = phi double [ %23, %22 ], [ 1.000000e-10, %17 ]
store double %25, double* %2
%26 = icmp eq double* %3, null
br i1 %26, label %35, label %27
27: ; preds = %24
%28 = load double, double* %3
%29 = tail call i64 @Util_is_zero(double %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load double, double* %3
br label %33
33: ; preds = %27, %31
%34 = phi double [ %32, %31 ], [ 1.000000e-10, %27 ]
store double %34, double* %3
br label %35
35: ; preds = %33, %24
ret void
}