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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int volatile);
void sht1x_init(void *sht1x_address) {
  printf("ID is 0x%x\n", *((volatile int *)sht1x_address + 1));
  printf("SHT1X_TEMP_DATA is %d\n", *((volatile int *)sht1x_address + 2));
  printf("SHT1X_MOIS_DATA is %d\n", *((volatile int *)sht1x_address + 3));
}


x86 assembly (clang, -O0):
<sht1x_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sht1x_init>:
push   %rbx
mov    %rdi,%rbx
mov    0x4(%rdi),%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
lea    0xee7(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ID is 0x%x\0A\00"
@.str.1 = [23 x i8] c"SHT1X_TEMP_DATA is %d\0A\00"
@.str.2 = [23 x i8] c"SHT1X_MOIS_DATA is %d\0A\00"
define void @sht1x_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load volatile i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load volatile i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %2
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load volatile i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ID is 0x%x\0A\00"
@.str.1 = [23 x i8] c"SHT1X_TEMP_DATA is %d\0A\00"
@.str.2 = [23 x i8] c"SHT1X_MOIS_DATA is %d\0A\00"
define void @sht1x_init(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = bitcast i8* %2 to i32*
%4 = load volatile i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i32*
%8 = load volatile i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8, i8* %0, i64 12
%11 = bitcast i8* %10 to i32*
%12 = load volatile i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret void
}