#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 */
typedef int /*<<< orphan*/ examples;

/* Variables and functions */
int /*<<< orphan*/ _test_char(char const *, char);
void test_character_constants(void *fixture) {
  static struct {
    const char *str;
    char c;
  } examples[] = {{"'c'", 'c'}, {"'\n'", '\n'}};
  unsigned i;
  for (i = 0; i < (sizeof(examples) / sizeof((examples)[0])); i++)
    _test_char(examples[i].str, examples[i].c);
}


x86 assembly (clang, -O0):
<test_character_constants>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x2,%rax
jae    1170 <test_character_constants+0x60>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
lea    0x2ef4(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
lea    0x2ede(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsbl 0x8(%rax),%esi
call   1030 <_test_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <test_character_constants+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_character_constants>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x63,%esi
call   1030 <_test_char@plt>
lea    0xedb(%rip),%rdi
mov    $0xa,%esi
pop    %rax
jmp    1030 <_test_char@plt>

LLVM IR (-O0):
%struct.anon = type { i8*, i8 }
@test_character_constants.examples = internal global [2 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8 99 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8 10 }]
@.str = [4 x i8] c"'c'\00"
@.str.1 = [4 x i8] c"'\0A'\00"
define void @test_character_constants(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = icmp ult i64 %6, 2
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* @test_character_constants.examples, i64 0, i64 %10
%12 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%13 = load i8*, i8** %12
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* @test_character_constants.examples, i64 0, i64 %15
%17 = getelementptr inbounds %struct.anon, %struct.anon* %16, i32 0, i32 1
%18 = load i8, i8* %17
%19 = call i32 @_test_char(i8* %13, i8 signext %18)
br label %20
20: ; preds = %8
%21 = load i32, i32* %3
%22 = add i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"'c'\00"
@.str.1 = [4 x i8] c"'\0A'\00"
define void @test_character_constants(i8* nocapture readnone %0) {
%2 = tail call i32 @_test_char(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 99)
%3 = tail call i32 @_test_char(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
ret void
}