xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mpga_get_id(const uint8_t *p_mpga) { return !!(p_mpga[1] & 0x08); }


x86 assembly (clang, -O0):
<mpga_get_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_id>:
mov    0x4(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mpga_get_id(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mpga_get_id(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ USART_Transmit(unsigned char);
void TWI_Error(unsigned char data) {
  USART_Transmit('E');
  USART_Transmit(data);
}


x86 assembly (clang, -O0):
<TWI_Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x45,%edi
call   1030 <USART_Transmit@plt>
movzbl -0x1(%rbp),%edi
call   1030 <USART_Transmit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TWI_Error>:
push   %rbx
mov    %edi,%ebx
mov    $0x45,%edi
call   1030 <USART_Transmit@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <USART_Transmit@plt>

LLVM IR (-O0):
define void @TWI_Error(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @USART_Transmit(i8 zeroext 69)
%4 = load i8, i8* %2
%5 = call i32 @USART_Transmit(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @TWI_Error(i8 zeroext %0) {
%2 = tail call i32 @USART_Transmit(i8 zeroext 69)
%3 = tail call i32 @USART_Transmit(i8 zeroext %0)
ret void
}
void canonicalizePath(char *const path __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @canonicalizePath(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Crypt();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char entry;
  do {
    scanf("%c", &entry);
    if (entry == 'c' || entry == 'd') {
      Crypt();
    }
  } while (entry != 'q');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
je     1159 <main+0x39>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    1160 <main+0x40>
mov    $0x0,%al
call   1040 <Crypt@plt>
jmp    1165 <main+0x45>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x7(%rsp),%rbx
jmp    1144 <main+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x71,%al
je     116a <main+0x4a>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
movzbl 0x7(%rsp),%eax
lea    -0x63(%rax),%ecx
cmp    $0x1,%cl
ja     1140 <main+0x20>
xor    %eax,%eax
call   1040 <Crypt@plt>
movzbl 0x7(%rsp),%eax
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 99
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 100
br i1 %11, label %12, label %14
12: ; preds = %8, %3
%13 = call i32 (...) @Crypt()
br label %14
14: ; preds = %12, %8
br label %15
15: ; preds = %14
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 113
br i1 %18, label %3, label %19
19: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %10, %0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -99
%6 = icmp ult i8 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 (...) @Crypt()
%9 = load i8, i8* %1
br label %10
10: ; preds = %7, %2
%11 = phi i8 [ %9, %7 ], [ %4, %2 ]
%12 = icmp eq i8 %11, 113
br i1 %12, label %13, label %2
13: ; preds = %10
ret i32 0
}
int high(int i) { return ((i / 2 == (float)i / 2) ? 1 : -1); }


x86 assembly (clang, -O0):
<high>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
movss  0xedd(%rip),%xmm2
divss  %xmm2,%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<high>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
cvtsi2ss %eax,%xmm0
cvtsi2ss %edi,%xmm1
mulss  0xee7(%rip),%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @high(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = sitofp i32 %4 to float
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
%8 = fdiv float %7, 2.000000e+00
%9 = fcmp oeq float %5, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @high(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = sitofp i32 %2 to float
%4 = sitofp i32 %0 to float
%5 = fmul float %4, 5.000000e-01
%6 = fcmp oeq float %5, %3
%7 = select i1 %6, i32 1, i32 -1
ret i32 %7
}
void strcpy_2(char *s, char *t) {
  int i = 0;
  while ((*s = *t) != '\0') {
    s++;
    t++;
  }
}


x86 assembly (clang, -O0):
<strcpy_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <strcpy_2+0x48>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <strcpy_2+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_2>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     111f <strcpy_2+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy_2+0x10>
ret

LLVM IR (-O0):
define void @strcpy_2(i8* %0, i8* %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 = %12, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = sext i8 %8 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @strcpy_2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
bool nrf52_errata_242(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_242() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_242() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void status_message(char *str) { printf("[ %s ]\n", str); }


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

x86 assembly (clang, -O2):
<status_message>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"[ %s ]\0A\00"
define void @status_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"[ %s ]\0A\00"
define void @status_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_4Fuint8_reg(unsigned char val) {
  return ((val) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x4f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fuint8_reg>:
test   $0x4f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 79
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_4Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 79
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_WORM(struct list_head *);
uint8_t set_t10k_WORM(struct list_head *m) {
  ;
  return set_WORM(m);
}


x86 assembly (clang, -O0):
<set_t10k_WORM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <set_WORM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_t10k_WORM>:
jmp    1030 <set_WORM@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define i32 @set_t10k_WORM(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @set_WORM(%struct.list_head* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_t10k_WORM(%struct.list_head* %0) {
%2 = tail call i32 @set_WORM(%struct.list_head* %0)
ret i32 %2
}
/* Variables and functions */
int getidx();
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int array[5];
  int idx = getidx();
  int *p = array;
  p += idx;
  ++p;
  *p = 7;
  test_assert(array[3] == 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getidx@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movl   $0x7,(%rax)
cmpl   $0x7,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <getidx@plt>
cltq
movl   $0x7,0x4(%rsp,%rax,4)
xor    %edi,%edi
cmpl   $0x7,0xc(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32 (...) @getidx()
store i32 %5, i32* %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %4
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %4
%13 = load i32*, i32** %4
store i32 7, i32* %13
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 7
%17 = zext i1 %16 to i32
%18 = call i32 @test_assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 (...) @getidx()
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 7, i32* %6
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 7
%10 = zext i1 %9 to i32
%11 = tail call i32 @test_assert(i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HwRevoMiniHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwRevoMiniUpdated() { UAVObjUpdated(HwRevoMiniHandle()); }


x86 assembly (clang, -O0):
<HwRevoMiniUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwRevoMiniHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwRevoMiniUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <HwRevoMiniHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @HwRevoMiniUpdated() {
%1 = call i32 (...) @HwRevoMiniHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwRevoMiniUpdated() {
%1 = tail call i32 (...) @HwRevoMiniHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ __LDREXH(scalar_t__ volatile *);
scalar_t__ __STREXH(scalar_t__, scalar_t__ volatile *);
uint16_t atomic_incr_u16(uint16_t *valuePtr, uint16_t delta) {
  uint16_t newValue;
  do {
    newValue = __LDREXH((volatile uint16_t *)valuePtr) + delta;
  } while (__STREXH(newValue, (volatile uint16_t *)valuePtr));
  return newValue;
}


x86 assembly (clang, -O0):
<atomic_incr_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__LDREXH@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <__STREXH@plt>
cmp    $0x0,%rax
jne    1130 <atomic_incr_u16+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_incr_u16>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <__LDREXH@plt>
mov    %rax,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <__STREXH@plt>
test   %rax,%rax
jne    1130 <atomic_incr_u16+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @atomic_incr_u16(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
br label %6
6: ; preds = %11, %2
%7 = load i64*, i64** %3
%8 = call i64 @__LDREXH(i64* %7)
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
store i64 %10, i64* %5
br label %11
11: ; preds = %6
%12 = load i64, i64* %5
%13 = load i64*, i64** %3
%14 = call i64 @__STREXH(i64 %12, i64* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %6, label %16
16: ; preds = %11
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @atomic_incr_u16(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @__LDREXH(i64* %0)
%5 = add nsw i64 %4, %1
%6 = tail call i64 @__STREXH(i64 %5, i64* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void indent(int i) {
  int j;
  for (j = 0; j < i; j++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <indent+0x36>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbx
test   %edi,%edi
jle    112f <indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <indent+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @indent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @putchar(i8 signext 32)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8 signext 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void header() { emitln("HEADER"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"HEADER\00"
define void @header() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"HEADER\00"
define void @header() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *GetMemory(char *p) {
  p = (char *)malloc(100);
  return p;
}


x86 assembly (clang, -O0):
<GetMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMemory>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @GetMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @GetMemory(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void ironlake_debug_n(char *result, int len, int reg, uint32_t val,
                      uint32_t devid) {
  snprintf(result, len, "val 0x%x %d", val & 0xffffff, val & 0xffffff);
}


x86 assembly (clang, -O0):
<ironlake_debug_n>:
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    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
and    $0xffffff,%ecx
mov    -0x14(%rbp),%r8d
and    $0xffffff,%r8d
lea    0xeb5(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ironlake_debug_n>:
and    $0xffffff,%ecx
lea    0xee3(%rip),%rdx
mov    %ecx,%r8d
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"val 0x%x %d\00"
define void @ironlake_debug_n(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = and i32 %13, 16777215
%15 = load i32, i32* %9
%16 = and i32 %15, 16777215
%17 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"val 0x%x %d\00"
define void @ironlake_debug_n(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %3, 16777215
%7 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6)
ret void
}
/* Variables and functions */
float acosf(float);
float _acos(float n) { return acosf(n); }


x86 assembly (clang, -O0):
<_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_acos>:
jmp    1030 <acosf@plt>

LLVM IR (-O0):
define float @_acos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @acosf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @_acos(float %0) {
%2 = tail call float @acosf(float %0)
ret float %2
}
/* Variables and functions */
char *strchr(char *, char);
int hexval(char ch) {
  static char hex[] = "0123456789ABCDEFabcdef";
  char *p;
  int val = 0;
  p = strchr(hex, ch);
  val = p - hex;
  val = (val > 15) ? val - 6 : val;
  return val;
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0x2f04(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0x2eec(%rip),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jle    1162 <hexval+0x52>
mov    -0x14(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <hexval+0x58>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
push   %rbx
mov    %edi,%esi
lea    0x2f16(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strchr@plt>
sub    %ebx,%eax
lea    -0x6(%rax),%ecx
cmp    $0x10,%eax
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@hexval.hex = internal global [23 x i8] c"0123456789ABCDEFabcdef\00"
define i32 @hexval(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %4
%5 = load i8, i8* %2
%6 = call i8* @strchr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @hexval.hex, i64 0, i64 0), i8 signext %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = sub i64 %8, ptrtoint ([23 x i8]* @hexval.hex to i64)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 15
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 6
br label %18
16: ; preds = %1
%17 = load i32, i32* %4
br label %18
18: ; preds = %16, %13
%19 = phi i32 [ %15, %13 ], [ %17, %16 ]
store i32 %19, i32* %4
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@hexval.hex = internal global [23 x i8] c"0123456789ABCDEFabcdef\00"
define i32 @hexval(i8 signext %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @hexval.hex, i64 0, i64 0), i8 signext %0)
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = sub i32 %4, ptrtoint ([23 x i8]* @hexval.hex to i32)
%6 = icmp sgt i32 %5, 15
%7 = add nsw i32 %5, -6
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_help() {
  printf("[CPUFace] This is a Helper for CPUFace\n");
  printf("[CPUFace] Try 'cpuface --help' instead\n");
  return 2;
}


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

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"[CPUFace] This is a Helper for CPUFace\0A\00"
@.str.1 = [40 x i8] c"[CPUFace] Try 'cpuface --help' instead\0A\00"
define i32 @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [39 x i8] c"[CPUFace] This is a Helper for CPUFace\00"
@str.2 = [39 x i8] c"[CPUFace] Try 'cpuface --help' instead\00"
define i32 @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret i32 2
}
int char2int(char cc) {
  int x;
  x = (int)(cc - '0');
  return x;
}


x86 assembly (clang, -O0):
<char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @char2int(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @char2int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset();
void rsp_restart() { cpu_reset(); }


x86 assembly (clang, -O0):
<rsp_restart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cpu_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsp_restart>:
xor    %eax,%eax
jmp    1030 <cpu_reset@plt>

LLVM IR (-O0):
define void @rsp_restart() {
%1 = call i32 (...) @cpu_reset()
ret void
}

LLVM IR (-O2):
define void @rsp_restart() {
%1 = tail call i32 (...) @cpu_reset()
ret void
}
/* Variables and functions */
int LOG_wrk(char *);
int statf_null() { return LOG_wrk("statf_null called!"), 0; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"statf_null called!\00"
define i32 @statf_null() {
%1 = call i32 @LOG_wrk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"statf_null called!\00"
define i32 @statf_null() {
%1 = tail call i32 @LOG_wrk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float __nanf();
float nanf(char const *tagp) { return __nanf(); }


x86 assembly (clang, -O0):
<nanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__nanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanf>:
xor    %eax,%eax
jmp    1030 <__nanf@plt>

LLVM IR (-O0):
define float @nanf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call float (...) @__nanf()
ret float %3
}

LLVM IR (-O2):
define float @nanf(i8* nocapture readnone %0) {
%2 = tail call float (...) @__nanf()
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xbf() {
  Assert_real((ispunct(191) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              960, ("ispunct should be 0 for 0xbf"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xbf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3c0,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xbf>:
push   %rax
mov    $0xbf,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3c0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xbf\00"
define void @t_ispunct_0xbf() {
%1 = call i64 @ispunct(i32 191)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xbf\00"
define void @t_ispunct_0xbf() {
%1 = tail call i64 @ispunct(i32 191)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int true_uint(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @true_uint() {
ret i32 1
}

LLVM IR (-O2):
define i32 @true_uint() {
ret i32 1
}
int vmddlclose(void *h) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vmddlclose(i8* nocapture readnone %0) {
ret i32 0
}
int test_imm_36uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x36,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_36uint64_midword_reg>:
test   $0x360000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_36uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 54
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_36uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3538944
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_prefetch(int /*<<< orphan*/, int, int);
void test4() {
  __builtin_arm_prefetch(0, 2, 0);
  __builtin_arm_prefetch(0, 0, 2);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1030 <__builtin_arm_prefetch@plt>
xor    %esi,%esi
mov    $0x2,%edx
mov    %esi,%edi
call   1030 <__builtin_arm_prefetch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <__builtin_arm_prefetch@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2,%edx
pop    %rax
jmp    1030 <__builtin_arm_prefetch@plt>

LLVM IR (-O0):
define void @test4() {
%1 = call i32 @__builtin_arm_prefetch(i32 0, i32 2, i32 0)
%2 = call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 2)
ret void
}

LLVM IR (-O2):
define void @test4() {
%1 = tail call i32 @__builtin_arm_prefetch(i32 0, i32 2, i32 0)
%2 = tail call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 2)
ret void
}
long lseek(int fileno, long offset, int base) { return -1L; }


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @lseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i64 -1
}

LLVM IR (-O2):
define i64 @lseek(i32 %0, i64 %1, i32 %2) {
ret i64 -1
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
int is_palindrome_aux(struct list_node *, struct list_node *,
                      struct list_node **);
int is_palindrome(struct list_node *head) {
  struct list_node *out;
  return is_palindrome_aux(head, head, &out);
}


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

x86 assembly (clang, -O2):
<is_palindrome>:
push   %rax
mov    %rsp,%rdx
mov    %rdi,%rsi
call   1030 <is_palindrome_aux@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.list_node = type { i32 }
define i32 @is_palindrome(%struct.list_node* %0) {
%2 = alloca %struct.list_node*
%3 = alloca %struct.list_node*
store %struct.list_node* %0, %struct.list_node** %2
%4 = load %struct.list_node*, %struct.list_node** %2
%5 = load %struct.list_node*, %struct.list_node** %2
%6 = call i32 @is_palindrome_aux(%struct.list_node* %4, %struct.list_node* %5, %struct.list_node** %3)
ret i32 %6
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
define i32 @is_palindrome(%struct.list_node* %0) {
%2 = alloca %struct.list_node*
%3 = bitcast %struct.list_node** %2 to i8*
%4 = call i32 @is_palindrome_aux(%struct.list_node* %0, %struct.list_node* %0, %struct.list_node** %2)
ret i32 %4
}
long long movdi(int a) { return 0xF0F0; }


x86 assembly (clang, -O0):
<movdi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xf0f0,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @movdi(i32 %0) {
ret i64 61680
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_float_to_integer();
int /*<<< orphan*/ test_float_to_longlong_integer();
int /*<<< orphan*/ test_integer_to_float();
int /*<<< orphan*/ test_longlong_integer_to_float();
main() {
  test_integer_to_float();
  test_float_to_integer();
  test_longlong_integer_to_float();
  test_float_to_longlong_integer();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_integer_to_float@plt>
mov    $0x0,%al
call   1070 <test_float_to_integer@plt>
mov    $0x0,%al
call   1060 <test_longlong_integer_to_float@plt>
mov    $0x0,%al
call   1040 <test_float_to_longlong_integer@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_integer_to_float@plt>
xor    %eax,%eax
call   1070 <test_float_to_integer@plt>
xor    %eax,%eax
call   1060 <test_longlong_integer_to_float@plt>
xor    %eax,%eax
call   1040 <test_float_to_longlong_integer@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_integer_to_float()
%3 = call i32 (...) @test_float_to_integer()
%4 = call i32 (...) @test_longlong_integer_to_float()
%5 = call i32 (...) @test_float_to_longlong_integer()
%6 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_integer_to_float()
%2 = tail call i32 (...) @test_float_to_integer()
%3 = tail call i32 (...) @test_longlong_integer_to_float()
%4 = tail call i32 (...) @test_float_to_longlong_integer()
%5 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr,
          "Usage: %s [-num | -n num] [-f file] "
          "[-R] [-x] [-o] [username..] [tty..]\n",
          s);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: %s [-num | -n num] [-f file] [-R] [-x] [-o] [username..] [tty..]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: %s [-num | -n num] [-f file] [-R] [-x] [-o] [username..] [tty..]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int powercap_sysfs_zone_exists(char const *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
int powercap_sysfs_control_type_exists(const char *control_type) {
  return powercap_sysfs_zone_exists(control_type, NULL, 0);
}


x86 assembly (clang, -O0):
<powercap_sysfs_control_type_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <powercap_sysfs_zone_exists@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powercap_sysfs_control_type_exists>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <powercap_sysfs_zone_exists@plt>

LLVM IR (-O0):
define i32 @powercap_sysfs_control_type_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @powercap_sysfs_zone_exists(i8* %3, i32* null, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @powercap_sysfs_control_type_exists(i8* %0) {
%2 = tail call i32 @powercap_sysfs_zone_exists(i8* %0, i32* null, i32 0)
ret i32 %2
}
int isDot(const char *s) {
  return s[0] == '.' && (s[1] == '/' || s[1] == '\0');
}


x86 assembly (clang, -O0):
<isDot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    114a <isDot+0x4a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0xa(%rbp)
je     1144 <isDot+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDot>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111b <isDot+0x1b>
mov    0x1(%rdi),%cl
mov    $0x1,%eax
cmp    $0x2f,%cl
je     111b <isDot+0x1b>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @isDot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %22
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %14, %8
%21 = phi i1 [ true, %8 ], [ %19, %14 ]
br label %22
22: ; preds = %20, %1
%23 = phi i1 [ false, %1 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isDot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = icmp eq i8 %6, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %8, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %8 ]
ret i32 %12
}
int strcmp(const char *a, const char *b) {
  while (*a && (*a == *b))
    ++a, ++b;
  return *a - *b;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
int f1(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f1() {
ret i32 0
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 0
}
void RTPathExists(void) {}


x86 assembly (clang, -O0):
<RTPathExists>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RTPathExists() {
ret void
}

LLVM IR (-O2):
define void @RTPathExists() {
ret void
}
int knote_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @knote_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @knote_init() {
ret i32 0
}
void ble_rsp_attclient_read_by_type(
    const struct ble_msg_attclient_read_by_type_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_read_by_type_rsp_t = type opaque
define void @ble_rsp_attclient_read_by_type(%struct.ble_msg_attclient_read_by_type_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_clearscrn();
int read_int(char const *, int const, int const);
int menu(const char *menurow, const int lo_sel, const int hi_sel) {
  int selection;
  my_clearscrn();
  selection = read_int(menurow, lo_sel, hi_sel);
  return selection;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <my_clearscrn@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <read_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <my_clearscrn@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <read_int@plt>

LLVM IR (-O0):
define i32 @menu(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @my_clearscrn()
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @read_int(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @menu(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @my_clearscrn()
%5 = tail call i32 @read_int(i8* %0, i32 %1, i32 %2)
ret i32 %5
}
int stop_script_unsupported(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @stop_script_unsupported() {
ret i32 0
}

LLVM IR (-O2):
define i32 @stop_script_unsupported() {
ret i32 0
}