#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 *, unsigned char, unsigned char, unsigned char,
                          unsigned char);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int print_ip_address(char *title, unsigned char *bytes) {
  char *end = ": %d.%d.%d.%d\n";
  int len = strlen(end) + strlen(title) + 1;
  char format[len];
  strncpy(format, title, strlen(title) + 1);
  strcat(format, end);
  printf(format, bytes[0], bytes[1], bytes[2], bytes[3]);
}


x86 assembly (clang, -O0):
<print_ip_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xea9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x4c(%rbp),%ecx
mov    %eax,%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    0x1(%rax,%rcx,1),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    %eax,%edx
add    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%sil
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl 0x3(%rax),%r8d
call   1050 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ip_address>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%r15
lea    0xea5(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%r12d
mov    %r15,%rdi
call   1040 <strlen@plt>
add    %r12d,%eax
add    $0x1,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
movzbl 0x0(%r13),%esi
movzbl 0x1(%r13),%edx
movzbl 0x2(%r13),%ecx
movzbl 0x3(%r13),%r8d
mov    %rbx,%rdi
call   1050 <printf@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c": %d.%d.%d.%d\0A\00"
define i32 @print_ip_address(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %8
%19 = alloca i8, i64 %17
store i64 %17, i64* %9
%20 = load i8*, i8** %4
%21 = load i8*, i8** %4
%22 = call i32 @strlen(i8* %21)
%23 = add nsw i32 %22, 1
%24 = call i32 @strncpy(i8* %19, i8* %20, i32 %23)
%25 = load i8*, i8** %6
%26 = call i32 @strcat(i8* %19, i8* %25)
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = load i8, i8* %34
%36 = load i8*, i8** %5
%37 = getelementptr inbounds i8, i8* %36, i64 3
%38 = load i8, i8* %37
%39 = call i32 @printf(i8* %19, i8 zeroext %29, i8 zeroext %32, i8 zeroext %35, i8 zeroext %38)
%40 = load i8*, i8** %8
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@.str = [15 x i8] c": %d.%d.%d.%d\0A\00"
define i32 @print_ip_address(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* %0)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, 1
%11 = call i32 @strncpy(i8* %8, i8* %0, i32 %10)
%12 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = load i8, i8* %1
%14 = getelementptr inbounds i8, i8* %1, i64 1
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %1, i64 2
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8, i8* %1, i64 3
%19 = load i8, i8* %18
%20 = call i32 @printf(i8* %8, i8 zeroext %13, i8 zeroext %15, i8 zeroext %17, i8 zeroext %19)
ret i32 undef
}