#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 OlLrcItem {
  int dummy;
};
struct OlLrc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ol_lrc_free(struct OlLrc *);
struct OlLrcItem *ol_lrc_get_item(struct OlLrc *, int /*<<< orphan*/);
int /*<<< orphan*/ *ol_lrc_item_get_lyric(struct OlLrcItem const *);
struct OlLrc *ol_lrc_new(char const *);
int /*<<< orphan*/ printf(char *, int, char *);
scalar_t__ strcmp(int /*<<< orphan*/ *, char *);
void no_newline_test() {
  const char *DATAFILE = "lrc_no_newline.lrc";
  struct OlLrc *lrc = ol_lrc_new(DATAFILE);
  const struct OlLrcItem *item = ol_lrc_get_item(lrc, 0);
  if (!(ol_lrc_item_get_lyric(item) != NULL)) {
    printf("ERROR[%d]: EXPECT %s failed\n", 82,
           "ol_lrc_item_get_lyric (item) != NULL");
  };
  if (!(strcmp(ol_lrc_item_get_lyric(item), "lyric") == 0)) {
    printf("ERROR[%d]: EXPECT %s failed\n", 83,
           "strcmp (ol_lrc_item_get_lyric (item), \"lyric\") == 0");
  };
  ol_lrc_free(lrc);
}


x86 assembly (clang, -O0):
<no_newline_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ol_lrc_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <ol_lrc_get_item@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <ol_lrc_item_get_lyric@plt>
cmp    $0x0,%rax
jne    11ba <no_newline_test+0x5a>
lea    0xe6a(%rip),%rdi
mov    $0x52,%esi
lea    0xe7b(%rip),%rdx
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ol_lrc_item_get_lyric@plt>
mov    %rax,%rdi
lea    0xe88(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11f4 <no_newline_test+0x94>
lea    0xe30(%rip),%rdi
mov    $0x53,%esi
lea    0xe6c(%rip),%rdx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <ol_lrc_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_newline_test>:
push   %r14
push   %rbx
push   %rax
lea    0xe95(%rip),%rdi
call   1040 <ol_lrc_new@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
call   1060 <ol_lrc_get_item@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <ol_lrc_item_get_lyric@plt>
test   %rax,%rax
jne    11a5 <no_newline_test+0x45>
lea    0xe7f(%rip),%rdi
lea    0xe95(%rip),%rdx
mov    $0x52,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1080 <ol_lrc_item_get_lyric@plt>
lea    0xea1(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11d9 <no_newline_test+0x79>
lea    0xe4b(%rip),%rdi
lea    0xe8c(%rip),%rdx
mov    $0x53,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <ol_lrc_free@plt>

LLVM IR (-O0):
%struct.OlLrc = type { i32 }
%struct.OlLrcItem = type { i32 }
@.str = [19 x i8] c"lrc_no_newline.lrc\00"
@.str.1 = [29 x i8] c"ERROR[%d]: EXPECT %s failed\0A\00"
@.str.2 = [37 x i8] c"ol_lrc_item_get_lyric (item) != NULL\00"
@.str.3 = [6 x i8] c"lyric\00"
@.str.4 = [52 x i8] c"strcmp (ol_lrc_item_get_lyric (item), \22lyric\22) == 0\00"
define void @no_newline_test() {
%1 = alloca i8*
%2 = alloca %struct.OlLrc*
%3 = alloca %struct.OlLrcItem*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = load i8*, i8** %1
%5 = call %struct.OlLrc* @ol_lrc_new(i8* %4)
store %struct.OlLrc* %5, %struct.OlLrc** %2
%6 = load %struct.OlLrc*, %struct.OlLrc** %2
%7 = call %struct.OlLrcItem* @ol_lrc_get_item(%struct.OlLrc* %6, i32 0)
store %struct.OlLrcItem* %7, %struct.OlLrcItem** %3
%8 = load %struct.OlLrcItem*, %struct.OlLrcItem** %3
%9 = call i32* @ol_lrc_item_get_lyric(%struct.OlLrcItem* %8)
%10 = icmp ne i32* %9, null
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
%14 = load %struct.OlLrcItem*, %struct.OlLrcItem** %3
%15 = call i32* @ol_lrc_item_get_lyric(%struct.OlLrcItem* %14)
%16 = call i64 @strcmp(i32* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %13
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 83, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %13
%21 = load %struct.OlLrc*, %struct.OlLrc** %2
%22 = call i32 @ol_lrc_free(%struct.OlLrc* %21)
ret void
}

LLVM IR (-O2):
%struct.OlLrc = type { i32 }
%struct.OlLrcItem = type { i32 }
@.str = [19 x i8] c"lrc_no_newline.lrc\00"
@.str.1 = [29 x i8] c"ERROR[%d]: EXPECT %s failed\0A\00"
@.str.2 = [37 x i8] c"ol_lrc_item_get_lyric (item) != NULL\00"
@.str.3 = [6 x i8] c"lyric\00"
@.str.4 = [52 x i8] c"strcmp (ol_lrc_item_get_lyric (item), \22lyric\22) == 0\00"
define void @no_newline_test() {
%1 = tail call %struct.OlLrc* @ol_lrc_new(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call %struct.OlLrcItem* @ol_lrc_get_item(%struct.OlLrc* %1, i32 0)
%3 = tail call i32* @ol_lrc_item_get_lyric(%struct.OlLrcItem* %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = tail call i32* @ol_lrc_item_get_lyric(%struct.OlLrcItem* %2)
%9 = tail call i64 @strcmp(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 83, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
%14 = tail call i32 @ol_lrc_free(%struct.OlLrc* %1)
ret void
}