#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 */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ ll_get_attribute(char const *, char *, int);
char *ll_get_first(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
void test_get_attribute_name_system_lang() {
  const char *license;
  char *name;
  license = "http://creativecommons.org/licenses/by-nd/2.0/de/";
  name = ll_get_first(
      ll_get_attribute(license, "http://purl.org/dc/elements/1.1/title", true));
  printf("get_name: '%s'\n", name);
  assert(strcmp(name, "Attribution-NoDerivs") == 0);
  free(name);
}


x86 assembly (clang, -O0):
<test_get_attribute_name_system_lang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x1,%edx
call   1040 <ll_get_attribute@plt>
mov    %eax,%edi
call   1080 <ll_get_first@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_attribute_name_system_lang>:
push   %rbx
lea    0xe98(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x1,%edx
call   1040 <ll_get_attribute@plt>
mov    %eax,%edi
call   1080 <ll_get_first@plt>
mov    %rax,%rbx
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"http://creativecommons.org/licenses/by-nd/2.0/de/\00"
@.str.1 = [38 x i8] c"http://purl.org/dc/elements/1.1/title\00"
@.str.2 = [16 x i8] c"get_name: '%s'\0A\00"
@.str.3 = [21 x i8] c"Attribution-NoDerivs\00"
define void @test_get_attribute_name_system_lang() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @ll_get_attribute(i8* %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = call i8* @ll_get_first(i32 %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"http://creativecommons.org/licenses/by-nd/2.0/de/\00"
@.str.1 = [38 x i8] c"http://purl.org/dc/elements/1.1/title\00"
@.str.2 = [16 x i8] c"get_name: '%s'\0A\00"
@.str.3 = [21 x i8] c"Attribution-NoDerivs\00"
define void @test_get_attribute_name_system_lang() {
%1 = tail call i32 @ll_get_attribute(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i8* @ll_get_first(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%4 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %2)
ret void
}