#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 */
struct jedec {
  int dummy;
};

/* Variables and functions */
int jedec_bit_get(struct jedec *, int);
int /*<<< orphan*/ printf(char *, ...);
void dump_row_n(struct jedec *jed, int row) {
  int i;
  printf("%2d: ", row);
  for (i = 0; i < 132; i++) {
    int v, fuse;
    fuse = (5764 + row) - 44 * i;
    v = jedec_bit_get(jed, fuse);
    printf("%c", '0' + v);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_row_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x84,-0x10(%rbp)
jge    1196 <dump_row_n+0x76>
mov    -0xc(%rbp),%eax
add    $0x1684,%eax
imul   $0x2c,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <jedec_bit_get@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
add    $0x30,%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <dump_row_n+0x27>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_row_n>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1684,%ebx
xchg   %ax,%ax
lea    (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1050 <jedec_bit_get@plt>
lea    0x30(%rax),%edi
call   1030 <putchar@plt>
add    $0xffffffd4,%ebx
cmp    $0xffffffd4,%ebx
jne    1150 <dump_row_n+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.jedec = type { i32 }
@.str = [6 x i8] c"%2d: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dump_row_n(%struct.jedec* %0, i32 %1) {
%3 = alloca %struct.jedec*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.jedec* %0, %struct.jedec** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 0, i32* %5
br label %10
10: ; preds = %25, %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 132
br i1 %12, label %13, label %28
13: ; preds = %10
%14 = load i32, i32* %4
%15 = add nsw i32 5764, %14
%16 = load i32, i32* %5
%17 = mul nsw i32 44, %16
%18 = sub nsw i32 %15, %17
store i32 %18, i32* %7
%19 = load %struct.jedec*, %struct.jedec** %3
%20 = load i32, i32* %7
%21 = call i32 @jedec_bit_get(%struct.jedec* %19, i32 %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = add nsw i32 48, %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %13
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %10
28: ; preds = %10
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.jedec = type { i32 }
@.str = [6 x i8] c"%2d: \00"
define void @dump_row_n(%struct.jedec* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = add nsw i32 %1, 5764
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %12, %5 ]
%7 = mul nsw i32 %6, -44
%8 = add nsw i32 %4, %7
%9 = tail call i32 @jedec_bit_get(%struct.jedec* %0, i32 %8)
%10 = add nsw i32 %9, 48
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, 132
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = tail call i32 @putchar(i32 10)
ret void
}