#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 unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, unsigned int *, unsigned int *,
                          unsigned int *, unsigned int *);
extern uint32_t sockDotToIP_HostByteOrder(const char *pDot) {
  unsigned A = 0;
  unsigned B = 0;
  unsigned C = 0;
  unsigned D = 0;
  sscanf(pDot, "%u.%u.%u.%u", &A, &B, &C, &D);
  return A << 24U | B << 16U | C << 8U | D;
}


x86 assembly (clang, -O0):
<sockDotToIP_HostByteOrder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockDotToIP_HostByteOrder>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xec5(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
call   1030 <sscanf@plt>
mov    0x14(%rsp),%eax
shl    $0x18,%eax
mov    0x10(%rsp),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    0xc(%rsp),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i32 @sockDotToIP_HostByteOrder(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i8*, i8** %2
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %3
%10 = shl i32 %9, 24
%11 = load i32, i32* %4
%12 = shl i32 %11, 16
%13 = or i32 %10, %12
%14 = load i32, i32* %5
%15 = shl i32 %14, 8
%16 = or i32 %13, %15
%17 = load i32, i32* %6
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i32 @sockDotToIP_HostByteOrder(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%10 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
%12 = shl i32 %11, 24
%13 = load i32, i32* %3
%14 = shl i32 %13, 16
%15 = or i32 %14, %12
%16 = load i32, i32* %4
%17 = shl i32 %16, 8
%18 = or i32 %15, %17
%19 = load i32, i32* %5
%20 = or i32 %18, %19
ret i32 %20
}