xunge/DecIR huggingface dataset:
void swap(char str[], int i, int j) {
  char temp = str[i];
  str[i] = str[j];
  str[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
__attribute__((no)) void foo() {
  int x = 0;
  while (++x)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1122 <foo+0x22>
jmp    110b <foo+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
void debug_memmap() {
  {};
  {};
  {};
  unsigned int l = 0xFF0103F8 - 0xFF0101E4;
  {};
  {};
  {};
  {};
  l = 0x1000 - l - 0x4b0;
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  unsigned int v = 0xFF547F60 + 0x7F0000;
  {};
  {};
  unsigned int v2 = 0x27128 - 0x1900;
  {};
  {};
  {};
  {};
  {};
  {};
  v2 = 0x8A9E0 - 0x27128;
  {};
  {};
  v2 = 0x103958 - 0x8A9E0;
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
  {};
}


x86 assembly (clang, -O0):
<debug_memmap>:
push   %rbp
mov    %rsp,%rbp
movl   $0x214,-0x4(%rbp)
mov    $0x1000,%eax
sub    -0x4(%rbp),%eax
sub    $0x4b0,%eax
mov    %eax,-0x4(%rbp)
movl   $0xffd37f60,-0x8(%rbp)
movl   $0x25828,-0xc(%rbp)
movl   $0x638b8,-0xc(%rbp)
movl   $0x78f78,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @debug_memmap() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 532, i32* %1
%4 = load i32, i32* %1
%5 = sub i32 4096, %4
%6 = sub i32 %5, 1200
store i32 %6, i32* %1
store i32 -2916512, i32* %2
store i32 153640, i32* %3
store i32 407736, i32* %3
store i32 495480, i32* %3
ret void
}

LLVM IR (-O2):
define void @debug_memmap() {
ret void
}
/* Type definitions */
struct rcu_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lockdep_assert_irqs_disabled();
void rcu_lockdep_assert_cblist_protected(struct rcu_data *rdp) {
  lockdep_assert_irqs_disabled();
}


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

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

LLVM IR (-O0):
%struct.rcu_data = type { i32 }
define void @rcu_lockdep_assert_cblist_protected(%struct.rcu_data* %0) {
%2 = alloca %struct.rcu_data*
store %struct.rcu_data* %0, %struct.rcu_data** %2
%3 = call i32 (...) @lockdep_assert_irqs_disabled()
ret void
}

LLVM IR (-O2):
%struct.rcu_data = type { i32 }
define void @rcu_lockdep_assert_cblist_protected(%struct.rcu_data* nocapture readnone %0) {
%2 = tail call i32 (...) @lockdep_assert_irqs_disabled()
ret void
}
unsigned int dma_get(unsigned int *dma_virtual_address, int offset) {
  return dma_virtual_address[offset >> 2];
}


x86 assembly (clang, -O0):
<dma_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma_get>:
sar    $0x2,%esi
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @dma_get(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 = ashr i32 %6, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @dma_get(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int is_first_in_group_Party(size_t __tag) { return (__tag == (448)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_first_in_group_Party>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1c0,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_in_group_Party>:
xor    %eax,%eax
cmp    $0x1c0,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_first_in_group_Party(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 448
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_first_in_group_Party(i64 %0) {
%2 = icmp eq i64 %0, 448
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
strlen(char s[]) {
  int i;
  i = 0;
  while (s[i] != '\0')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ _numargs();
int /*<<< orphan*/ newexit(long);
void NEWEXIT(long *status) { newexit((_numargs() > 0) ? *status : 0); }


x86 assembly (clang, -O0):
<NEWEXIT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_numargs@plt>
cmp    $0x0,%rax
jle    114d <NEWEXIT+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1158 <NEWEXIT+0x38>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1158 <NEWEXIT+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <newexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NEWEXIT>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <_numargs@plt>
test   %rax,%rax
jle    1138 <NEWEXIT+0x18>
mov    (%r14),%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <newexit@plt>

LLVM IR (-O0):
define void @NEWEXIT(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @_numargs()
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
%11 = call i32 @newexit(i64 %10)
ret void
}

LLVM IR (-O2):
define void @NEWEXIT(i64* nocapture %0) {
%2 = tail call i64 (...) @_numargs()
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i64, i64* %0
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ 0, %1 ]
%8 = tail call i32 @newexit(i64 %7)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ createloop(struct node *, struct node *);
int /*<<< orphan*/ detectloop(struct node *);
int /*<<< orphan*/ insert(struct node **, int);
int main(void) {
  struct node *head = NULL;
  insert(&head, 5);
  insert(&head, 10);
  insert(&head, 15);
  insert(&head, 20);
  createloop(head, head);
  detectloop(head);
  return 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0xf,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1040 <insert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <createloop@plt>
mov    -0x10(%rbp),%rdi
call   1050 <detectloop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <insert@plt>
mov    0x8(%rsp),%rdi
mov    %rdi,%rsi
call   1030 <createloop@plt>
mov    0x8(%rsp),%rdi
call   1050 <detectloop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = call i32 @insert(%struct.node** %2, i32 5)
%4 = call i32 @insert(%struct.node** %2, i32 10)
%5 = call i32 @insert(%struct.node** %2, i32 15)
%6 = call i32 @insert(%struct.node** %2, i32 20)
%7 = load %struct.node*, %struct.node** %2
%8 = load %struct.node*, %struct.node** %2
%9 = call i32 @createloop(%struct.node* %7, %struct.node* %8)
%10 = load %struct.node*, %struct.node** %2
%11 = call i32 @detectloop(%struct.node* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = call i32 @insert(%struct.node** %1, i32 5)
%4 = call i32 @insert(%struct.node** %1, i32 10)
%5 = call i32 @insert(%struct.node** %1, i32 15)
%6 = call i32 @insert(%struct.node** %1, i32 20)
%7 = load %struct.node*, %struct.node** %1
%8 = call i32 @createloop(%struct.node* %7, %struct.node* %7)
%9 = load %struct.node*, %struct.node** %1
%10 = call i32 @detectloop(%struct.node* %9)
ret i32 0
}
char charcmp(char *one, char *two) {
  if (one == two) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<charcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1123 <charcmp+0x23>
movb   $0x0,-0x1(%rbp)
jmp    1127 <charcmp+0x27>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charcmp>:
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define signext i8 @charcmp(i8* %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i8 0, i8* %3
br label %11
10: ; preds = %2
store i8 1, i8* %3
br label %11
11: ; preds = %10, %9
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @charcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int *bitToCoordinates(char *);
char *sBox(char *box[4][4], char *half) {
  int *coordinates = bitToCoordinates(half);
  return box[coordinates[0]][coordinates[1]];
}


x86 assembly (clang, -O0):
<sBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bitToCoordinates@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
movslq 0x4(%rcx),%rcx
mov    (%rax,%rcx,8),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sBox>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <bitToCoordinates@plt>
movslq (%rax),%rcx
movslq 0x4(%rax),%rax
shl    $0x5,%rcx
add    %rbx,%rcx
mov    (%rcx,%rax,8),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sBox([4 x i8*]* %0, i8* %1) {
%3 = alloca [4 x i8*]*
%4 = alloca i8*
%5 = alloca i32*
store [4 x i8*]* %0, [4 x i8*]** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32* @bitToCoordinates(i8* %6)
store i32* %7, i32** %5
%8 = load [4 x i8*]*, [4 x i8*]** %3
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 %12
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i8*], [4 x i8*]* %13, i64 0, i64 %17
%19 = load i8*, i8** %18
ret i8* %19
}

LLVM IR (-O2):
define i8* @sBox([4 x i8*]* nocapture %0, i8* %1) {
%3 = tail call i32* @bitToCoordinates(i8* %1)
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 1
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x i8*], [4 x i8*]* %0, i64 %5, i64 %8
%10 = load i8*, i8** %9
ret i8* %10
}
int test_imm_B5int16_mem(short *val) {
  return ((*val) & (0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xb5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5int16_mem>:
testb  $0xb5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B5int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 181
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct text_tag_list {
  int dummy;
};
struct text_tag {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_unlink(struct genlist *, struct text_tag *);
void text_tag_list_unlink(struct text_tag_list *tthis, struct text_tag *pfoo) {
  genlist_unlink(((struct genlist *)(tthis)), pfoo);
}


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

x86 assembly (clang, -O2):
<text_tag_list_unlink>:
jmp    1030 <genlist_unlink@plt>

LLVM IR (-O0):
%struct.text_tag_list = type { i32 }
%struct.text_tag = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_unlink(%struct.text_tag_list* %0, %struct.text_tag* %1) {
%3 = alloca %struct.text_tag_list*
%4 = alloca %struct.text_tag*
store %struct.text_tag_list* %0, %struct.text_tag_list** %3
store %struct.text_tag* %1, %struct.text_tag** %4
%5 = load %struct.text_tag_list*, %struct.text_tag_list** %3
%6 = bitcast %struct.text_tag_list* %5 to %struct.genlist*
%7 = load %struct.text_tag*, %struct.text_tag** %4
%8 = call i32 @genlist_unlink(%struct.genlist* %6, %struct.text_tag* %7)
ret void
}

LLVM IR (-O2):
%struct.text_tag_list = type { i32 }
%struct.text_tag = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_unlink(%struct.text_tag_list* %0, %struct.text_tag* %1) {
%3 = bitcast %struct.text_tag_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_unlink(%struct.genlist* %3, %struct.text_tag* %1)
ret void
}
unsigned long mtk_smi_larb_get_base(int larbid) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @mtk_smi_larb_get_base(i32 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ endGame();
int /*<<< orphan*/ resetGame();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ textSize(int);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void setup() {
  textSize(24);
  srand(time(0));
  resetGame();
  endGame();
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1070 <textSize@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <resetGame@plt>
mov    $0x0,%al
call   1030 <endGame@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
mov    $0x18,%edi
call   1070 <textSize@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <resetGame@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <endGame@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @textSize(i32 24)
%2 = call i32 @time(i32 0)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @resetGame()
%5 = call i32 (...) @endGame()
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @textSize(i32 24)
%2 = tail call i32 @time(i32 0)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @resetGame()
%5 = tail call i32 (...) @endGame()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(struct foo *);
scalar_t__ malloc(size_t);
int main() {
  struct foo {
    unsigned base : 8;
    unsigned flag1 : 1;
    unsigned flag2 : 3;
    unsigned flag3 : 4;
    char nothing[0];
  };
  struct foo *f = (struct foo *)malloc(((size_t) & ((struct foo *)0)->nothing));
  f->base = 1;
  f->flag1 = 1;
  free(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cx
and    $0xff00,%cx
or     $0x1,%cx
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cx
and    $0xfeff,%cx
or     $0x100,%cx
mov    %cx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    $0xfffffe00,%ecx
and    (%rax),%ecx
or     $0x101,%ecx
mov    %cx,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.foo = type { i16, [0 x i8], [2 x i8] }
%struct.foo.0 = type opaque
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.foo*
store i32 0, i32* %1
%3 = call i64 @malloc(i64 ptrtoint ([0 x i8]* getelementptr inbounds (%struct.foo, %struct.foo* null, i32 0, i32 1) to i64))
%4 = inttoptr i64 %3 to %struct.foo*
store %struct.foo* %4, %struct.foo** %2
%5 = load %struct.foo*, %struct.foo** %2
%6 = bitcast %struct.foo* %5 to i16*
%7 = load i16, i16* %6
%8 = and i16 %7, -256
%9 = or i16 %8, 1
store i16 %9, i16* %6
%10 = load %struct.foo*, %struct.foo** %2
%11 = bitcast %struct.foo* %10 to i16*
%12 = load i16, i16* %11
%13 = and i16 %12, -257
%14 = or i16 %13, 256
store i16 %14, i16* %11
%15 = load %struct.foo*, %struct.foo** %2
%16 = bitcast %struct.foo* %15 to %struct.foo.0*
%17 = call i32 @free(%struct.foo.0* %16)
ret i32 0
}

LLVM IR (-O2):
%struct.foo = type { i16, [0 x i8], [2 x i8] }
%struct.foo.0 = type opaque
define i32 @main() {
%1 = tail call i64 @malloc(i64 2)
%2 = inttoptr i64 %1 to %struct.foo*
%3 = getelementptr %struct.foo, %struct.foo* %2, i64 0, i32 0
%4 = load i16, i16* %3
%5 = and i16 %4, -512
%6 = or i16 %5, 257
store i16 %6, i16* %3
%7 = inttoptr i64 %1 to %struct.foo.0*
%8 = tail call i32 @free(%struct.foo.0* %7)
ret i32 0
}
/* Variables and functions */
size_t otrx_min(size_t x, size_t y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<otrx_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <otrx_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <otrx_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<otrx_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @otrx_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void waitpids(void) { nocall("waitpids"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"waitpids\00"
define void @waitpids() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
f(int *p) { *p = 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movl   $0x2,(%rdi)
ret

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
store i32 2, i32* %4
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32* nocapture writeonly %0) {
store i32 2, i32* %0
ret i32 undef
}
/* Variables and functions */
int isupper(char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
double v2f(double v2, double v) { return 0.8 * v2 + v; }


x86 assembly (clang, -O0):
<v2f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2f>:
mulsd  0xef8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @v2f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double 8.000000e-01, double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @v2f(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 8.000000e-01, double %1)
ret double %3
}
/* Variables and functions */
int rand();
int skiplist_rand_level(void) {
  int level = 1;
  while ((rand() & 0xffff) < (0.5 * 0xffff))
    level += 1;
  if (level < 32)
    return level;
  return 32;
}


x86 assembly (clang, -O0):
<skiplist_rand_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <skiplist_rand_level+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <skiplist_rand_level+0xf>
cmpl   $0x20,-0x8(%rbp)
jge    1164 <skiplist_rand_level+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <skiplist_rand_level+0x5b>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skiplist_rand_level>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
test   $0x8000,%eax
je     1120 <skiplist_rand_level+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @skiplist_rand_level() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @rand()
%5 = and i32 %4, 65535
%6 = sitofp i32 %5 to double
%7 = fcmp olt double %6, 3.276750e+04
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 32
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %17
16: ; preds = %11
store i32 32, i32* %1
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @skiplist_rand_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 32768
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ab_help(char const *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void ab_badarg(char const *const arg, char const *const argv0) {
  if (arg == NULL) {
    fputs("Bad parameter\r\n", stderr);
  } else {
    fprintf(stderr, "Bad parameter: %s\r\n", arg);
  }
  ab_help(argv0);
  return;
}


x86 assembly (clang, -O0):
<ab_badarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1165 <ab_badarg+0x35>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
call   1030 <fputs@plt>
jmp    117e <ab_badarg+0x4e>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <ab_help@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ab_badarg>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
test   %rdi,%rdi
je     1155 <ab_badarg+0x25>
mov    %rdi,%rdx
lea    0xec4(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
jmp    1163 <ab_badarg+0x33>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <ab_help@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Bad parameter\0D\0A\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Bad parameter: %s\0D\0A\00"
define void @ab_badarg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %7
%15 = load i8*, i8** %4
%16 = call i32 @ab_help(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Bad parameter\0D\0A\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Bad parameter: %s\0D\0A\00"
define void @ab_badarg(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = load i32, i32* @stderr
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
7: ; preds = %2
%8 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %5
%10 = tail call i32 @ab_help(i8* %1)
ret void
}
int MR_getopt_long_only(argc, argv, MR_options, long_options, opt_index)
int argc;
char *const *argv;
const char *MR_options;
const struct MR_option *long_options;
int *opt_index;
{
  return MR__getopt_internal(argc, argv, MR_options, long_options, opt_index,
                             1);
}


x86 assembly (clang, -O0):
<MR_getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
mov    $0x0,%al
call   1030 <MR__getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MR_getopt_long_only>:
mov    $0x1,%r9d
xor    %eax,%eax
jmp    1030 <MR__getopt_internal@plt>

LLVM IR (-O0):
%struct.MR_option = type opaque
define i32 @MR_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.MR_option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.MR_option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.MR_option* %3, %struct.MR_option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.MR_option*, %struct.MR_option** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...) bitcast (i32 (...)* @MR__getopt_internal to i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...)*)(i32 %11, i8** %12, i8* %13, %struct.MR_option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.MR_option = type opaque
define i32 @MR_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.MR_option* %3, i32* %4) {
%6 = tail call i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...) bitcast (i32 (...)* @MR__getopt_internal to i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.MR_option* %3, i32* %4, i32 1)
ret i32 %6
}
void g_type_query() {}


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

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

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

LLVM IR (-O2):
define void @g_type_query() {
ret void
}
unsigned char *get_active_char(unsigned char *c, unsigned char *buffer) {
  buffer++;
  while (*buffer == '#') {
    do
      buffer++;
    while (*buffer != '\n');
    buffer++;
  }
  *c = *buffer;
  return buffer;
}


x86 assembly (clang, -O0):
<get_active_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x23,%eax
jne    115a <get_active_char+0x5a>
jmp    112d <get_active_char+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
jne    112d <get_active_char+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <get_active_char+0x18>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_active_char>:
mov    0x1(%rsi),%cl
add    $0x1,%rsi
cmp    $0x23,%cl
jne    1130 <get_active_char+0x30>
nopl   0x0(%rax)
mov    %rsi,%rax
add    $0x1,%rsi
cmpb   $0xa,0x1(%rax)
jne    1110 <get_active_char+0x10>
movzbl 0x2(%rax),%ecx
add    $0x2,%rax
mov    %rax,%rsi
cmp    $0x23,%cl
je     1110 <get_active_char+0x10>
mov    %cl,(%rdi)
ret
mov    %rsi,%rax
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @get_active_char(i8* nocapture writeonly %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 35
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8* [ %12, %11 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %13, label %11
11: ; preds = %6, %13
%12 = phi i8* [ %8, %6 ], [ %14, %13 ]
br label %6
13: ; preds = %6
%14 = getelementptr inbounds i8, i8* %7, i64 2
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 35
br i1 %16, label %11, label %17
17: ; preds = %13, %2
%18 = phi i8* [ %3, %2 ], [ %14, %13 ]
%19 = phi i8 [ %4, %2 ], [ %15, %13 ]
store i8 %19, i8* %0
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x77() {
  Assert_real((islower(119)),
              "/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_islower.c",
              600, ("islower should be 1 for w"));
}


x86 assembly (clang, -O0):
<t_islower_0x77>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x258,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x258,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for w\00"
define void @t_islower_0x77() {
%1 = call i32 @islower(i32 119)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for w\00"
define void @t_islower_0x77() {
%1 = tail call i32 @islower(i32 119)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_port(int, short);
void configure_pit() {
  short freq = 1193182 / 100;
  write_port(0x43, 0b00110100);
  write_port(0x40, freq & 0xFF);
  write_port(0x40, (freq >> 8) & 0xFF);
}


x86 assembly (clang, -O0):
<configure_pit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x2e9b,-0x2(%rbp)
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <write_port@plt>
movswl -0x2(%rbp),%eax
and    $0xff,%eax
mov    $0x40,%edi
movswl %ax,%esi
call   1030 <write_port@plt>
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x40,%edi
movswl %ax,%esi
call   1030 <write_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_pit>:
push   %rax
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <write_port@plt>
mov    $0x40,%edi
mov    $0x9b,%esi
call   1030 <write_port@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
pop    %rax
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @configure_pit() {
%1 = alloca i16
store i16 11931, i16* %1
%2 = call i32 @write_port(i32 67, i16 signext 52)
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i16
%7 = call i32 @write_port(i32 64, i16 signext %6)
%8 = load i16, i16* %1
%9 = sext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i16
%13 = call i32 @write_port(i32 64, i16 signext %12)
ret void
}

LLVM IR (-O2):
define void @configure_pit() {
%1 = tail call i32 @write_port(i32 67, i16 signext 52)
%2 = tail call i32 @write_port(i32 64, i16 signext 155)
%3 = tail call i32 @write_port(i32 64, i16 signext 46)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, char *);
unsigned long get_zeroed_page(int gfp_mask) {
  void *ptr_page = NULL;
  ptr_page = (void *)malloc(4096);
  if (ptr_page == NULL) {
    printf("CRITICAL-ERROR: malloc failed at %d%s\n", 37,
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/chamdoo/bdbm_drv/refs/heads/master/"
           "common/utils/upage.c");
  }
  return (unsigned long)ptr_page;
}


x86 assembly (clang, -O0):
<get_zeroed_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <get_zeroed_page+0x44>
lea    0xead(%rip),%rdi
mov    $0x25,%esi
lea    0xec8(%rip),%rdx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_zeroed_page>:
push   %rbx
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <get_zeroed_page+0x2b>
lea    0xec6(%rip),%rdi
lea    0xee6(%rip),%rdx
mov    $0x25,%esi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"CRITICAL-ERROR: malloc failed at %d%s\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chamdoo/bdbm_drv/refs/heads/master/common/utils/upage.c\00"
define i64 @get_zeroed_page(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = call i64 @malloc(i32 4096)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %11 to i64
ret i64 %12
}

LLVM IR (-O2):
@.str = [39 x i8] c"CRITICAL-ERROR: malloc failed at %d%s\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chamdoo/bdbm_drv/refs/heads/master/common/utils/upage.c\00"
define i64 @get_zeroed_page(i32 %0) {
%2 = tail call i64 @malloc(i32 4096)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(x == y && x >= 0);
  while (x > 0) {
    x--;
    y--;
  }
  assert(y >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jne    114a <main+0x2a>
cmpl   $0x0,-0x8(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1178 <main+0x58>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <main+0x37>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 0
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assume(i32 %12)
br label %14
14: ; preds = %17, %10
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, -1
store i32 %21, i32* %3
br label %14
22: ; preds = %14
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ NpyOS_ascii_isalpha(char);
scalar_t__ NpyOS_ascii_isdigit(char);
int NpyOS_ascii_isalnum(char c) {
  return NpyOS_ascii_isdigit(c) || NpyOS_ascii_isalpha(c);
}


x86 assembly (clang, -O0):
<NpyOS_ascii_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <NpyOS_ascii_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <NpyOS_ascii_isalnum+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <NpyOS_ascii_isalpha@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):
<NpyOS_ascii_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <NpyOS_ascii_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <NpyOS_ascii_isalnum+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <NpyOS_ascii_isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @NpyOS_ascii_isalnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @NpyOS_ascii_isdigit(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 @NpyOS_ascii_isalpha(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 @NpyOS_ascii_isalnum(i8 signext %0) {
%2 = tail call i64 @NpyOS_ascii_isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @NpyOS_ascii_isalpha(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
}
/* Variables and functions */
int fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int test_flush_stdout(void) { return fflush(stdout); }


x86 assembly (clang, -O0):
<test_flush_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_flush_stdout>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @test_flush_stdout() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @test_flush_stdout() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ set_value(int);
void lock_sem() { set_value(-1); }


x86 assembly (clang, -O0):
<lock_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_sem>:
mov    $0xffffffff,%edi
jmp    1030 <set_value@plt>

LLVM IR (-O0):
define void @lock_sem() {
%1 = call i32 @set_value(i32 -1)
ret void
}

LLVM IR (-O2):
define void @lock_sem() {
%1 = tail call i32 @set_value(i32 -1)
ret void
}
void hl_socket_init() {}


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

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

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

LLVM IR (-O2):
define void @hl_socket_init() {
ret void
}