#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 */
int UINT32_C(int);
__attribute__((always_)) uint32_t __attribute__((const))
OF_BSWAP32_CONST(uint32_t i) {
  return (i & UINT32_C(0xFF000000)) >> 24 | (i & UINT32_C(0x00FF0000)) >> 8 |
         (i & UINT32_C(0x0000FF00)) << 8 | (i & UINT32_C(0x000000FF)) << 24;
}


x86 assembly (clang, -O0):
<OF_BSWAP32_CONST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0xff000000,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
and    %ecx,%eax
sar    $0x18,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0xff0000,%edi
call   1030 <UINT32_C@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
mov    -0x18(%rbp),%eax
and    %edx,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xff00,%edi
call   1030 <UINT32_C@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
and    %edx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xff,%edi
call   1030 <UINT32_C@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
and    %edx,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OF_BSWAP32_CONST>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    $0xff000000,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ebp
and    %r14d,%ebp
sar    $0x18,%ebp
mov    $0xff0000,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ebx
and    %r14d,%ebx
sar    $0x8,%ebx
or     %ebp,%ebx
mov    $0xff00,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ebp
and    %r14d,%ebp
shl    $0x8,%ebp
mov    $0xff,%edi
call   1030 <UINT32_C@plt>
and    %r14d,%eax
shl    $0x18,%eax
or     %ebp,%eax
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @OF_BSWAP32_CONST(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT32_C(i32 -16777216)
%5 = and i32 %3, %4
%6 = ashr i32 %5, 24
%7 = load i32, i32* %2
%8 = call i32 @UINT32_C(i32 16711680)
%9 = and i32 %7, %8
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32, i32* %2
%13 = call i32 @UINT32_C(i32 65280)
%14 = and i32 %12, %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = call i32 @UINT32_C(i32 255)
%19 = and i32 %17, %18
%20 = shl i32 %19, 24
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @OF_BSWAP32_CONST(i32 %0) {
%2 = tail call i32 @UINT32_C(i32 -16777216)
%3 = and i32 %2, %0
%4 = ashr i32 %3, 24
%5 = tail call i32 @UINT32_C(i32 16711680)
%6 = and i32 %5, %0
%7 = ashr i32 %6, 8
%8 = or i32 %7, %4
%9 = tail call i32 @UINT32_C(i32 65280)
%10 = and i32 %9, %0
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = tail call i32 @UINT32_C(i32 255)
%14 = and i32 %13, %0
%15 = shl i32 %14, 24
%16 = or i32 %12, %15
ret i32 %16
}