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

/* Variables and functions */
extern unsigned char *convert_ip_addr(uint32_t number) {
  static unsigned char finished_version[4];
  finished_version[3] = number % 256;
  finished_version[2] = (number >> 8) % 256;
  finished_version[1] = (number >> 16) % 256;
  finished_version[0] = (number >> 24) % 256;
  return finished_version;
}


x86 assembly (clang, -O0):
<convert_ip_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,0x2f0a(%rip)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,0x2ef3(%rip)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,0x2edc(%rip)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,0x2ec5(%rip)
lea    0x2ebe(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_ip_addr>:
lea    0x2f1a(%rip),%rax
bswap  %edi
mov    %edi,0x2f12(%rip)
ret

LLVM IR (-O0):
@convert_ip_addr.finished_version = internal global [4 x i8] zeroinitializer
define i8* @convert_ip_addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 256
%5 = trunc i32 %4 to i8
store i8 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 3)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = srem i32 %7, 256
%9 = trunc i32 %8 to i8
store i8 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 2)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = srem i32 %11, 256
%13 = trunc i32 %12 to i8
store i8 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 1)
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = srem i32 %15, 256
%17 = trunc i32 %16 to i8
store i8 %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 0)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 0)
}

LLVM IR (-O2):
@convert_ip_addr.finished_version = internal global [4 x i8] zeroinitializer
define i8* @convert_ip_addr(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 3)
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 2)
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 1)
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 0)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @convert_ip_addr.finished_version, i64 0, i64 0)
}