#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 Lexical {
  int dummy;
};

/* Variables and functions */
struct Lexical *weakParseString_Lexical(char *str, int n) {
  struct Lexical *pLex = NULL;
  int i = 0;
  char c;
  for (i = 0; n <= 0 || i < n; i++) {
    c = str[i];
    if (n <= 0 && c == '\0') {
      break;
    }
  }
  return pLex;
}


x86 assembly (clang, -O0):
<weakParseString_Lexical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x1e(%rbp)
jle    113c <weakParseString_Lexical+0x3c>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    114c <weakParseString_Lexical+0x4c>
jmp    1189 <weakParseString_Lexical+0x89>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1d(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1176 <weakParseString_Lexical+0x76>
movsbl -0x1d(%rbp),%eax
cmp    $0x0,%eax
jne    1176 <weakParseString_Lexical+0x76>
jmp    1189 <weakParseString_Lexical+0x89>
jmp    117b <weakParseString_Lexical+0x7b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1121 <weakParseString_Lexical+0x21>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<weakParseString_Lexical>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.Lexical = type { i32 }
define %struct.Lexical* @weakParseString_Lexical(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.Lexical*
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store %struct.Lexical* null, %struct.Lexical** %5
store i32 0, i32* %6
store i32 0, i32* %6
br label %8
8: ; preds = %31, %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br label %15
15: ; preds = %11, %8
%16 = phi i1 [ true, %8 ], [ %14, %11 ]
br i1 %16, label %17, label %34
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
store i8 %22, i8* %7
%23 = load i32, i32* %4
%24 = icmp sle i32 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %17
%26 = load i8, i8* %7
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25
br label %34
30: ; preds = %25, %17
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %8
34: ; preds = %29, %15
%35 = load %struct.Lexical*, %struct.Lexical** %5
ret %struct.Lexical* %35
}

LLVM IR (-O2):
%struct.Lexical = type { i32 }
define noalias %struct.Lexical* @weakParseString_Lexical(i8* nocapture %0, i32 %1) {
ret %struct.Lexical* null
}