int magnetic_field_level_check(int *ohx, int *ohy, int *ohz) {
  int result = yas_pcb_check_state((5));
  if ((0) == result) {
    if ((ohx != ((void *)0)) && (ohy != ((void *)0)) && (ohz != ((void *)0))) {
      result = yas_pcb_test7(ohx, ohy, ohz);
      if ((0) == result)
        yas_pcb_update_state((5));
    } else
      result = (-128);
  }
  return result;
}


x86 assembly (clang, -O0):
<magnetic_field_level_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1050 <yas_pcb_check_state@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jne    11bd <magnetic_field_level_check+0x8d>
cmpq   $0x0,-0x8(%rbp)
je     11b1 <magnetic_field_level_check+0x81>
cmpq   $0x0,-0x10(%rbp)
je     11b1 <magnetic_field_level_check+0x81>
cmpq   $0x0,-0x18(%rbp)
je     11b1 <magnetic_field_level_check+0x81>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <yas_pcb_test7@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jne    11ac <magnetic_field_level_check+0x7c>
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <yas_pcb_update_state@plt>
jmp    11b8 <magnetic_field_level_check+0x88>
movl   $0xffffff80,-0x1c(%rbp)
jmp    11bd <magnetic_field_level_check+0x8d>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magnetic_field_level_check>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1050 <yas_pcb_check_state@plt>
test   %eax,%eax
je     1154 <magnetic_field_level_check+0x24>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0xffffff80,%eax
test   %rbx,%rbx
je     114e <magnetic_field_level_check+0x1e>
test   %r15,%r15
je     114e <magnetic_field_level_check+0x1e>
test   %r14,%r14
je     114e <magnetic_field_level_check+0x1e>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <yas_pcb_test7@plt>
test   %eax,%eax
jne    114e <magnetic_field_level_check+0x1e>
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <yas_pcb_update_state@plt>
xor    %eax,%eax
jmp    114e <magnetic_field_level_check+0x1e>

LLVM IR (-O0):
define i32 @magnetic_field_level_check(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @yas_pcb_check_state to i32 (i32, ...)*)(i32 5)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %32
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = load i32*, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i32*, i32** %6
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i32*, i32** %4
%22 = load i32*, i32** %5
%23 = load i32*, i32** %6
%24 = call i32 (i32*, i32*, i32*, ...) bitcast (i32 (...)* @yas_pcb_test7 to i32 (i32*, i32*, i32*, ...)*)(i32* %21, i32* %22, i32* %23)
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = icmp eq i32 0, %25
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = call i32 (i32, ...) bitcast (i32 (...)* @yas_pcb_update_state to i32 (i32, ...)*)(i32 5)
br label %29
29: ; preds = %27, %20
br label %31
30: ; preds = %17, %14, %11
store i32 -128, i32* %7
br label %31
31: ; preds = %30, %29
br label %32
32: ; preds = %31, %3
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @magnetic_field_level_check(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @yas_pcb_check_state to i32 (i32, ...)*)(i32 5)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = icmp ne i32* %0, null
%8 = icmp ne i32* %1, null
%9 = and i1 %7, %8
%10 = icmp ne i32* %2, null
%11 = and i1 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = tail call i32 (i32*, i32*, i32*, ...) bitcast (i32 (...)* @yas_pcb_test7 to i32 (i32*, i32*, i32*, ...)*)(i32* %0, i32* %1, i32* %2)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @yas_pcb_update_state to i32 (i32, ...)*)(i32 5)
br label %17
17: ; preds = %6, %15, %12, %3
%18 = phi i32 [ 0, %15 ], [ %13, %12 ], [ %4, %3 ], [ -128, %6 ]
ret i32 %18
}