#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 */
long atol(char const *);
char *get_str(char *, int);
scalar_t__ strlen(char const *);
long get_req_long(char *line, int column_number, int *ok) {
  if (column_number >= 0) {
    const char *str = get_str(line, column_number);
    if (str && strlen(str) > 0) {
      *ok = (!(0));
      return atol(str);
    } else {
      *ok = (0);
      return 0;
    }
  } else {
    *ok = (0);
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_req_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11ae <get_req_long+0x7e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <get_str@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1197 <get_req_long+0x67>
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1197 <get_req_long+0x67>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rdi
call   1050 <atol@plt>
mov    %rax,-0x8(%rbp)
jmp    11c0 <get_req_long+0x90>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    11c0 <get_req_long+0x90>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_req_long>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
test   %esi,%esi
js     116b <get_req_long+0x3b>
call   1040 <get_str@plt>
test   %rax,%rax
je     116b <get_req_long+0x3b>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    116b <get_req_long+0x3b>
movl   $0x1,(%r14)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <atol@plt>
movl   $0x0,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @get_req_long(i8* %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %27
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i8* @get_str(i8* %12, i32 %13)
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %25
17: ; preds = %11
%18 = load i8*, i8** %8
%19 = call i64 @strlen(i8* %18)
%20 = icmp sgt i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i32*, i32** %7
store i32 1, i32* %22
%23 = load i8*, i8** %8
%24 = call i64 @atol(i8* %23)
store i64 %24, i64* %4
br label %29
25: ; preds = %17, %11
%26 = load i32*, i32** %7
store i32 0, i32* %26
store i64 0, i64* %4
br label %29
27: ; preds = %3
%28 = load i32*, i32** %7
store i32 0, i32* %28
store i64 0, i64* %4
br label %29
29: ; preds = %27, %25, %21
%30 = load i64, i64* %4
ret i64 %30
}

LLVM IR (-O2):
define i64 @get_req_long(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, -1
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = tail call i8* @get_str(i8* %0, i32 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = tail call i64 @strlen(i8* %6)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
store i32 1, i32* %2
%12 = tail call i64 @atol(i8* %6)
br label %15
13: ; preds = %8, %5
store i32 0, i32* %2
br label %15
14: ; preds = %3
store i32 0, i32* %2
br label %15
15: ; preds = %11, %13, %14
%16 = phi i64 [ 0, %14 ], [ %12, %11 ], [ 0, %13 ]
ret i64 %16
}