#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*/ FILE;

/* Variables and functions */
char charDecode_C_Escape(char *, char **);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
char *printResultControlChar(FILE *f, char *s) {
  char c, *se;
  if (*s != '\\')
    return s;
  c = charDecode_C_Escape(s, &se);
  if (f)
    fputc(c, f);
  return se;
}


x86 assembly (clang, -O0):
<printResultControlChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     114d <printResultControlChar+0x2d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <printResultControlChar+0x5f>
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <charDecode_C_Escape@plt>
mov    %al,-0x19(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1177 <printResultControlChar+0x57>
mov    -0x19(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResultControlChar>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
cmpb   $0x5c,(%rsi)
jne    1152 <printResultControlChar+0x32>
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <charDecode_C_Escape@plt>
test   %rbx,%rbx
je     114d <printResultControlChar+0x2d>
movsbl %al,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @printResultControlChar(i32* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 92
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %5
store i8* %13, i8** %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = call signext i8 @charDecode_C_Escape(i8* %15, i8** %7)
store i8 %16, i8* %6
%17 = load i32*, i32** %4
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = load i8, i8* %6
%21 = load i32*, i32** %4
%22 = call i32 @fputc(i8 signext %20, i32* %21)
br label %23
23: ; preds = %19, %14
%24 = load i8*, i8** %7
store i8* %24, i8** %3
br label %25
25: ; preds = %23, %12
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @printResultControlChar(i32* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 92
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = call signext i8 @charDecode_C_Escape(i8* %1, i8** %3)
%9 = icmp eq i32* %0, null
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @fputc(i8 signext %8, i32* %0)
br label %12
12: ; preds = %10, %7
%13 = load i8*, i8** %3
br label %14
14: ; preds = %2, %12
%15 = phi i8* [ %13, %12 ], [ %1, %2 ]
ret i8* %15
}