#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*/ printf(char *, ...);
void output_single_characters(int *freqMap) {
  printf("The following characters appear only once in the array:\n");
  for (int i = 0; i < 256; i++) {
    if (freqMap[i] == 1) {
      printf("%c ", (char)i);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<output_single_characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1177 <output_single_characters+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1164 <output_single_characters+0x54>
mov    -0xc(%rbp),%eax
movsbl %al,%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <output_single_characters+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <output_single_characters+0x21>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_single_characters>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb3(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1173 <output_single_characters+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
add    $0x1000000,%ebp
cmp    $0x100,%rbx
je     118b <output_single_characters+0x5b>
cmpl   $0x1,(%r15,%rbx,4)
jne    1160 <output_single_characters+0x30>
mov    %ebp,%esi
sar    $0x18,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1160 <output_single_characters+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"The following characters appear only once in the array:\0A\00"
@.str.1 = [4 x i8] c"%c \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @output_single_characters(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = load i32, i32* %3
%17 = trunc i32 %16 to i8
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %15, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c \00"
@str = [56 x i8] c"The following characters appear only once in the array:\00"
define void @output_single_characters(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
br label %5
3: ; preds = %15
%4 = tail call i32 @putchar(i32 10)
ret void
5: ; preds = %1, %15
%6 = phi i64 [ 0, %1 ], [ %16, %15 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = trunc i64 %6 to i32
%12 = shl i32 %11, 24
%13 = ashr exact i32 %12, 24
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %5, %10
%16 = add nuw nsw i64 %6, 1
%17 = icmp eq i64 %16, 256
br i1 %17, label %3, label %5
}