#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 */
int /*<<< orphan*/ ft_place_entry(char ***);
int get_next_line(int /*<<< orphan*/, char *);
void binary_loop(void) {
  char *entry[2];
  int k;
  k = 0;
  while (get_next_line(0, entry[k]) == 1) {
    if (k)
      ft_place_entry(&entry);
    else if (entry[k][0] == '\0')
      break;
    k = (k ? 0 : 1);
  }
}


x86 assembly (clang, -O0):
<binary_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,8),%rsi
xor    %edi,%edi
call   1040 <get_next_line@plt>
cmp    $0x1,%eax
jne    1197 <binary_loop+0x77>
cmpl   $0x0,-0x14(%rbp)
je     1160 <binary_loop+0x40>
lea    -0x10(%rbp),%rdi
call   1030 <ft_place_entry@plt>
jmp    117f <binary_loop+0x5f>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,8),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117a <binary_loop+0x5a>
jmp    1197 <binary_loop+0x77>
jmp    117f <binary_loop+0x5f>
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <binary_loop+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_loop>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <get_next_line@plt>
cmp    $0x1,%eax
jne    116b <binary_loop+0x4b>
mov    %rsp,%r14
mov    %r14,%r15
jmp    115f <binary_loop+0x3f>
nop
mov    %r14,%rdi
call   1030 <ft_place_entry@plt>
xor    $0x1,%ebx
lea    (%rsp,%rbx,8),%r15
mov    (%rsp,%rbx,8),%rsi
xor    %edi,%edi
call   1040 <get_next_line@plt>
cmp    $0x1,%eax
jne    116b <binary_loop+0x4b>
test   %ebx,%ebx
jne    1140 <binary_loop+0x20>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    1148 <binary_loop+0x28>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @binary_loop() {
%1 = alloca [2 x i8*]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %27, %0
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 %5
%7 = load i8*, i8** %6
%8 = call i32 @get_next_line(i32 0, i8* %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %32
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = bitcast [2 x i8*]* %1 to i8***
%15 = call i32 @ft_place_entry(i8*** %14)
br label %27
16: ; preds = %10
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %16
br label %32
26: ; preds = %16
br label %27
27: ; preds = %26, %13
%28 = load i32, i32* %2
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 0, i32 1
store i32 %31, i32* %2
br label %3
32: ; preds = %25, %3
ret void
}

LLVM IR (-O2):
define void @binary_loop() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = call i32 @get_next_line(i32 0, i8* undef)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %25
5: ; preds = %0
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = bitcast [2 x i8*]* %1 to i8***
br label %8
8: ; preds = %5, %18
%9 = phi i8** [ %6, %5 ], [ %21, %18 ]
%10 = phi i32 [ 0, %5 ], [ %19, %18 ]
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 @ft_place_entry(i8*** %7)
br label %18
14: ; preds = %8
%15 = load i8*, i8** %9
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %14, %12
%19 = xor i32 %10, 1
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @get_next_line(i32 0, i8* %22)
%24 = icmp eq i32 %23, 1
br i1 %24, label %8, label %25
25: ; preds = %18, %14, %0
ret void
}