#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 */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ Ad7265ReadAsyncGet(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ Ad7265ReadAsyncStart();
void Ad7265Read(int32_t *a1, int32_t *b1, int32_t *a2, int32_t *b2) {
  while (!Ad7265ReadAsyncStart()) {
  }
  while (!Ad7265ReadAsyncGet(a1, b1, a2, b2)) {
  }
}


x86 assembly (clang, -O0):
<Ad7265Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <Ad7265ReadAsyncStart@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1154 <Ad7265Read+0x34>
jmp    1159 <Ad7265Read+0x39>
jmp    1138 <Ad7265Read+0x18>
jmp    115e <Ad7265Read+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <Ad7265ReadAsyncGet@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1188 <Ad7265Read+0x68>
jmp    118d <Ad7265Read+0x6d>
jmp    115e <Ad7265Read+0x3e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ad7265Read>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <Ad7265ReadAsyncStart@plt>
test   %eax,%eax
je     1140 <Ad7265Read+0x20>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <Ad7265ReadAsyncGet@plt>
test   %eax,%eax
je     1150 <Ad7265Read+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Ad7265Read(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
br label %9
9: ; preds = %13, %4
%10 = call i32 (...) @Ad7265ReadAsyncStart()
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
br label %15
15: ; preds = %23, %14
%16 = load i32*, i32** %5
%17 = load i32*, i32** %6
%18 = load i32*, i32** %7
%19 = load i32*, i32** %8
%20 = call i32 @Ad7265ReadAsyncGet(i32* %16, i32* %17, i32* %18, i32* %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br i1 %22, label %23, label %24
23: ; preds = %15
br label %15
24: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @Ad7265Read(i32* %0, i32* %1, i32* %2, i32* %3) {
br label %5
5: ; preds = %5, %4
%6 = tail call i32 (...) @Ad7265ReadAsyncStart()
%7 = icmp eq i32 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5, %8
%9 = tail call i32 @Ad7265ReadAsyncGet(i32* %0, i32* %1, i32* %2, i32* %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %8, label %11
11: ; preds = %8
ret void
}