#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*/ FILE;

/* Variables and functions */
int RIFF_ReadInt32(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int RIFF_ReadChunkInfo(FILE *fd, int ofs, int *id, int *sz, int *lid) {
  fseek(fd, ofs, 0);
  if (id)
    *id = RIFF_ReadInt32(fd);
  if (sz)
    *sz = RIFF_ReadInt32(fd);
  if (lid)
    *lid = RIFF_ReadInt32(fd);
  return (0);
}


x86 assembly (clang, -O0):
<RIFF_ReadChunkInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <fseek@plt>
cmpq   $0x0,-0x18(%rbp)
je     1165 <RIFF_ReadChunkInfo+0x45>
mov    -0x8(%rbp),%rdi
call   1040 <RIFF_ReadInt32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1181 <RIFF_ReadChunkInfo+0x61>
mov    -0x8(%rbp),%rdi
call   1040 <RIFF_ReadInt32@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     119d <RIFF_ReadChunkInfo+0x7d>
mov    -0x8(%rbp),%rdi
call   1040 <RIFF_ReadInt32@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIFF_ReadChunkInfo>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%rbx
xor    %edx,%edx
call   1030 <fseek@plt>
test   %r12,%r12
je     114c <RIFF_ReadChunkInfo+0x2c>
mov    %rbx,%rdi
call   1040 <RIFF_ReadInt32@plt>
mov    %eax,(%r12)
test   %r15,%r15
je     115c <RIFF_ReadChunkInfo+0x3c>
mov    %rbx,%rdi
call   1040 <RIFF_ReadInt32@plt>
mov    %eax,(%r15)
test   %r14,%r14
je     116c <RIFF_ReadChunkInfo+0x4c>
mov    %rbx,%rdi
call   1040 <RIFF_ReadInt32@plt>
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @RIFF_ReadChunkInfo(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @fseek(i32* %11, i32 %12, i32 0)
%14 = load i32*, i32** %8
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %5
%17 = load i32*, i32** %6
%18 = call i32 @RIFF_ReadInt32(i32* %17)
%19 = load i32*, i32** %8
store i32 %18, i32* %19
br label %20
20: ; preds = %16, %5
%21 = load i32*, i32** %9
%22 = icmp ne i32* %21, null
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i32*, i32** %6
%25 = call i32 @RIFF_ReadInt32(i32* %24)
%26 = load i32*, i32** %9
store i32 %25, i32* %26
br label %27
27: ; preds = %23, %20
%28 = load i32*, i32** %10
%29 = icmp ne i32* %28, null
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i32*, i32** %6
%32 = call i32 @RIFF_ReadInt32(i32* %31)
%33 = load i32*, i32** %10
store i32 %32, i32* %33
br label %34
34: ; preds = %30, %27
ret i32 0
}

LLVM IR (-O2):
define i32 @RIFF_ReadChunkInfo(i32* %0, i32 %1, i32* writeonly %2, i32* writeonly %3, i32* writeonly %4) {
%6 = tail call i32 @fseek(i32* %0, i32 %1, i32 0)
%7 = icmp eq i32* %2, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @RIFF_ReadInt32(i32* %0)
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %5
%11 = icmp eq i32* %3, null
br i1 %11, label %14, label %12
12: ; preds = %10
%13 = tail call i32 @RIFF_ReadInt32(i32* %0)
store i32 %13, i32* %3
br label %14
14: ; preds = %12, %10
%15 = icmp eq i32* %4, null
br i1 %15, label %18, label %16
16: ; preds = %14
%17 = tail call i32 @RIFF_ReadInt32(i32* %0)
store i32 %17, i32* %4
br label %18
18: ; preds = %16, %14
ret i32 0
}