#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 show_oemsdr(int vend, unsigned char *sdr) {
  int rv = -1;
  int i, len;
  if (rv != 0) {
    len = sdr[4] + 5;
    if (vend == 0x002880)
      printf("Fujitsu: ");
    else if (vend == 0x000157)
      printf("Intel: ");
    else
      printf("manuf=%d: ", vend);
    for (i = 8; i < len; i++)
      printf("%02x ", sdr[i]);
    printf("\n");
  }
  return (rv);
}


x86 assembly (clang, -O0):
<show_oemsdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11dd <show_oemsdr+0xcd>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x2880,-0x4(%rbp)
jne    115e <show_oemsdr+0x4e>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1194 <show_oemsdr+0x84>
cmpl   $0x157,-0x4(%rbp)
jne    117e <show_oemsdr+0x6e>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <show_oemsdr+0x7f>
mov    -0x4(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1194 <show_oemsdr+0x84>
movl   $0x8,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11cf <show_oemsdr+0xbf>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    119b <show_oemsdr+0x8b>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_oemsdr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
movzbl 0x4(%rsi),%r12d
cmp    $0x157,%edi
je     114b <show_oemsdr+0x2b>
mov    %edi,%esi
cmp    $0x2880,%edi
jne    1161 <show_oemsdr+0x41>
lea    0xeb7(%rip),%rdi
jmp    1152 <show_oemsdr+0x32>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%r12b
jae    1175 <show_oemsdr+0x55>
jmp    11a9 <show_oemsdr+0x89>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%r12b
jb     11a9 <show_oemsdr+0x89>
add    $0xfffffffffffffffd,%r12
lea    0xe9d(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x8(%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1190 <show_oemsdr+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Fujitsu: \00"
@.str.1 = [8 x i8] c"Intel: \00"
@.str.2 = [11 x i8] c"manuf=%d: \00"
@.str.3 = [6 x i8] c"%02x \00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @show_oemsdr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 -1, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %47
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = add nsw i32 %14, 5
store i32 %15, i32* %7
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 10368
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %29
20: ; preds = %10
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 343
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %28
25: ; preds = %20
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %23
br label %29
29: ; preds = %28, %18
store i32 8, i32* %6
br label %30
30: ; preds = %42, %29
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %45
34: ; preds = %30
%35 = load i8*, i8** %4
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %34
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %30
45: ; preds = %30
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %45, %2
%48 = load i32, i32* %5
ret i32 %48
}

LLVM IR (-O2):
@.str = [10 x i8] c"Fujitsu: \00"
@.str.1 = [8 x i8] c"Intel: \00"
@.str.2 = [11 x i8] c"manuf=%d: \00"
@.str.3 = [6 x i8] c"%02x \00"
define i32 @show_oemsdr(i32 %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 4
%4 = load i8, i8* %3
switch i32 %0, label %9 [
i32 10368, label %5
i32 343, label %7
]
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %11
11: ; preds = %7, %9, %5
%12 = icmp ugt i8 %4, 3
br i1 %12, label %13, label %24
13: ; preds = %11
%14 = zext i8 %4 to i64
%15 = add nuw nsw i64 %14, 4
br label %16
16: ; preds = %13, %16
%17 = phi i64 [ 8, %13 ], [ %22, %16 ]
%18 = getelementptr inbounds i8, i8* %1, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i64 %17, 1
%23 = icmp eq i64 %17, %15
br i1 %23, label %24, label %16
24: ; preds = %16, %11
%25 = tail call i32 @putchar(i32 10)
ret i32 -1
}