#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*/ bin(int);
int /*<<< orphan*/ printf(char *);
void binPrint(unsigned char *ip) {
  bin((int)ip[3]);
  printf(".");
  bin((int)ip[2]);
  printf(".");
  bin((int)ip[1]);
  printf(".");
  bin((int)ip[0]);
  printf("\n");
}


x86 assembly (clang, -O0):
<binPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1030 <bin@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edi
call   1030 <bin@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <bin@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <bin@plt>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binPrint>:
push   %rbx
mov    %rdi,%rbx
movzbl 0x3(%rdi),%edi
call   1040 <bin@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
movzbl 0x2(%rbx),%edi
call   1040 <bin@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
movzbl 0x1(%rbx),%edi
call   1040 <bin@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%edi
call   1040 <bin@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @binPrint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = call i32 @bin(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = call i32 @bin(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = call i32 @bin(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = call i32 @bin(i32 %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @binPrint(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = tail call i32 @bin(i32 %4)
%6 = tail call i32 @putchar(i32 46)
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = tail call i32 @bin(i32 %9)
%11 = tail call i32 @putchar(i32 46)
%12 = getelementptr inbounds i8, i8* %0, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = tail call i32 @bin(i32 %14)
%16 = tail call i32 @putchar(i32 46)
%17 = load i8, i8* %0
%18 = zext i8 %17 to i32
%19 = tail call i32 @bin(i32 %18)
%20 = tail call i32 @putchar(i32 10)
ret void
}