#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 */
char *quoted_string_parse(char *, char *, int, int, char);
int /*<<< orphan*/ strcpy(char *, char *);
const char *get_str(char *line, int column_number) {
  static char ret[256];
  if (column_number >= 0) {
    int i;
    char *p = line;
    for (i = 0; i <= column_number; ++i)
      p = quoted_string_parse(p, ret, 256, -1, ',');
  } else {
    strcpy(ret, "");
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     118b <get_str+0x6b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1186 <get_str+0x66>
mov    -0x18(%rbp),%rdi
lea    0x2ee1(%rip),%rsi
mov    $0x100,%edx
mov    $0xffffffff,%ecx
mov    $0x2c,%r8d
call   1040 <quoted_string_parse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <get_str+0x28>
jmp    119e <get_str+0x7e>
lea    0x2eae(%rip),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2e9b(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
js     1162 <get_str+0x42>
mov    %esi,%ebx
mov    %rdi,%rax
add    $0x1,%ebx
lea    0x2f09(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x100,%edx
mov    $0xffffffff,%ecx
mov    $0x2c,%r8d
call   1040 <quoted_string_parse@plt>
add    $0xffffffff,%ebx
jne    1140 <get_str+0x20>
jmp    1175 <get_str+0x55>
lea    0x2ed7(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ec4(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_str.ret = internal global [256 x i8] zeroinitializer
@.str = [1 x i8] zeroinitializer
define i8* @get_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %2
%10 = load i8*, i8** %3
store i8* %10, i8** %6
store i32 0, i32* %5
br label %11
11: ; preds = %18, %9
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8*, i8** %6
%17 = call i8* @quoted_string_parse(i8* %16, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_str.ret, i64 0, i64 0), i32 256, i32 -1, i8 signext 44)
store i8* %17, i8** %6
br label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %11
21: ; preds = %11
br label %24
22: ; preds = %2
%23 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_str.ret, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %22, %21
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_str.ret, i64 0, i64 0)
}

LLVM IR (-O2):
@get_str.ret = internal global [256 x i8] zeroinitializer
@.str = [1 x i8] zeroinitializer
define i8* @get_str(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i8* [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = tail call i8* @quoted_string_parse(i8* %5, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_str.ret, i64 0, i64 0), i32 256, i32 -1, i8 signext 44)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %1
br i1 %9, label %12, label %4
10: ; preds = %2
%11 = tail call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_str.ret, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %4, %10
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_str.ret, i64 0, i64 0)
}