xunge/DecIR huggingface dataset:
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int register_flag_mode_katcp(struct katcp_dispatch *, char *, char *,
                             int (*)(struct katcp_dispatch *, int),
                             int /*<<< orphan*/, int);
int register_mode_katcp(struct katcp_dispatch *d, char *match, char *help,
                        int (*call)(struct katcp_dispatch *d, int argc),
                        int mode) {
  return register_flag_mode_katcp(d, match, help, call, 0, mode);
}


x86 assembly (clang, -O0):
<register_mode_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r9d
xor    %r8d,%r8d
call   1030 <register_flag_mode_katcp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_mode_katcp>:
mov    %r8d,%r9d
xor    %r8d,%r8d
jmp    1030 <register_flag_mode_katcp@plt>

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

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @register_mode_katcp(%struct.katcp_dispatch* %0, i8* %1, i8* %2, i32 (%struct.katcp_dispatch*, i32)* %3, i32 %4) {
%6 = tail call i32 @register_flag_mode_katcp(%struct.katcp_dispatch* %0, i8* %1, i8* %2, i32 (%struct.katcp_dispatch*, i32)* %3, i32 0, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SETHLm(int);
void SET4HLm() { SETHLm(0x10); }


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

x86 assembly (clang, -O2):
<SET4HLm>:
mov    $0x10,%edi
jmp    1030 <SETHLm@plt>

LLVM IR (-O0):
define void @SET4HLm() {
%1 = call i32 @SETHLm(i32 16)
ret void
}

LLVM IR (-O2):
define void @SET4HLm() {
%1 = tail call i32 @SETHLm(i32 16)
ret void
}
/* Variables and functions */
size_t bounded_strlen(const char *s, size_t maxlen) {
  size_t n;
  for (n = 0; n < maxlen && s[n] != 0x0; n++) {
  }
  return n;
}


x86 assembly (clang, -O0):
<bounded_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <bounded_strlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <bounded_strlen+0x4c>
jmp    1162 <bounded_strlen+0x62>
jmp    1151 <bounded_strlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <bounded_strlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounded_strlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <bounded_strlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <bounded_strlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <bounded_strlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @bounded_strlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
void stap_stop_task_finder(void) {}


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

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

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

LLVM IR (-O2):
define void @stap_stop_task_finder() {
ret void
}
int main() {
  ;
  ;
  ;
  ;
  ;
  while (0)
    ;
  for (; 0;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    111a <main+0x1a>
jmp    111f <main+0x1f>
jmp    110b <main+0xb>
jmp    1124 <main+0x24>
xor    %eax,%eax
test   $0x1,%al
jne    1133 <main+0x33>
jmp    1138 <main+0x38>
jmp    1124 <main+0x24>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %3, %0
br i1 false, label %3, label %4
3: ; preds = %2
br label %2
4: ; preds = %2
br label %5
5: ; preds = %6, %4
br i1 false, label %6, label %7
6: ; preds = %5
br label %5
7: ; preds = %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwscanf(int /*<<< orphan*/ *, int /*<<< orphan*/ *, ...);
void uninitvar_fwscanf(void) {
  FILE *stream;
  wchar_t *format;
  int i;
  (void)fwscanf(stream, format);
  (void)fwscanf(stream, format, &i);
}


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

x86 assembly (clang, -O2):
<uninitvar_fwscanf>:
push   %rax
xor    %eax,%eax
call   1030 <fwscanf@plt>
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <fwscanf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @uninitvar_fwscanf() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = call i32 (i32*, i32*, ...) @fwscanf(i32* %4, i32* %5)
%7 = load i32*, i32** %1
%8 = load i32*, i32** %2
%9 = call i32 (i32*, i32*, ...) @fwscanf(i32* %7, i32* %8, i32* %3)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fwscanf() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i32*, i32*, ...) @fwscanf(i32* undef, i32* undef)
%4 = call i32 (i32*, i32*, ...) @fwscanf(i32* undef, i32* undef, i32* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t ptree_bit_to_octets(uint32_t key_len) {
  return (size_t)((((key_len + 7) / 8) > (1) ? ((key_len + 7) / 8) : (1)));
}


x86 assembly (clang, -O0):
<ptree_bit_to_octets>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jle    1134 <ptree_bit_to_octets+0x34>
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1141 <ptree_bit_to_octets+0x41>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <ptree_bit_to_octets+0x41>
mov    -0x8(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptree_bit_to_octets>:
lea    0x7(%rdi),%ecx
shr    $0x3,%ecx
cmp    $0x9,%edi
mov    $0x1,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i64 @ptree_bit_to_octets(i32 %0) {
%2 = icmp sgt i32 %0, 8
%3 = add nuw nsw i32 %0, 7
%4 = lshr i32 %3, 3
%5 = select i1 %2, i32 %4, i32 1
%6 = zext i32 %5 to i64
ret i64 %6
}
int test_imm_7Dint8_reg(signed char val) {
  return ((val) & (-0x7D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Dint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -125
%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_7Dint8_reg(i8 signext %0) {
%2 = and i8 %0, -125
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ busy_pages_close();
int /*<<< orphan*/ cache_status_close();
void cc_cache_fini(void) {
  busy_pages_close();
  cache_status_close();
}


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

x86 assembly (clang, -O2):
<cc_cache_fini>:
push   %rax
xor    %eax,%eax
call   1040 <busy_pages_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cache_status_close@plt>

LLVM IR (-O0):
define void @cc_cache_fini() {
%1 = call i32 (...) @busy_pages_close()
%2 = call i32 (...) @cache_status_close()
ret void
}

LLVM IR (-O2):
define void @cc_cache_fini() {
%1 = tail call i32 (...) @busy_pages_close()
%2 = tail call i32 (...) @cache_status_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error(char *pt) {
  if (pt)
    fprintf(stderr, pt);
  abort();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <error+0x29>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
test   %rdi,%rdi
je     1137 <error+0x17>
mov    %rdi,%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 (...) @abort()
unreachable
}
void security_inode_post_link(struct dentry *old_dentry, struct inode *dir,
                              struct dentry *new_dentry) {}


x86 assembly (clang, -O0):
<security_inode_post_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.dentry = type opaque
define void @security_inode_post_link(%struct.dentry* %0, %struct.inode* %1, %struct.dentry* %2) {
%4 = alloca %struct.dentry*
%5 = alloca %struct.inode*
%6 = alloca %struct.dentry*
store %struct.dentry* %0, %struct.dentry** %4
store %struct.inode* %1, %struct.inode** %5
store %struct.dentry* %2, %struct.dentry** %6
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.dentry = type opaque
define void @security_inode_post_link(%struct.dentry* nocapture %0, %struct.inode* nocapture %1, %struct.dentry* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_yield();
void yield_cpu() { pthread_yield(); }


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

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

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

LLVM IR (-O2):
define void @yield_cpu() {
%1 = tail call i32 (...) @pthread_yield()
ret void
}
int main() {
  int a, b, c;
  c = a + b;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
char *AllocString(scalar_t__);
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
char *CopyName(char *base) {
  char *p = AllocString(strlen(base) + 4);
  return (strcpy(p, base));
}


x86 assembly (clang, -O0):
<CopyName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x4,%rdi
call   1040 <AllocString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyName>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x4(%rax),%rdi
call   1040 <AllocString@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @CopyName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 4
%7 = call i8* @AllocString(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @CopyName(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 4
%4 = tail call i8* @AllocString(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ERANGE;
int /*<<< orphan*/ errno;
unsigned long long ret_ERANGE(void) {
  errno = ERANGE;
  return (~0ULL);
}


x86 assembly (clang, -O0):
<ret_ERANGE>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret_ERANGE>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@ERANGE = global i32 0
@errno = global i32 0
define i64 @ret_ERANGE() {
%1 = load i32, i32* @ERANGE
store i32 %1, i32* @errno
ret i64 -1
}

LLVM IR (-O2):
@ERANGE = global i32 0
@errno = global i32 0
define i64 @ret_ERANGE() {
%1 = load i32, i32* @ERANGE
store i32 %1, i32* @errno
ret i64 -1
}
struct device_node *of_find_node_with_property(struct device_node *from,
                                               const char *prop_name) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define %struct.device_node* @of_find_node_with_property(%struct.device_node* %0, i8* %1) {
%3 = alloca %struct.device_node*
%4 = alloca i8*
store %struct.device_node* %0, %struct.device_node** %3
store i8* %1, i8** %4
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias %struct.device_node* @of_find_node_with_property(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1) {
ret %struct.device_node* null
}
unsigned int get_left(unsigned int index) { return index * 2 + 1; }


x86 assembly (clang, -O0):
<get_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_left(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void f(void) {
#pragma acc host_data use_device(v1)
  ;
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test();
int main(int argc, const char *argv[]) {
  int t = test();
  printf("abcd!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"abcd!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *longname() { return ("not implemented"); }


x86 assembly (clang, -O0):
<longname>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"not implemented\00"
define i8* @longname() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"not implemented\00"
define i8* @longname() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ phys_to_virt(int);
unsigned int get_bios_ebda(void) {
  unsigned int address = *(unsigned short *)phys_to_virt(0x40E);
  address <<= 4;
  return address;
}


x86 assembly (clang, -O0):
<get_bios_ebda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40e,%edi
call   1030 <phys_to_virt@plt>
movzwl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bios_ebda>:
push   %rax
mov    $0x40e,%edi
call   1030 <phys_to_virt@plt>
movzwl (%rax),%eax
shl    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_bios_ebda() {
%1 = alloca i32
%2 = call i64 @phys_to_virt(i32 1038)
%3 = inttoptr i64 %2 to i16*
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = shl i32 %6, 4
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_bios_ebda() {
%1 = tail call i64 @phys_to_virt(i32 1038)
%2 = inttoptr i64 %1 to i16*
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl nuw nsw i32 %4, 4
ret i32 %5
}
/* Variables and functions */
size_t minipack_sizeof_nil() { return 1; }


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

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

LLVM IR (-O0):
define i64 @minipack_sizeof_nil() {
ret i64 1
}

LLVM IR (-O2):
define i64 @minipack_sizeof_nil() {
ret i64 1
}
void GPMCCSConfig(unsigned int baseAddr, unsigned int csNum,
                  unsigned int conf) {
  (*((volatile unsigned int *)(baseAddr + (0x78 + (csNum * (0x30)))))) &=
      ~(0x00000040u);
  (*((volatile unsigned int *)(baseAddr + (0x78 + (csNum * (0x30)))))) |=
      ((conf << (0x00000006u)) & (0x00000040u));
}


x86 assembly (clang, -O0):
<GPMCCSConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x78,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x6,%edx
and    $0x40,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x78,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCCSConfig>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x78,%eax
andl   $0xffffffbf,(%rax)
shl    $0x6,%edx
and    $0x40,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCCSConfig(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 120, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -65
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 6
%18 = and i32 %17, 64
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 120, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCCSConfig(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 120
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -65
store volatile i32 %10, i32* %8
%11 = shl i32 %2, 6
%12 = and i32 %11, 64
%13 = load volatile i32, i32* %8
%14 = or i32 %13, %12
store volatile i32 %14, i32* %8
ret void
}
void test_funcptr(int (*f1)(int, double), int (*f2)(int, float)) {
  float *fp = accept_funcptr(f1);
  accept_funcptr(f2);
}


x86 assembly (clang, -O0):
<test_funcptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <accept_funcptr@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <accept_funcptr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_funcptr>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <accept_funcptr@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <accept_funcptr@plt>

LLVM IR (-O0):
define void @test_funcptr(i32 (i32, double)* %0, i32 (i32, float)* %1) {
%3 = alloca i32 (i32, double)*
%4 = alloca i32 (i32, float)*
%5 = alloca float*
store i32 (i32, double)* %0, i32 (i32, double)** %3
store i32 (i32, float)* %1, i32 (i32, float)** %4
%6 = load i32 (i32, double)*, i32 (i32, double)** %3
%7 = call i32 (i32 (i32, double)*, ...) bitcast (i32 (...)* @accept_funcptr to i32 (i32 (i32, double)*, ...)*)(i32 (i32, double)* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to float*
store float* %9, float** %5
%10 = load i32 (i32, float)*, i32 (i32, float)** %4
%11 = call i32 (i32 (i32, float)*, ...) bitcast (i32 (...)* @accept_funcptr to i32 (i32 (i32, float)*, ...)*)(i32 (i32, float)* %10)
ret void
}

LLVM IR (-O2):
define void @test_funcptr(i32 (i32, double)* %0, i32 (i32, float)* %1) {
%3 = tail call i32 (i32 (i32, double)*, ...) bitcast (i32 (...)* @accept_funcptr to i32 (i32 (i32, double)*, ...)*)(i32 (i32, double)* %0)
%4 = tail call i32 (i32 (i32, float)*, ...) bitcast (i32 (...)* @accept_funcptr to i32 (i32 (i32, float)*, ...)*)(i32 (i32, float)* %1)
ret void
}
/* Variables and functions */
int chdir(char const *);
int _tchdir(const char *dirname) { return chdir(dirname); }


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

x86 assembly (clang, -O2):
<_tchdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @_tchdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ list_dir(char *);
char *parse_cmd_args(int, char **);
int main(int argc, char **argv) {
  char *path = parse_cmd_args(argc, argv);
  if (path == NULL) {
    return EXIT_FAILURE;
  }
  list_dir(path);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_cmd_args@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <main+0x42>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <main+0x57>
mov    -0x18(%rbp),%rdi
call   1040 <list_dir@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse_cmd_args@plt>
test   %rax,%rax
je     113c <main+0x1c>
mov    %rax,%rdi
call   1040 <list_dir@plt>
mov    0x2e9e(%rip),%rax
jmp    1143 <main+0x23>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i8* @parse_cmd_args(i32 %7, i8** %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = call i32 @list_dir(i8* %15)
%17 = load i32, i32* @EXIT_SUCCESS
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i8* @parse_cmd_args(i32 %0, i8** %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @list_dir(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32* [ @EXIT_SUCCESS, %5 ], [ @EXIT_FAILURE, %2 ]
%9 = load i32, i32* %8
ret i32 %9
}
const char *callname(long call) {
  switch (call) {
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<callname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<callname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @callname(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
switch i64 %3, label %4 [
]
4: ; preds = %1
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @callname(i64 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gentrainmats(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  gentrainmats(stdout);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <gentrainmats@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = call i32 @gentrainmats(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @gentrainmats(i32 %3)
ret i32 0
}
int test_imm_FAint8_mem(signed char *val) {
  return ((*val) & (-0xFA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FAint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff06,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FAint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -250
%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_FAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -250
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
struct cirbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __cirbuf_add_head(struct cirbuf *, char);
void cirbuf_add_head(struct cirbuf *cbuf, char c) {
  __cirbuf_add_head(cbuf, c);
}


x86 assembly (clang, -O0):
<cirbuf_add_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <__cirbuf_add_head@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cirbuf_add_head>:
jmp    1030 <__cirbuf_add_head@plt>

LLVM IR (-O0):
%struct.cirbuf = type { i32 }
define void @cirbuf_add_head(%struct.cirbuf* %0, i8 signext %1) {
%3 = alloca %struct.cirbuf*
%4 = alloca i8
store %struct.cirbuf* %0, %struct.cirbuf** %3
store i8 %1, i8* %4
%5 = load %struct.cirbuf*, %struct.cirbuf** %3
%6 = load i8, i8* %4
%7 = call i32 @__cirbuf_add_head(%struct.cirbuf* %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
%struct.cirbuf = type { i32 }
define void @cirbuf_add_head(%struct.cirbuf* %0, i8 signext %1) {
%3 = tail call i32 @__cirbuf_add_head(%struct.cirbuf* %0, i8 signext %1)
ret void
}
/* Variables and functions */
int mus_seek_frame(int, int);
int seek_sound_frame(int tfd, int frame) {
  return (mus_seek_frame(tfd, frame));
}


x86 assembly (clang, -O0):
<seek_sound_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mus_seek_frame@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_sound_frame>:
jmp    1030 <mus_seek_frame@plt>

LLVM IR (-O0):
define i32 @seek_sound_frame(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 = call i32 @mus_seek_frame(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @seek_sound_frame(i32 %0, i32 %1) {
%3 = tail call i32 @mus_seek_frame(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __wfe();
void check__wfe(void) { __wfe(); }


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

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

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

LLVM IR (-O2):
define void @check__wfe() {
%1 = tail call i32 (...) @__wfe()
ret void
}
void XtToolkitInitialize() {}


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

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

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

LLVM IR (-O2):
define void @XtToolkitInitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
void scs(char **str, const char *s) {
  int len = strlen(s);
  memcpy(*str, s, len);
  (*str) += len;
}


x86 assembly (clang, -O0):
<scs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scs>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    (%r14),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @scs(i8** nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i32 %3)
%6 = load i8*, i8** %0
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isfinite(int /*<<< orphan*/);
int main(int argc, char **argv) { isfinite(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <isfinite@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @isfinite(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isfinite(i32 0)
ret i32 0
}
/* Variables and functions */
unsigned long factorial(unsigned int);
unsigned long int ncr(unsigned int n, unsigned int r) {
  return factorial(n) / (factorial(n - r) * factorial(r));
}


x86 assembly (clang, -O0):
<ncr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
imul   %rdx,%rcx
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <factorial@plt>
mov    %rax,%r14
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
imul   %rbx,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1150 <ncr+0x40>
mov    %r14,%rax
xor    %edx,%edx
div    %rcx
jmp    1157 <ncr+0x47>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @ncr(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 = call i64 @factorial(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sub i32 %7, %8
%10 = call i64 @factorial(i32 %9)
%11 = load i32, i32* %4
%12 = call i64 @factorial(i32 %11)
%13 = mul i64 %10, %12
%14 = udiv i64 %6, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @ncr(i32 %0, i32 %1) {
%3 = tail call i64 @factorial(i32 %0)
%4 = sub i32 %0, %1
%5 = tail call i64 @factorial(i32 %4)
%6 = tail call i64 @factorial(i32 %1)
%7 = mul i64 %6, %5
%8 = udiv i64 %3, %7
ret i64 %8
}
void strcat2(char *s, char *t) {
  while (*s++)
    ;
  *s--;
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<strcat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1129 <strcat2+0x29>
jmp    110c <strcat2+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1164 <strcat2+0x64>
jmp    1135 <strcat2+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat2>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat2>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat2+0x10>
ret

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

LLVM IR (-O2):
define void @strcat2(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(void *, void *);
int match_channel_keylist_handler(void *key1, void *key2) {
  return !strcmp(key1, key2);
}


x86 assembly (clang, -O0):
<match_channel_keylist_handler>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_channel_keylist_handler>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match_channel_keylist_handler(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @match_channel_keylist_handler(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
signed long int signedlongint_ignoring_signedlonglong(signed long int x,
                                                      signed long long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlongint_ignoring_signedlonglong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_signedlonglong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
int handle_fcgi(int read_fd, int write_fd, struct child_cmd *cmd) {}


x86 assembly (clang, -O0):
<handle_fcgi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.child_cmd = type opaque
define i32 @handle_fcgi(i32 %0, i32 %1, %struct.child_cmd* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.child_cmd*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.child_cmd* %2, %struct.child_cmd** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.child_cmd = type opaque
define i32 @handle_fcgi(i32 %0, i32 %1, %struct.child_cmd* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar(void) { return getc(stdin); }


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

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime_r(int /*<<< orphan*/ const *, char *);
char *ctime(const time_t *t) {
  static char __buff[30];
  return ctime_r(t, &__buff[0]);
}


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

x86 assembly (clang, -O2):
<ctime>:
lea    0x2f29(%rip),%rsi
jmp    1030 <ctime_r@plt>

LLVM IR (-O0):
@ctime.__buff = internal global [30 x i8] zeroinitializer
define i8* @ctime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i8* @ctime_r(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ctime.__buff, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@ctime.__buff = internal global [30 x i8] zeroinitializer
define i8* @ctime(i32* %0) {
%2 = tail call i8* @ctime_r(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ctime.__buff, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x30() {
  Assert_real((ispunct(48) == 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",
              245, ("ispunct should be 0 for 0"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x30>:
push   %rax
mov    $0x30,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf5,%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 = [26 x i8] c"ispunct should be 0 for 0\00"
define void @t_ispunct_0x30() {
%1 = call i64 @ispunct(i32 48)
%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 245, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 0\00"
define void @t_ispunct_0x30() {
%1 = tail call i64 @ispunct(i32 48)
%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 245, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
void sig_int(int signo) {
  pr_mask("\n in sig_int: ");
  return;
}


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <pr_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0A in sig_int: \00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_mask(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A in sig_int: \00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @pr_mask(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}