#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 const *csv_skip_whitespace(char const *);
scalar_t__ strncmp(char const *, char const *, int);
const char *csv_parameter(const char *zTag, int nTag, const char *z) {
  z = csv_skip_whitespace(z);
  if (strncmp(zTag, z, nTag) != 0)
    return 0;
  z = csv_skip_whitespace(z + nTag);
  if (z[0] != '=')
    return 0;
  return csv_skip_whitespace(z + 1);
}


x86 assembly (clang, -O0):
<csv_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <csv_skip_whitespace@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1167 <csv_parameter+0x47>
movq   $0x0,-0x8(%rbp)
jmp    11a9 <csv_parameter+0x89>
mov    -0x20(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
call   1040 <csv_skip_whitespace@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     1198 <csv_parameter+0x78>
movq   $0x0,-0x8(%rbp)
jmp    11a9 <csv_parameter+0x89>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1040 <csv_skip_whitespace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_parameter>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1040 <csv_skip_whitespace@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    116b <csv_parameter+0x4b>
movslq %r14d,%rax
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <csv_skip_whitespace@plt>
cmpb   $0x3d,(%rax)
jne    116b <csv_parameter+0x4b>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <csv_skip_whitespace@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @csv_parameter(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = call i8* @csv_skip_whitespace(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = call i64 @strncmp(i8* %10, i8* %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i8* null, i8** %4
br label %32
16: ; preds = %3
%17 = load i8*, i8** %7
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = call i8* @csv_skip_whitespace(i8* %20)
store i8* %21, i8** %7
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 61
br i1 %26, label %27, label %28
27: ; preds = %16
store i8* null, i8** %4
br label %32
28: ; preds = %16
%29 = load i8*, i8** %7
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = call i8* @csv_skip_whitespace(i8* %30)
store i8* %31, i8** %4
br label %32
32: ; preds = %28, %27, %15
%33 = load i8*, i8** %4
ret i8* %33
}

LLVM IR (-O2):
define i8* @csv_parameter(i8* %0, i32 %1, i8* %2) {
%4 = tail call i8* @csv_skip_whitespace(i8* %2)
%5 = tail call i64 @strncmp(i8* %0, i8* %4, i32 %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
%10 = tail call i8* @csv_skip_whitespace(i8* %9)
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 61
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = tail call i8* @csv_skip_whitespace(i8* %14)
br label %16
16: ; preds = %7, %3, %13
%17 = phi i8* [ %15, %13 ], [ null, %3 ], [ null, %7 ]
ret i8* %17
}