#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 */
struct intel_record {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ intel_process_address(struct intel_record *);
scalar_t__ intel_read_data(int /*<<< orphan*/ *, struct intel_record *);
int intel_validate_line(struct intel_record *);
int intel_parse_line(FILE *fp, struct intel_record *record) {
  if (0 != intel_read_data(fp, record))
    return -1;
  switch (intel_validate_line(record)) {
  case 0:
    intel_process_address(record);
    break;
  case -8:
    break;
  default:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<intel_parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <intel_read_data@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1167 <intel_parse_line+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b9 <intel_parse_line+0x89>
mov    -0x18(%rbp),%rdi
call   1050 <intel_validate_line@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
sub    $0xfffffff8,%eax
je     11a1 <intel_parse_line+0x71>
jmp    1183 <intel_parse_line+0x53>
mov    -0x1c(%rbp),%eax
test   %eax,%eax
jne    11a6 <intel_parse_line+0x76>
jmp    1193 <intel_parse_line+0x63>
mov    -0x18(%rbp),%rdi
call   1040 <intel_process_address@plt>
jmp    11b2 <intel_parse_line+0x82>
jmp    11b2 <intel_parse_line+0x82>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b9 <intel_parse_line+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_parse_line>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <intel_read_data@plt>
mov    $0xffffffff,%ebp
test   %rax,%rax
jne    1160 <intel_parse_line+0x30>
mov    %rbx,%rdi
call   1050 <intel_validate_line@plt>
cmp    $0xfffffff8,%eax
je     115e <intel_parse_line+0x2e>
test   %eax,%eax
jne    1160 <intel_parse_line+0x30>
mov    %rbx,%rdi
call   1040 <intel_process_address@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.intel_record = type { i32 }
define i32 @intel_parse_line(i32* %0, %struct.intel_record* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.intel_record*
store i32* %0, i32** %4
store %struct.intel_record* %1, %struct.intel_record** %5
%6 = load i32*, i32** %4
%7 = load %struct.intel_record*, %struct.intel_record** %5
%8 = call i64 @intel_read_data(i32* %6, %struct.intel_record* %7)
%9 = icmp ne i64 0, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %20
11: ; preds = %2
%12 = load %struct.intel_record*, %struct.intel_record** %5
%13 = call i32 @intel_validate_line(%struct.intel_record* %12)
switch i32 %13, label %18 [
i32 0, label %14
i32 -8, label %17
]
14: ; preds = %11
%15 = load %struct.intel_record*, %struct.intel_record** %5
%16 = call i32 @intel_process_address(%struct.intel_record* %15)
br label %19
17: ; preds = %11
br label %19
18: ; preds = %11
store i32 -1, i32* %3
br label %20
19: ; preds = %17, %14
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.intel_record = type { i32 }
define i32 @intel_parse_line(i32* %0, %struct.intel_record* %1) {
%3 = tail call i64 @intel_read_data(i32* %0, %struct.intel_record* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @intel_validate_line(%struct.intel_record* %1)
switch i32 %6, label %10 [
i32 0, label %7
i32 -8, label %9
]
7: ; preds = %5
%8 = tail call i32 @intel_process_address(%struct.intel_record* %1)
br label %9
9: ; preds = %5, %7
br label %10
10: ; preds = %5, %2, %9
%11 = phi i32 [ 0, %9 ], [ -1, %2 ], [ -1, %5 ]
ret i32 %11
}