#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*/ sscanf(char *, char *, int *, int *, int *, int *);
char *convertAddr(char *name, char *addr) {
  int addrInt[10];
  sscanf(name, "%d.%d.%d.%d", &(addrInt[0]), &(addrInt[1]), &(addrInt[2]),
         &(addrInt[3]));
  addr[0] = addrInt[0];
  addr[1] = addrInt[1];
  addr[2] = addrInt[2];
  addr[3] = addrInt[3];
  return (addr);
}


x86 assembly (clang, -O0):
<convertAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    -0x40(%rbp),%rcx
add    $0x4,%rcx
lea    -0x40(%rbp),%r8
add    $0x8,%r8
lea    -0x40(%rbp),%r9
add    $0xc,%r9
lea    0xeb9(%rip),%rsi
call   1030 <sscanf@plt>
mov    -0x40(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x3c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x38(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x34(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertAddr>:
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0xc(%rsp),%r9
lea    0xee2(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
movdqa (%rsp),%xmm0
pand   0xebd(%rip),%xmm0
packuswb %xmm0,%xmm0
packuswb %xmm0,%xmm0
movd   %xmm0,(%rbx)
mov    %rbx,%rax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @convertAddr(i8* nocapture %0, i8* returned writeonly %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%9 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8)
%10 = bitcast [10 x i32]* %3 to <4 x i32>*
%11 = load <4 x i32>, <4 x i32>* %10
%12 = trunc <4 x i32> %11 to <4 x i8>
%13 = bitcast i8* %1 to <4 x i8>*
store <4 x i8> %12, <4 x i8>* %13
ret i8* %1
}