#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 lm {
  int dummy;
};
struct dyString {
  int dummy;
};

/* Variables and functions */
char *csvParseOneOut(char *, int, struct dyString *);
char *emptyForNull(int /*<<< orphan*/);
int /*<<< orphan*/ freeDyString(struct dyString **);
int /*<<< orphan*/ lmCloneString(struct lm *, char *);
struct dyString *newDyString(int /*<<< orphan*/);
char *uncsvString(char *csvIn, int ix, struct lm *lm) {
  struct dyString *scratch = newDyString(0);
  char *one = csvParseOneOut(csvIn, ix, scratch);
  char *res = emptyForNull(lmCloneString(lm, one));
  freeDyString(&scratch);
  ;
  return res;
}


x86 assembly (clang, -O0):
<uncsvString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1040 <newDyString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1060 <csvParseOneOut@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <lmCloneString@plt>
mov    %eax,%edi
call   1070 <emptyForNull@plt>
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <freeDyString@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncsvString>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <newDyString@plt>
mov    %rax,0x8(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1060 <csvParseOneOut@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <lmCloneString@plt>
mov    %eax,%edi
call   1070 <emptyForNull@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1050 <freeDyString@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.lm = type { i32 }
%struct.dyString = type { i32 }
define i8* @uncsvString(i8* %0, i32 %1, %struct.lm* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.lm*
%7 = alloca %struct.dyString*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.lm* %2, %struct.lm** %6
%10 = call %struct.dyString* @newDyString(i32 0)
store %struct.dyString* %10, %struct.dyString** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load %struct.dyString*, %struct.dyString** %7
%14 = call i8* @csvParseOneOut(i8* %11, i32 %12, %struct.dyString* %13)
store i8* %14, i8** %8
%15 = load %struct.lm*, %struct.lm** %6
%16 = load i8*, i8** %8
%17 = call i32 @lmCloneString(%struct.lm* %15, i8* %16)
%18 = call i8* @emptyForNull(i32 %17)
store i8* %18, i8** %9
%19 = call i32 @freeDyString(%struct.dyString** %7)
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
%struct.lm = type { i32 }
%struct.dyString = type { i32 }
define i8* @uncsvString(i8* %0, i32 %1, %struct.lm* %2) {
%4 = alloca %struct.dyString*
%5 = bitcast %struct.dyString** %4 to i8*
%6 = tail call %struct.dyString* @newDyString(i32 0)
store %struct.dyString* %6, %struct.dyString** %4
%7 = tail call i8* @csvParseOneOut(i8* %0, i32 %1, %struct.dyString* %6)
%8 = tail call i32 @lmCloneString(%struct.lm* %2, i8* %7)
%9 = tail call i8* @emptyForNull(i32 %8)
%10 = call i32 @freeDyString(%struct.dyString** %4)
ret i8* %9
}