xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ uart1_clear_rts();
int /*<<< orphan*/ uart1_set_rts();
int uart1GetchBlockRTS(void) {
  uart1_set_rts();
  while (!((*((volatile unsigned char *)0xE0010014)) & (1 << 0)))
    ;
  uart1_clear_rts();
  return (*((volatile unsigned char *)0xE0010000));
}


x86 assembly (clang, -O0):
<uart1GetchBlockRTS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart1_set_rts@plt>
mov    $0xe0010014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114d <uart1GetchBlockRTS+0x2d>
jmp    1152 <uart1GetchBlockRTS+0x32>
jmp    112b <uart1GetchBlockRTS+0xb>
mov    $0x0,%al
call   1040 <uart1_clear_rts@plt>
mov    $0xe0010000,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1GetchBlockRTS>:
push   %rbx
mov    $0xe0010000,%ebx
xor    %eax,%eax
call   1030 <uart1_set_rts@plt>
nopl   (%rax)
testb  $0x1,0x14(%rbx)
je     1130 <uart1GetchBlockRTS+0x10>
xor    %eax,%eax
call   1040 <uart1_clear_rts@plt>
movzbl (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @uart1GetchBlockRTS() {
%1 = call i32 (...) @uart1_set_rts()
br label %2
2: ; preds = %8, %0
%3 = load volatile i8, i8* inttoptr (i64 3758161940 to i8*)
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %2
br label %2
9: ; preds = %2
%10 = call i32 (...) @uart1_clear_rts()
%11 = load volatile i8, i8* inttoptr (i64 3758161920 to i8*)
%12 = zext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @uart1GetchBlockRTS() {
%1 = tail call i32 (...) @uart1_set_rts()
br label %2
2: ; preds = %2, %0
%3 = load volatile i8, i8* inttoptr (i64 3758161940 to i8*)
%4 = and i8 %3, 1
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 (...) @uart1_clear_rts()
%8 = load volatile i8, i8* inttoptr (i64 3758161920 to i8*)
%9 = zext i8 %8 to i32
ret i32 %9
}
int absdiff(int x, int y) { return x > y ? x - y : y - x; }


x86 assembly (clang, -O0):
<absdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <absdiff+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <absdiff+0x2d>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absdiff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @absdiff(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i32 [ %11, %8 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @absdiff(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
int g_and(int a, int b) { return a && b; }


x86 assembly (clang, -O0):
<g_and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <g_and+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_and>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @g_and(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_and(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ddlltest() { printf("In libddlltest.so:ddlltest()\n"); }


x86 assembly (clang, -O0):
<ddlltest>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddlltest>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"In libddlltest.so:ddlltest()\0A\00"
define void @ddlltest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"In libddlltest.so:ddlltest()\00"
define void @ddlltest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pscnv_ib_chan {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OUT_RING(struct pscnv_ib_chan *, int);
void BEGIN_RING(struct pscnv_ib_chan *ch, int subc, int mthd, int len) {
  OUT_RING(ch, mthd | subc << 13 | len << 18);
}


x86 assembly (clang, -O0):
<BEGIN_RING>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
mov    -0x14(%rbp),%eax
shl    $0x12,%eax
or     %eax,%esi
call   1030 <OUT_RING@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_RING>:
shl    $0xd,%esi
or     %edx,%esi
shl    $0x12,%ecx
or     %ecx,%esi
jmp    1030 <OUT_RING@plt>

LLVM IR (-O0):
%struct.pscnv_ib_chan = type { i32 }
define void @BEGIN_RING(%struct.pscnv_ib_chan* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.pscnv_ib_chan*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.pscnv_ib_chan* %0, %struct.pscnv_ib_chan** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.pscnv_ib_chan*, %struct.pscnv_ib_chan** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = shl i32 %11, 13
%13 = or i32 %10, %12
%14 = load i32, i32* %8
%15 = shl i32 %14, 18
%16 = or i32 %13, %15
%17 = call i32 @OUT_RING(%struct.pscnv_ib_chan* %9, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.pscnv_ib_chan = type { i32 }
define void @BEGIN_RING(%struct.pscnv_ib_chan* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 13
%6 = or i32 %5, %2
%7 = shl i32 %3, 18
%8 = or i32 %6, %7
%9 = tail call i32 @OUT_RING(%struct.pscnv_ib_chan* %0, i32 %8)
ret void
}
int benchmark_initworker(void *tsd) { return (0); }


x86 assembly (clang, -O0):
<benchmark_initworker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_initworker>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @benchmark_initworker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @benchmark_initworker(i8* nocapture readnone %0) {
ret i32 0
}
int do_843() { return 843; }


x86 assembly (clang, -O0):
<do_843>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34b,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_843>:
mov    $0x34b,%eax
ret

LLVM IR (-O0):
define i32 @do_843() {
ret i32 843
}

LLVM IR (-O2):
define i32 @do_843() {
ret i32 843
}
unsigned int getTransferLength(const unsigned int opcode) {
  unsigned int nRc;
  switch (opcode & 0x00408000) {
  case 0x00000000:
    nRc = 1;
    break;
  case 0x00008000:
    nRc = 2;
    break;
  case 0x00400000:
    nRc = 3;
    break;
  default:
    nRc = 0;
  }
  return (nRc);
}


x86 assembly (clang, -O0):
<getTransferLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x408000,%eax
mov    %eax,-0xc(%rbp)
je     1143 <getTransferLength+0x43>
jmp    111d <getTransferLength+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x8000,%eax
je     114f <getTransferLength+0x4f>
jmp    1130 <getTransferLength+0x30>
mov    -0xc(%rbp),%eax
sub    $0x400000,%eax
je     115b <getTransferLength+0x5b>
jmp    1167 <getTransferLength+0x67>
movl   $0x1,-0x8(%rbp)
jmp    116e <getTransferLength+0x6e>
movl   $0x2,-0x8(%rbp)
jmp    116e <getTransferLength+0x6e>
movl   $0x3,-0x8(%rbp)
jmp    116e <getTransferLength+0x6e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTransferLength>:
and    $0x408000,%edi
je     111e <getTransferLength+0x1e>
cmp    $0x400000,%edi
je     1124 <getTransferLength+0x24>
cmp    $0x8000,%edi
jne    112a <getTransferLength+0x2a>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getTransferLength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 4227072
switch i32 %5, label %9 [
i32 0, label %6
i32 32768, label %7
i32 4194304, label %8
]
6: ; preds = %1
store i32 1, i32* %3
br label %10
7: ; preds = %1
store i32 2, i32* %3
br label %10
8: ; preds = %1
store i32 3, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @getTransferLength(i32 %0) {
%2 = and i32 %0, 4227072
switch i32 %2, label %5 [
i32 0, label %6
i32 32768, label %3
i32 4194304, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %7
}
int fontGetCharHits(char *s, char f) {
  int hits = 0;
  while (*s) {
    if (*s == f)
      hits++;
    *s++;
  }
  return hits;
}


x86 assembly (clang, -O0):
<fontGetCharHits>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <fontGetCharHits+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <fontGetCharHits+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <fontGetCharHits+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fontGetCharHits>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <fontGetCharHits+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fontGetCharHits+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fontGetCharHits(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %20
20: ; preds = %17, %10
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8, i8* %21
br label %6
24: ; preds = %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @fontGetCharHits(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
long kbd_bit_in() {
  volatile unsigned long *kbdgpio = (unsigned long *)0xd4019008;
  unsigned long regval;
  unsigned long bitval;
  do {
    regval = *kbdgpio;
  } while ((regval & 0x80) != 0);
  bitval = (regval & 0x100) ? 0x100 : 0;
  do {
    regval = *kbdgpio;
  } while ((regval & 0x80) == 0);
  return bitval;
}


x86 assembly (clang, -O0):
<kbd_bit_in>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd4019008,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x80,%rax
cmp    $0x0,%rax
jne    110d <kbd_bit_in+0xd>
mov    -0x10(%rbp),%rdx
and    $0x100,%rdx
xor    %eax,%eax
mov    $0x100,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x80,%rax
cmp    $0x0,%rax
je     114b <kbd_bit_in+0x4b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbd_bit_in>:
mov    $0xd4019008,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rcx),%rax
test   $0x80,%al
jne    1110 <kbd_bit_in+0x10>
nopw   0x0(%rax,%rax,1)
testq  $0x80,(%rcx)
je     1120 <kbd_bit_in+0x20>
and    $0x100,%eax
ret

LLVM IR (-O0):
define i64 @kbd_bit_in() {
%1 = alloca i64*
%2 = alloca i64
%3 = alloca i64
store i64* inttoptr (i64 3556872200 to i64*), i64** %1
br label %4
4: ; preds = %7, %0
%5 = load i64*, i64** %1
%6 = load volatile i64, i64* %5
store i64 %6, i64* %2
br label %7
7: ; preds = %4
%8 = load i64, i64* %2
%9 = and i64 %8, 128
%10 = icmp ne i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load i64, i64* %2
%13 = and i64 %12, 256
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 256, i32 0
%17 = sext i32 %16 to i64
store i64 %17, i64* %3
br label %18
18: ; preds = %21, %11
%19 = load i64*, i64** %1
%20 = load volatile i64, i64* %19
store i64 %20, i64* %2
br label %21
21: ; preds = %18
%22 = load i64, i64* %2
%23 = and i64 %22, 128
%24 = icmp eq i64 %23, 0
br i1 %24, label %18, label %25
25: ; preds = %21
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @kbd_bit_in() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3556872200 to i64*)
%3 = and i64 %2, 128
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1, %5
%6 = load volatile i64, i64* inttoptr (i64 3556872200 to i64*)
%7 = and i64 %6, 128
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = and i64 %2, 256
ret i64 %10
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isUniqueTarget(const char *name) { return name && strcmp(name, "-"); }


x86 assembly (clang, -O0):
<isUniqueTarget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1146 <isUniqueTarget+0x36>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUniqueTarget>:
test   %rdi,%rdi
je     1132 <isUniqueTarget+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
define i32 @isUniqueTarget(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define i32 @isUniqueTarget(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "echo"
        " [string...]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: echo [string...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: echo [string...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
int verify_char(char c1, char c2) {
  if (c1 == c2) {
    write(1, "Error: Unexpected character", 27 * sizeof(char));
    exit(3);
  }
  return 1;
}


x86 assembly (clang, -O0):
<verify_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    1164 <verify_char+0x44>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
mov    $0x1b,%edx
call   1030 <write@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_char>:
cmp    %sil,%dil
je     112b <verify_char+0xb>
mov    $0x1,%eax
ret
push   %rax
lea    0xecd(%rip),%rsi
mov    $0x1,%edi
mov    $0x1b,%edx
call   1030 <write@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error: Unexpected character\00"
define i32 @verify_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @write(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 27)
%12 = call i32 @exit(i32 3)
unreachable
13: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error: Unexpected character\00"
define i32 @verify_char(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 27)
%6 = tail call i32 @exit(i32 3)
unreachable
7: ; preds = %2
ret i32 1
}
/* Type definitions */
typedef union fc_sockaddr {
  int dummy;
} fc_sockaddr;
struct genlist_link {
  int dummy;
};
struct genlist {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert_after(struct genlist *, union fc_sockaddr *,
                                        struct genlist_link *);
void fc_sockaddr_list_insert_after(struct fc_sockaddr_list *tthis,
                                   union fc_sockaddr *pfoo,
                                   struct fc_sockaddr_list_link *plink) {
  genlist_insert_after((struct genlist *)tthis, pfoo,
                       (struct genlist_link *)plink);
}


x86 assembly (clang, -O0):
<fc_sockaddr_list_insert_after>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <genlist_insert_after@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc_sockaddr_list_insert_after>:
jmp    1030 <genlist_insert_after@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @fc_sockaddr_list_insert_after(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1, %struct.fc_sockaddr_list_link* %2) {
%4 = alloca %struct.fc_sockaddr_list*
%5 = alloca %union.fc_sockaddr*
%6 = alloca %struct.fc_sockaddr_list_link*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %4
store %union.fc_sockaddr* %1, %union.fc_sockaddr** %5
store %struct.fc_sockaddr_list_link* %2, %struct.fc_sockaddr_list_link** %6
%7 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %4
%8 = bitcast %struct.fc_sockaddr_list* %7 to %struct.genlist*
%9 = load %union.fc_sockaddr*, %union.fc_sockaddr** %5
%10 = load %struct.fc_sockaddr_list_link*, %struct.fc_sockaddr_list_link** %6
%11 = bitcast %struct.fc_sockaddr_list_link* %10 to %struct.genlist_link*
%12 = call i32 @genlist_insert_after(%struct.genlist* %8, %union.fc_sockaddr* %9, %struct.genlist_link* %11)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @fc_sockaddr_list_insert_after(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1, %struct.fc_sockaddr_list_link* %2) {
%4 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%5 = bitcast %struct.fc_sockaddr_list_link* %2 to %struct.genlist_link*
%6 = tail call i32 @genlist_insert_after(%struct.genlist* %4, %union.fc_sockaddr* %1, %struct.genlist_link* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ powerset(char *);
int main(int argc, char **argv) {
  powerset("abracadabra");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <powerset@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <powerset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"abracadabra\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @powerset(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"abracadabra\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @powerset(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int divisors(int);
void gen_divisors(int *result, const int start, const int end) {
  for (int i = start; i < end; i++) {
    result[i] = divisors(i);
  }
}


x86 assembly (clang, -O0):
<gen_divisors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1157 <gen_divisors+0x47>
mov    -0x14(%rbp),%edi
call   1030 <divisors@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <gen_divisors+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_divisors>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1145 <gen_divisors+0x35>
mov    %edx,%r14d
mov    %esi,%ebp
movslq %esi,%rax
lea    (%rdi,%rax,4),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <divisors@plt>
mov    %eax,(%rbx)
add    $0x4,%rbx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <gen_divisors+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @gen_divisors(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %7
%15 = call i32 @divisors(i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @gen_divisors(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %13, %8 ]
%10 = trunc i64 %9 to i32
%11 = tail call i32 @divisors(i32 %10)
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nsw i64 %9, 1
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, %2
br i1 %15, label %7, label %8
}
/* Variables and functions */
int get_data_int();
int /*<<< orphan*/ send_int_to_srv(int);
int get_channels() {
  send_int_to_srv(0x18);
  return get_data_int();
}


x86 assembly (clang, -O0):
<get_channels>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1040 <get_data_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_channels>:
push   %rax
mov    $0x18,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_data_int@plt>

LLVM IR (-O0):
define i32 @get_channels() {
%1 = call i32 @send_int_to_srv(i32 24)
%2 = call i32 (...) @get_data_int()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_channels() {
%1 = tail call i32 @send_int_to_srv(i32 24)
%2 = tail call i32 (...) @get_data_int()
ret i32 %2
}
/* Variables and functions */
scalar_t__ chars_is_alpha(char);
scalar_t__ chars_is_digit(char);
bool chars_is_alpha_or_digit(char c) {
  return chars_is_alpha(c) || chars_is_digit(c);
}


x86 assembly (clang, -O0):
<chars_is_alpha_or_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <chars_is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <chars_is_alpha_or_digit+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <chars_is_digit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_alpha_or_digit>:
push   %rbx
mov    %edi,%ebx
call   1040 <chars_is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <chars_is_alpha_or_digit+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <chars_is_digit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chars_is_alpha_or_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @chars_is_alpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @chars_is_digit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @chars_is_alpha_or_digit(i8 signext %0) {
%2 = tail call i64 @chars_is_alpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @chars_is_digit(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
float powf(float, float);
int32_t power_meter_level_dbov(float level) {
  float l;
  if (level > 0.0)
    level = 0.0;
  l = powf(10.0f, level / 10.0f) * (32767.0f * 32767.0f);
  return (int32_t)l;
}


x86 assembly (clang, -O0):
<power_meter_level_dbov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    113b <power_meter_level_dbov+0x2b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xebc(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xeb0(%rip),%xmm0
call   1030 <powf@plt>
movss  0xe9f(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_meter_level_dbov>:
push   %rax
xorps  %xmm1,%xmm1
minss  %xmm0,%xmm1
movss  0xee0(%rip),%xmm0
divss  %xmm0,%xmm1
call   1030 <powf@plt>
mulss  0xed3(%rip),%xmm0
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @power_meter_level_dbov(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %8
8: ; preds = %7, %1
%9 = load float, float* %2
%10 = fdiv float %9, 1.000000e+01
%11 = call float @powf(float 1.000000e+01, float %10)
%12 = fmul float %11, 0x41CFFF8000000000
store float %12, float* %3
%13 = load float, float* %3
%14 = fptosi float %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @power_meter_level_dbov(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = select i1 %2, float 0.000000e+00, float %0
%4 = fdiv float %3, 1.000000e+01
%5 = tail call float @powf(float 1.000000e+01, float %4)
%6 = fmul float %5, 0x41CFFF8000000000
%7 = fptosi float %6 to i32
ret i32 %7
}
/* Variables and functions */
int b();
int c();
int d(void) { return b() + c(); }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <b@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <c@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
push   %rbx
xor    %eax,%eax
call   1030 <b@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <c@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @d() {
%1 = call i32 (...) @b()
%2 = call i32 (...) @c()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @d() {
%1 = tail call i32 (...) @b()
%2 = tail call i32 (...) @c()
%3 = add nsw i32 %2, %1
ret i32 %3
}
int isprint(int c) { return c >= 32 && c < 127; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AbortDDC();
int /*<<< orphan*/ HDCP_ClearAuthInterrupt();
int /*<<< orphan*/ HDMITX_WriteI2C_Byte(int, int);
void HDCP_CancelRepeaterAuthenticate(void) {
  ;
  HDMITX_WriteI2C_Byte(0x10, (0 << 1) | (1 << 0));
  AbortDDC();
  HDMITX_WriteI2C_Byte(0x22, (1 << 1) | (1 << 0));
  HDCP_ClearAuthInterrupt();
}


x86 assembly (clang, -O0):
<HDCP_CancelRepeaterAuthenticate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x0,%al
call   1050 <AbortDDC@plt>
mov    $0x22,%edi
mov    $0x3,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x0,%al
call   1040 <HDCP_ClearAuthInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDCP_CancelRepeaterAuthenticate>:
push   %rax
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
xor    %eax,%eax
call   1050 <AbortDDC@plt>
mov    $0x22,%edi
mov    $0x3,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <HDCP_ClearAuthInterrupt@plt>

LLVM IR (-O0):
define void @HDCP_CancelRepeaterAuthenticate() {
%1 = call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 1)
%2 = call i32 (...) @AbortDDC()
%3 = call i32 @HDMITX_WriteI2C_Byte(i32 34, i32 3)
%4 = call i32 (...) @HDCP_ClearAuthInterrupt()
ret void
}

LLVM IR (-O2):
define void @HDCP_CancelRepeaterAuthenticate() {
%1 = tail call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 1)
%2 = tail call i32 (...) @AbortDDC()
%3 = tail call i32 @HDMITX_WriteI2C_Byte(i32 34, i32 3)
%4 = tail call i32 (...) @HDCP_ClearAuthInterrupt()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
scalar_t__ fstat(int, struct stat *);
int write(int, char *, int);
void get_mtime(int fd, struct stat *st, int do_write) {
  if (do_write)
    ASSERT(write(fd, "\n", 1) == 1);
  ASSERT(fstat(fd, st) == 0);
}


x86 assembly (clang, -O0):
<get_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1170 <get_mtime+0x40>
mov    -0x4(%rbp),%edi
lea    0xeaa(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <fstat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mtime>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %edx,%edx
je     115d <get_mtime+0x2d>
lea    0xebd(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <ASSERT@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <fstat@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ASSERT@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @get_mtime(i32 %0, %struct.stat* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.stat*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
br label %15
15: ; preds = %9, %3
%16 = load i32, i32* %4
%17 = load %struct.stat*, %struct.stat** %5
%18 = call i64 @fstat(i32 %16, %struct.stat* %17)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @ASSERT(i32 %20)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @get_mtime(i32 %0, %struct.stat* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
br label %10
10: ; preds = %5, %3
%11 = tail call i64 @fstat(i32 %0, %struct.stat* %1)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
%14 = tail call i32 @ASSERT(i32 %13)
ret void
}
/* Variables and functions */
char *_xtoa(unsigned long, char *, int, int);
char *stdimpl_itoa(int v, char *string, int r) {
  if ((r == 10) && (v < 0)) {
    return _xtoa((unsigned long)(-v), string, r, 1);
  }
  return _xtoa((unsigned long)(v), string, r, 0);
}


x86 assembly (clang, -O0):
<stdimpl_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jne    1158 <stdimpl_itoa+0x48>
cmpl   $0x0,-0xc(%rbp)
jge    1158 <stdimpl_itoa+0x48>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
movslq %eax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x1,%ecx
call   1030 <_xtoa@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <stdimpl_itoa+0x5e>
movslq -0xc(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
xor    %ecx,%ecx
call   1030 <_xtoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_itoa>:
test   %edi,%edi
jns    112a <stdimpl_itoa+0x1a>
cmp    $0xa,%edx
jne    112a <stdimpl_itoa+0x1a>
neg    %edi
mov    $0xa,%edx
mov    $0x1,%ecx
jmp    1030 <_xtoa@plt>
movslq %edi,%rdi
xor    %ecx,%ecx
jmp    1030 <_xtoa@plt>

LLVM IR (-O0):
define i8* @stdimpl_itoa(i32 %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %5
%15 = sub nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = call i8* @_xtoa(i64 %16, i8* %17, i32 %18, i32 1)
store i8* %19, i8** %4
br label %26
20: ; preds = %10, %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = load i8*, i8** %6
%24 = load i32, i32* %7
%25 = call i8* @_xtoa(i64 %22, i8* %23, i32 %24, i32 0)
store i8* %25, i8** %4
br label %26
26: ; preds = %20, %13
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
define i8* @stdimpl_itoa(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 10
%5 = icmp slt i32 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = sub nsw i32 0, %0
%9 = zext i32 %8 to i64
%10 = tail call i8* @_xtoa(i64 %9, i8* %1, i32 10, i32 1)
br label %14
11: ; preds = %3
%12 = sext i32 %0 to i64
%13 = tail call i8* @_xtoa(i64 %12, i8* %1, i32 %2, i32 0)
br label %14
14: ; preds = %11, %7
%15 = phi i8* [ %10, %7 ], [ %13, %11 ]
ret i8* %15
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int c) { return (isalpha(c) || isdigit(c)); }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void nrerror(char error_text[]) {
  fprintf(stderr, "Numerical Recipes run-time error...\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "...now exiting to system...\n");
  exit(13);
}


x86 assembly (clang, -O0):
<nrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xd,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nrerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedc(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xd,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 13)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 13)
unreachable
}
/* Variables and functions */
scalar_t__ i_crdy(int, int);
int comm_rec(int no, unsigned long *imessage, int tries) {
  if (i_crdy(no, tries)) {
    *imessage = *((unsigned long *)0x100041 + (no * 0x10));
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<comm_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <i_crdy@plt>
cmp    $0x0,%rax
je     115c <comm_rec+0x4c>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
movslq %eax,%rcx
mov    $0x100041,%eax
mov    (%rax,%rcx,8),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1163 <comm_rec+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comm_rec>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %edx,%esi
call   1030 <i_crdy@plt>
test   %rax,%rax
je     113c <comm_rec+0x2c>
shl    $0x4,%ebp
movslq %ebp,%rax
mov    0x100041(,%rax,8),%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
jmp    113e <comm_rec+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @comm_rec(i32 %0, i64* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i32
store i32 %0, i32* %5
store i64* %1, i64** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %7
%10 = call i64 @i_crdy(i32 %8, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %3
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 16
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* inttoptr (i64 1048641 to i64*), i64 %15
%17 = load i64, i64* %16
%18 = load i64*, i64** %6
store i64 %17, i64* %18
store i32 1, i32* %4
br label %20
19: ; preds = %3
store i32 0, i32* %4
br label %20
20: ; preds = %19, %12
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @comm_rec(i32 %0, i64* nocapture writeonly %1, i32 %2) {
%4 = tail call i64 @i_crdy(i32 %0, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = shl nsw i32 %0, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* inttoptr (i64 1048641 to i64*), i64 %8
%10 = load i64, i64* %9
store i64 %10, i64* %1
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Object_copy(void *this, void *other) { printf("Object::copy()\n"); }


x86 assembly (clang, -O0):
<Object_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Object_copy>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Object::copy()\0A\00"
define void @Object_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Object::copy()\00"
define void @Object_copy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void elsa_cs_detach(struct pcmcia_device *link) {}


x86 assembly (clang, -O0):
<elsa_cs_detach>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<elsa_cs_detach>:
ret

LLVM IR (-O0):
%struct.pcmcia_device = type opaque
define void @elsa_cs_detach(%struct.pcmcia_device* %0) {
%2 = alloca %struct.pcmcia_device*
store %struct.pcmcia_device* %0, %struct.pcmcia_device** %2
ret void
}

LLVM IR (-O2):
%struct.pcmcia_device = type opaque
define void @elsa_cs_detach(%struct.pcmcia_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
main(int argc, char *argv[]) {
  printf("%s:  cannot be run on this host machine type.\n", argv[0]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"%s: cannot be run on this host machine type.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [47 x i8] c"%s: cannot be run on this host machine type.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}