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

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, unsigned char *, int);
void ipmi_test(int fildes) {
  printf("==IPMI RAW TEST==\n");
  unsigned char data[272];
  int size;
  int i = 0;
  int j = 0;
  for (i = 1; i < 20; i++) {
    lseek(fildes, 0x0001000000000000 | i, 2);
    size = read(fildes, data, sizeof(data));
    printf("IPMI Sensor Reading ID %d: ", i);
    for (j = 0; j < size; j++) {
      printf("%x ", data[j]);
    }
    printf("Error Code: %d\n", size);
  }
  for (i = 1; i < 20; i++) {
    lseek(fildes, 0x0000000000000000 | i, 2);
    size = read(fildes, data, sizeof(data));
    printf("IPMI Get SDR Record ID %d: ", i);
    for (j = 0; j < size; j++) {
      printf("%x ", data[j]);
    }
    printf("Error Code: %d\n", size);
  }
  lseek(fildes, 0x0002000000000000, 2);
  size = read(fildes, data, sizeof(data));
  printf("IPMI Dell Reset Energy: ");
  for (j = 0; j < size; j++) {
    printf("%x ", data[j]);
  }
  printf("Error Code: %d\n", size);
  lseek(fildes, 0x0003000000000000, 2);
  size = read(fildes, data, sizeof(data));
  printf("IPMI Dell Cumulative Energy: ");
  for (j = 0; j < size; j++) {
    printf("%x ", data[j]);
  }
  printf("Error Code: %d\n", size);
  lseek(fildes, 0x0004000000000000, 2);
  size = read(fildes, data, sizeof(data));
  printf("IPMI Dell Current Power: ");
  for (j = 0; j < size; j++) {
    printf("%x ", data[j]);
  }
  printf("Error Code: %d\n", size);
}


x86 assembly (clang, -O0):
<ipmi_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x128(%rbp)
movl   $0x0,-0x12c(%rbp)
movl   $0x1,-0x128(%rbp)
cmpl   $0x14,-0x128(%rbp)
jge    123d <ipmi_test+0x10d>
mov    -0x4(%rbp),%edi
movslq -0x128(%rbp),%rax
movabs $0x1000000000000,%rcx
or     %rcx,%rax
mov    %eax,%esi
mov    $0x2,%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x110,%edx
call   1050 <read@plt>
mov    %eax,-0x124(%rbp)
mov    -0x128(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    1215 <ipmi_test+0xe5>
movslq -0x12c(%rbp),%rax
movzbl -0x120(%rbp,%rax,1),%esi
ff
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    11d2 <ipmi_test+0xa2>
mov    -0x124(%rbp),%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x128(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x128(%rbp)
jmp    116a <ipmi_test+0x3a>
movl   $0x1,-0x128(%rbp)
cmpl   $0x14,-0x128(%rbp)
jge    130d <ipmi_test+0x1dd>
mov    -0x4(%rbp),%edi
mov    -0x128(%rbp),%esi
or     $0x0,%esi
mov    $0x2,%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x110,%edx
call   1050 <read@plt>
mov    %eax,-0x124(%rbp)
mov    -0x128(%rbp),%esi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    12e5 <ipmi_test+0x1b5>
movslq -0x12c(%rbp),%rax
movzbl -0x120(%rbp,%rax,1),%esi
ff
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    12a2 <ipmi_test+0x172>
mov    -0x124(%rbp),%esi
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x128(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x128(%rbp)
jmp    1247 <ipmi_test+0x117>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x110,%edx
call   1050 <read@plt>
mov    %eax,-0x124(%rbp)
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    1391 <ipmi_test+0x261>
movslq -0x12c(%rbp),%rax
movzbl -0x120(%rbp,%rax,1),%esi
ff
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    134e <ipmi_test+0x21e>
mov    -0x124(%rbp),%esi
lea    0xc95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x110,%edx
call   1050 <read@plt>
mov    %eax,-0x124(%rbp)
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    1429 <ipmi_test+0x2f9>
movslq -0x12c(%rbp),%rax
movzbl -0x120(%rbp,%rax,1),%esi
ff
lea    0xc21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    13e6 <ipmi_test+0x2b6>
mov    -0x124(%rbp),%esi
lea    0xbfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x110,%edx
call   1050 <read@plt>
mov    %eax,-0x124(%rbp)
lea    0xc29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    14c1 <ipmi_test+0x391>
movslq -0x12c(%rbp),%rax
movzbl -0x120(%rbp,%rax,1),%esi
ff
lea    0xb89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    147e <ipmi_test+0x34e>
mov    -0x124(%rbp),%esi
lea    0xb65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipmi_test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %edi,%r12d
lea    0xf42(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
lea    0xeb0(%rip),%rbx
jmp    1189 <ipmi_test+0x49>
xchg   %ax,%ax
lea    0xea9(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x14,%ebp
je     11ea <ipmi_test+0xaa>
mov    %r12d,%edi
mov    %ebp,%esi
mov    $0x2,%edx
call   1050 <lseek@plt>
mov    %r12d,%edi
mov    %rsp,%rsi
mov    $0x110,%edx
call   1060 <read@plt>
mov    %eax,%r14d
lea    0xe4e(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    1170 <ipmi_test+0x30>
mov    %r14d,%r15d
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
movzbl (%rsp,%r13,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r15
jne    11d0 <ipmi_test+0x90>
jmp    1170 <ipmi_test+0x30>
mov    $0x1,%ebp
lea    0xe26(%rip),%rbx
jmp    1219 <ipmi_test+0xd9>
nopl   0x0(%rax,%rax,1)
lea    0xe19(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x14,%ebp
je     127a <ipmi_test+0x13a>
mov    %r12d,%edi
mov    %ebp,%esi
mov    $0x2,%edx
call   1050 <lseek@plt>
mov    %r12d,%edi
mov    %rsp,%rsi
mov    $0x110,%edx
call   1060 <read@plt>
mov    %eax,%r14d
lea    0xdee(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    1200 <ipmi_test+0xc0>
mov    %r14d,%r15d
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
movzbl (%rsp,%r13,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r15
jne    1260 <ipmi_test+0x120>
jmp    1200 <ipmi_test+0xc0>
mov    %r12d,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <lseek@plt>
mov    %rsp,%rsi
mov    %r12d,%edi
mov    $0x110,%edx
call   1060 <read@plt>
mov    %eax,%r14d
lea    0xda9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    12d7 <ipmi_test+0x197>
mov    %r14d,%ebx
lea    0xd63(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    12c0 <ipmi_test+0x180>
lea    0xd42(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12d,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <lseek@plt>
mov    %rsp,%rsi
mov    %r12d,%edi
mov    $0x110,%edx
call   1060 <read@plt>
mov    %eax,%r14d
lea    0xd54(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    1347 <ipmi_test+0x207>
mov    %r14d,%ebx
lea    0xcf5(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
movzbl (%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1330 <ipmi_test+0x1f0>
lea    0xcd2(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12d,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <lseek@plt>
mov    %rsp,%rsi
mov    %r12d,%edi
mov    $0x110,%edx
call   1060 <read@plt>
mov    %eax,%r14d
lea    0xd02(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    13b7 <ipmi_test+0x277>
mov    %r14d,%ebx
lea    0xc85(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
movzbl (%rsp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    13a0 <ipmi_test+0x260>
lea    0xc62(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"==IPMI RAW TEST==\0A\00"
@.str.1 = [28 x i8] c"IPMI Sensor Reading ID %d: \00"
@.str.2 = [4 x i8] c"%x \00"
@.str.3 = [16 x i8] c"Error Code: %d\0A\00"
@.str.4 = [28 x i8] c"IPMI Get SDR Record ID %d: \00"
@.str.5 = [25 x i8] c"IPMI Dell Reset Energy: \00"
@.str.6 = [30 x i8] c"IPMI Dell Cumulative Energy: \00"
@.str.7 = [26 x i8] c"IPMI Dell Current Power: \00"
define void @ipmi_test(i32 %0) {
%2 = alloca i32
%3 = alloca [272 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
store i32 0, i32* %6
store i32 1, i32* %5
br label %8
8: ; preds = %40, %1
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %43
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = or i64 281474976710656, %14
%16 = trunc i64 %15 to i32
%17 = call i32 @lseek(i32 %12, i32 %16, i32 2)
%18 = load i32, i32* %2
%19 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 0
%20 = call i32 @read(i32 %18, i8* %19, i32 272)
store i32 %20, i32* %4
%21 = load i32, i32* %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %21)
store i32 0, i32* %6
br label %23
23: ; preds = %34, %11
%24 = load i32, i32* %6
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %37
27: ; preds = %23
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %27
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %23
37: ; preds = %23
%38 = load i32, i32* %4
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %37
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %8
43: ; preds = %8
store i32 1, i32* %5
br label %44
44: ; preds = %74, %43
%45 = load i32, i32* %5
%46 = icmp slt i32 %45, 20
br i1 %46, label %47, label %77
47: ; preds = %44
%48 = load i32, i32* %2
%49 = load i32, i32* %5
%50 = or i32 0, %49
%51 = call i32 @lseek(i32 %48, i32 %50, i32 2)
%52 = load i32, i32* %2
%53 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 0
%54 = call i32 @read(i32 %52, i8* %53, i32 272)
store i32 %54, i32* %4
%55 = load i32, i32* %5
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %55)
store i32 0, i32* %6
br label %57
57: ; preds = %68, %47
%58 = load i32, i32* %6
%59 = load i32, i32* %4
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %71
61: ; preds = %57
%62 = load i32, i32* %6
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %61
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
br label %57
71: ; preds = %57
%72 = load i32, i32* %4
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %71
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %5
br label %44
77: ; preds = %44
%78 = load i32, i32* %2
%79 = call i32 @lseek(i32 %78, i32 0, i32 2)
%80 = load i32, i32* %2
%81 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 0
%82 = call i32 @read(i32 %80, i8* %81, i32 272)
store i32 %82, i32* %4
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %84
84: ; preds = %95, %77
%85 = load i32, i32* %6
%86 = load i32, i32* %4
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %98
88: ; preds = %84
%89 = load i32, i32* %6
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %88
%96 = load i32, i32* %6
%97 = add nsw i32 %96, 1
store i32 %97, i32* %6
br label %84
98: ; preds = %84
%99 = load i32, i32* %4
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %2
%102 = call i32 @lseek(i32 %101, i32 0, i32 2)
%103 = load i32, i32* %2
%104 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 0
%105 = call i32 @read(i32 %103, i8* %104, i32 272)
store i32 %105, i32* %4
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %6
br label %107
107: ; preds = %118, %98
%108 = load i32, i32* %6
%109 = load i32, i32* %4
%110 = icmp slt i32 %108, %109
br i1 %110, label %111, label %121
111: ; preds = %107
%112 = load i32, i32* %6
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 %113
%115 = load i8, i8* %114
%116 = zext i8 %115 to i32
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %116)
br label %118
118: ; preds = %111
%119 = load i32, i32* %6
%120 = add nsw i32 %119, 1
store i32 %120, i32* %6
br label %107
121: ; preds = %107
%122 = load i32, i32* %4
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %122)
%124 = load i32, i32* %2
%125 = call i32 @lseek(i32 %124, i32 0, i32 2)
%126 = load i32, i32* %2
%127 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 0
%128 = call i32 @read(i32 %126, i8* %127, i32 272)
store i32 %128, i32* %4
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %6
br label %130
130: ; preds = %141, %121
%131 = load i32, i32* %6
%132 = load i32, i32* %4
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %144
134: ; preds = %130
%135 = load i32, i32* %6
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 %136
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %139)
br label %141
141: ; preds = %134
%142 = load i32, i32* %6
%143 = add nsw i32 %142, 1
store i32 %143, i32* %6
br label %130
144: ; preds = %130
%145 = load i32, i32* %4
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %145)
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"IPMI Sensor Reading ID %d: \00"
@.str.2 = [4 x i8] c"%x \00"
@.str.3 = [16 x i8] c"Error Code: %d\0A\00"
@.str.4 = [28 x i8] c"IPMI Get SDR Record ID %d: \00"
@.str.5 = [25 x i8] c"IPMI Dell Reset Energy: \00"
@.str.6 = [30 x i8] c"IPMI Dell Cumulative Energy: \00"
@.str.7 = [26 x i8] c"IPMI Dell Current Power: \00"
@str = [18 x i8] c"==IPMI RAW TEST==\00"
define void @ipmi_test(i32 %0) {
%2 = alloca [272 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [272 x i8], [272 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %1, %21
%6 = phi i32 [ 1, %1 ], [ %23, %21 ]
%7 = tail call i32 @lseek(i32 %0, i32 %6, i32 2)
%8 = call i32 @read(i32 %0, i8* %4, i32 272)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %21
11: ; preds = %5
%12 = zext i32 %8 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %19, %13 ]
%15 = getelementptr inbounds [272 x i8], [272 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = add nuw nsw i64 %14, 1
%20 = icmp eq i64 %19, %12
br i1 %20, label %21, label %13
21: ; preds = %13, %5
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%23 = add nuw nsw i32 %6, 1
%24 = icmp eq i32 %23, 20
br i1 %24, label %25, label %5
25: ; preds = %21, %41
%26 = phi i32 [ %43, %41 ], [ 1, %21 ]
%27 = tail call i32 @lseek(i32 %0, i32 %26, i32 2)
%28 = call i32 @read(i32 %0, i8* %4, i32 272)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%30 = icmp sgt i32 %28, 0
br i1 %30, label %31, label %41
31: ; preds = %25
%32 = zext i32 %28 to i64
br label %33
33: ; preds = %31, %33
%34 = phi i64 [ 0, %31 ], [ %39, %33 ]
%35 = getelementptr inbounds [272 x i8], [272 x i8]* %2, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i64 %34, 1
%40 = icmp eq i64 %39, %32
br i1 %40, label %41, label %33
41: ; preds = %33, %25
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%43 = add nuw nsw i32 %26, 1
%44 = icmp eq i32 %43, 20
br i1 %44, label %45, label %25
45: ; preds = %41
%46 = tail call i32 @lseek(i32 %0, i32 0, i32 2)
%47 = call i32 @read(i32 %0, i8* %4, i32 272)
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%49 = icmp sgt i32 %47, 0
br i1 %49, label %50, label %60
50: ; preds = %45
%51 = zext i32 %47 to i64
br label %52
52: ; preds = %50, %52
%53 = phi i64 [ 0, %50 ], [ %58, %52 ]
%54 = getelementptr inbounds [272 x i8], [272 x i8]* %2, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = add nuw nsw i64 %53, 1
%59 = icmp eq i64 %58, %51
br i1 %59, label %60, label %52
60: ; preds = %52, %45
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%62 = tail call i32 @lseek(i32 %0, i32 0, i32 2)
%63 = call i32 @read(i32 %0, i8* %4, i32 272)
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%65 = icmp sgt i32 %63, 0
br i1 %65, label %66, label %76
66: ; preds = %60
%67 = zext i32 %63 to i64
br label %68
68: ; preds = %66, %68
%69 = phi i64 [ 0, %66 ], [ %74, %68 ]
%70 = getelementptr inbounds [272 x i8], [272 x i8]* %2, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %72)
%74 = add nuw nsw i64 %69, 1
%75 = icmp eq i64 %74, %67
br i1 %75, label %76, label %68
76: ; preds = %68, %60
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %63)
%78 = tail call i32 @lseek(i32 %0, i32 0, i32 2)
%79 = call i32 @read(i32 %0, i8* %4, i32 272)
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%81 = icmp sgt i32 %79, 0
br i1 %81, label %82, label %92
82: ; preds = %76
%83 = zext i32 %79 to i64
br label %84
84: ; preds = %82, %84
%85 = phi i64 [ 0, %82 ], [ %90, %84 ]
%86 = getelementptr inbounds [272 x i8], [272 x i8]* %2, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %88)
%90 = add nuw nsw i64 %85, 1
%91 = icmp eq i64 %90, %83
br i1 %91, label %92, label %84
92: ; preds = %84, %76
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %79)
ret void
}