#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 c;

/* Variables and functions */
int /*<<< orphan*/ Visualizar(unsigned char);
unsigned char getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  unsigned char c;
  printf("Introducir un carácter: ");
  c = getchar();
  Visualizar(c);
  c = ((((c)&0x01) << 7) | (((c)&0x02) << 5) | (((c)&0x04) << 3) |
       (((c)&0x08) << 1) | (((c)&0x10) >> 1) | (((c)&0x20) >> 3) |
       (((c)&0x40) >> 5) | (((c)&0x80) >> 7));
  printf("\nCarácter reflejado: %c\n", c);
  Visualizar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1050 <Visualizar@plt>
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
shl    $0x7,%eax
movzbl -0x1(%rbp),%ecx
and    $0x2,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x4,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x8,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x10,%ecx
sar    $0x1,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x20,%ecx
sar    $0x3,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x40,%ecx
sar    $0x5,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x80,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x1(%rbp),%edi
call   1050 <Visualizar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movzbl %al,%ebx
mov    %ebx,%edi
call   1050 <Visualizar@plt>
rol    $0x4,%bl
mov    %ebx,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%bl
and    $0x33,%bl
or     %al,%bl
mov    %ebx,%eax
and    $0x55,%al
add    %al,%al
shr    %bl
and    $0x55,%bl
or     %al,%bl
movzbl %bl,%ebx
lea    0xea1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <Visualizar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Introducir un car\C3\A1cter: \00"
@.str.1 = [26 x i8] c"\0ACar\C3\A1cter reflejado: %c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call zeroext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @Visualizar(i8 zeroext %4)
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
%9 = shl i32 %8, 7
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = and i32 %11, 2
%13 = shl i32 %12, 5
%14 = or i32 %9, %13
%15 = load i8, i8* %1
%16 = zext i8 %15 to i32
%17 = and i32 %16, 4
%18 = shl i32 %17, 3
%19 = or i32 %14, %18
%20 = load i8, i8* %1
%21 = zext i8 %20 to i32
%22 = and i32 %21, 8
%23 = shl i32 %22, 1
%24 = or i32 %19, %23
%25 = load i8, i8* %1
%26 = zext i8 %25 to i32
%27 = and i32 %26, 16
%28 = ashr i32 %27, 1
%29 = or i32 %24, %28
%30 = load i8, i8* %1
%31 = zext i8 %30 to i32
%32 = and i32 %31, 32
%33 = ashr i32 %32, 3
%34 = or i32 %29, %33
%35 = load i8, i8* %1
%36 = zext i8 %35 to i32
%37 = and i32 %36, 64
%38 = ashr i32 %37, 5
%39 = or i32 %34, %38
%40 = load i8, i8* %1
%41 = zext i8 %40 to i32
%42 = and i32 %41, 128
%43 = ashr i32 %42, 7
%44 = or i32 %39, %43
%45 = trunc i32 %44 to i8
store i8 %45, i8* %1
%46 = load i8, i8* %1
%47 = zext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = load i8, i8* %1
%50 = call i32 @Visualizar(i8 zeroext %49)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Introducir un car\C3\A1cter: \00"
@.str.1 = [26 x i8] c"\0ACar\C3\A1cter reflejado: %c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call zeroext i8 (...) @getchar()
%3 = tail call i32 @Visualizar(i8 zeroext %2)
%4 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%5 = zext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @Visualizar(i8 zeroext %4)
ret i32 0
}