#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 /*<<< orphan*/ uint32_t;
struct h2get_h2_header {
  int dummy;
};
struct h2get_ctx {
  int dummy;
};
struct h2get_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ h2get_buf_printf(struct h2get_buf *, char *, int);
int ntohl(int /*<<< orphan*/);
void h2get_frame_render_window_update(struct h2get_ctx *ctx,
                                      struct h2get_buf *out,
                                      struct h2get_h2_header *h, char *payload,
                                      size_t plen) {
  h2get_buf_printf(out, "\n\tincrement => %lu",
                   ntohl(*(uint32_t *)payload) >> 1);
  return;
}


x86 assembly (clang, -O0):
<h2get_frame_render_window_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohl@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%edx
sar    $0x1,%edx
lea    0xea1(%rip),%rsi
call   1030 <h2get_buf_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2get_frame_render_window_update>:
push   %rbx
mov    %rsi,%rbx
mov    (%rcx),%edi
call   1040 <ntohl@plt>
sar    %eax
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
pop    %rbx
jmp    1030 <h2get_buf_printf@plt>

LLVM IR (-O0):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [19 x i8] c"\0A\09increment => %lu\00"
define void @h2get_frame_render_window_update(%struct.h2get_ctx* %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* %2, i8* %3, i64 %4) {
%6 = alloca %struct.h2get_ctx*
%7 = alloca %struct.h2get_buf*
%8 = alloca %struct.h2get_h2_header*
%9 = alloca i8*
%10 = alloca i64
store %struct.h2get_ctx* %0, %struct.h2get_ctx** %6
store %struct.h2get_buf* %1, %struct.h2get_buf** %7
store %struct.h2get_h2_header* %2, %struct.h2get_h2_header** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load %struct.h2get_buf*, %struct.h2get_buf** %7
%12 = load i8*, i8** %9
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = call i32 @ntohl(i32 %14)
%16 = ashr i32 %15, 1
%17 = call i32 @h2get_buf_printf(%struct.h2get_buf* %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [19 x i8] c"\0A\09increment => %lu\00"
define void @h2get_frame_render_window_update(%struct.h2get_ctx* nocapture readnone %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* nocapture readnone %2, i8* nocapture %3, i64 %4) {
%6 = bitcast i8* %3 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @ntohl(i32 %7)
%9 = ashr i32 %8, 1
%10 = tail call i32 @h2get_buf_printf(%struct.h2get_buf* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}