#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*/ number(int);
int /*<<< orphan*/ string(char *);
void ip(const char i[4]) {
  number((int)(i[0] & 0xFF));
  string(".");
  number((int)(i[1] & 0xFF));
  string(".");
  number((int)(i[2] & 0xFF));
  string(".");
  number((int)(i[3] & 0xFF));
}


x86 assembly (clang, -O0):
<ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
and    $0xff,%edi
call   1040 <number@plt>
lea    0xebb(%rip),%rdi
call   1030 <string@plt>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
and    $0xff,%edi
call   1040 <number@plt>
lea    0xe9c(%rip),%rdi
call   1030 <string@plt>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%edi
and    $0xff,%edi
call   1040 <number@plt>
lea    0xe7d(%rip),%rdi
call   1030 <string@plt>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%edi
and    $0xff,%edi
call   1040 <number@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movzbl (%rdi),%edi
call   1040 <number@plt>
lea    0xeca(%rip),%r14
mov    %r14,%rdi
call   1030 <string@plt>
movzbl 0x1(%rbx),%edi
call   1040 <number@plt>
mov    %r14,%rdi
call   1030 <string@plt>
movzbl 0x2(%rbx),%edi
call   1040 <number@plt>
mov    %r14,%rdi
call   1030 <string@plt>
movzbl 0x3(%rbx),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <number@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @ip(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = tail call i32 @number(i32 %3)
%5 = tail call i32 @string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = tail call i32 @number(i32 %8)
%10 = tail call i32 @string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = tail call i32 @number(i32 %13)
%15 = tail call i32 @string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = tail call i32 @number(i32 %18)
ret void
}