xunge/DecIR huggingface dataset:
void emit_utf8_start(struct processor_explicatory_state *process_state,
                     struct modern_stream *stream, void *stream_state,
                     struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_utf8_start(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_utf8_start(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *romfopen(char *, char *);
int rom_present(char *fn) {
  FILE *f;
  f = romfopen(fn, "rb");
  if (f) {
    fclose(f);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rom_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <romfopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <rom_present+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <rom_present+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rom_present>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <romfopen@plt>
test   %rax,%rax
je     1141 <rom_present+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @rom_present(i8* %0) {
%2 = tail call i32* @romfopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
char *strrchr(char const *, char);
char *win_basename(const char *path) {
  char *substr = strrchr(path, '\\');
  if (NULL == substr)
    substr = strrchr(path, '/');
  return NULL == substr ? path : substr + 1;
}


x86 assembly (clang, -O0):
<win_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    114c <win_basename+0x3c>
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1165 <win_basename+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1171 <win_basename+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<win_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5c,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
jne    1130 <win_basename+0x20>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @win_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 92)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i8* @strrchr(i8* %9, i8 signext 47)
store i8* %10, i8** %3
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
%13 = icmp eq i8* null, %12
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i8*, i8** %2
br label %19
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
br label %19
19: ; preds = %16, %14
%20 = phi i8* [ %15, %14 ], [ %18, %16 ]
ret i8* %20
}

LLVM IR (-O2):
define i8* @win_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
void avpriv_slicethread_execute() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_slicethread_execute() {
ret void
}
signed long long int
signedlonglongint_ignoring_unsignedlongint(signed long long int x,
                                           unsigned long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglongint_ignoring_unsignedlongint(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 @signedlonglongint_ignoring_unsignedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void glutEstablishOverlay(void) { exit(0); }


x86 assembly (clang, -O0):
<glutEstablishOverlay>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<glutEstablishOverlay>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @glutEstablishOverlay() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @glutEstablishOverlay() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
char test_170_6(char *mem) {
  char expected = 1;
  char desired = 5;
  return __atomic_compare_exchange(mem + 0, &expected, &desired, 0, 4, 0);
}


x86 assembly (clang, -O0):
<test_170_6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
movb   $0x5,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x9(%rbp),%al
mov    -0xa(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0xd(%rbp)
mov    %cl,-0xc(%rbp)
test   $0x1,%al
jne    1137 <test_170_6+0x37>
mov    -0xc(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
and    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_170_6>:
mov    $0x5,%cl
mov    $0x1,%al
lock cmpxchg %cl,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define signext i8 @test_170_6(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %2
store i8 1, i8* %3
store i8 5, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %3
%9 = load i8, i8* %4
%10 = cmpxchg i8* %7, i8 %8, i8 %9 acq_rel monotonic
%11 = extractvalue { i8, i1 } %10, 0
%12 = extractvalue { i8, i1 } %10, 1
br i1 %12, label %14, label %13
13: ; preds = %1
store i8 %11, i8* %3
br label %14
14: ; preds = %13, %1
%15 = zext i1 %12 to i8
store i8 %15, i8* %5
%16 = load i8, i8* %5
%17 = trunc i8 %16 to i1
%18 = zext i1 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @test_170_6(i8* nocapture %0) {
%2 = cmpxchg i8* %0, i8 1, i8 5 acq_rel monotonic
%3 = extractvalue { i8, i1 } %2, 1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
long a_cas(void volatile *, long, long);
long a_cas_l(volatile void *p, long t, long s) { return a_cas(p, t, s); }


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

x86 assembly (clang, -O2):
<a_cas_l>:
jmp    1030 <a_cas@plt>

LLVM IR (-O0):
define i64 @a_cas_l(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @a_cas(i8* %7, i64 %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @a_cas_l(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @a_cas(i8* %0, i64 %1, i64 %2)
ret i64 %4
}
void fix_readonly_fs(void) {}


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

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

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

LLVM IR (-O2):
define void @fix_readonly_fs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(void *, int, int);
void cleanup(void *var, int len) {
  memset(var, 0x00, len);
  free(var);
}


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

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @cleanup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @memset(i8* %5, i32 0, i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @cleanup(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int fetestexcept(int excepts) {
  int cw;
  _FPU_GETCW(cw);
  return cw & excepts & FE_ALL_EXCEPT;
}


x86 assembly (clang, -O0):
<fetestexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %3
%5 = call i32 @_FPU_GETCW(i32 %4)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %6, %7
%9 = load i32, i32* @FE_ALL_EXCEPT
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EPblib_initArray();
int /*<<< orphan*/ EPblib_initBase();
int /*<<< orphan*/ EPblib_initIO();
int /*<<< orphan*/ EPblib_initMath();
int /*<<< orphan*/ EPblib_initString();
int /*<<< orphan*/ EPblib_initSystem();
void EPblib_init() {
  EPblib_initBase();
  EPblib_initMath();
  EPblib_initString();
  EPblib_initArray();
  EPblib_initIO();
  EPblib_initSystem();
}


x86 assembly (clang, -O0):
<EPblib_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <EPblib_initBase@plt>
mov    $0x0,%al
call   1040 <EPblib_initMath@plt>
mov    $0x0,%al
call   1080 <EPblib_initString@plt>
mov    $0x0,%al
call   1070 <EPblib_initArray@plt>
mov    $0x0,%al
call   1050 <EPblib_initIO@plt>
mov    $0x0,%al
call   1030 <EPblib_initSystem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPblib_init>:
push   %rax
xor    %eax,%eax
call   1060 <EPblib_initBase@plt>
xor    %eax,%eax
call   1040 <EPblib_initMath@plt>
xor    %eax,%eax
call   1080 <EPblib_initString@plt>
xor    %eax,%eax
call   1070 <EPblib_initArray@plt>
xor    %eax,%eax
call   1050 <EPblib_initIO@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <EPblib_initSystem@plt>

LLVM IR (-O0):
define void @EPblib_init() {
%1 = call i32 (...) @EPblib_initBase()
%2 = call i32 (...) @EPblib_initMath()
%3 = call i32 (...) @EPblib_initString()
%4 = call i32 (...) @EPblib_initArray()
%5 = call i32 (...) @EPblib_initIO()
%6 = call i32 (...) @EPblib_initSystem()
ret void
}

LLVM IR (-O2):
define void @EPblib_init() {
%1 = tail call i32 (...) @EPblib_initBase()
%2 = tail call i32 (...) @EPblib_initMath()
%3 = tail call i32 (...) @EPblib_initString()
%4 = tail call i32 (...) @EPblib_initArray()
%5 = tail call i32 (...) @EPblib_initIO()
%6 = tail call i32 (...) @EPblib_initSystem()
ret void
}
/* Variables and functions */
char *getenv(char *);
char *cgiUserAgent() { return getenv("HTTP_USER_AGENT"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"HTTP_USER_AGENT\00"
define i8* @cgiUserAgent() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"HTTP_USER_AGENT\00"
define i8* @cgiUserAgent() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
void *i(size_t);
void *r(size_t n) { return i(n); }


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

x86 assembly (clang, -O2):
<r>:
jmp    1030 <i@plt>

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

LLVM IR (-O2):
define i8* @r(i64 %0) {
%2 = tail call i8* @i(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_ne(uint32_t a, uint32_t b) { return a != b; }


x86 assembly (clang, -O0):
<op_ne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ne>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @op_ne(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_ne(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "cp"
        " [-fip] source_file target_file\n       "
        "cp"
        " [-fip] source_file ... target\n       "
        "cp"
        " -R [-H | -L | -P][-fip] source_file ... target\n       "
        "cp"
        " -r [-H | -L | -P][-fip] source_file ... target\n  -f	Attempt to "
        "remove destination file before a copy if necessary\n  -i	Prompt "
        "before a copy to an existing file\n  -p	Duplicate "
        "characteristics of the source files\n  -R	Copy file "
        "hierarchies\n  -r	Copy file hierarchies\n",
        stderr);
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [414 x i8] c"Usage: cp [-fip] source_file target_file\0A cp [-fip] source_file ... target\0A cp -R [-H | -L | -P][-fip] source_file ... target\0A cp -r [-H | -L | -P][-fip] source_file ... target\0A -f\09Attempt to remove destination file before a copy if necessary\0A -i\09Prompt before a copy to an existing file\0A -p\09Duplicate characteristics of the source files\0A -R\09Copy file hierarchies\0A -r\09Copy file hierarchies\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([414 x i8], [414 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [414 x i8] c"Usage: cp [-fip] source_file target_file\0A cp [-fip] source_file ... target\0A cp -R [-H | -L | -P][-fip] source_file ... target\0A cp -r [-H | -L | -P][-fip] source_file ... target\0A -f\09Attempt to remove destination file before a copy if necessary\0A -i\09Prompt before a copy to an existing file\0A -p\09Duplicate characteristics of the source files\0A -R\09Copy file hierarchies\0A -r\09Copy file hierarchies\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([414 x i8], [414 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void sig(int sig) {
  fprintf(stderr, "caught signal %i\n", sig);
  exit(1);
}


x86 assembly (clang, -O0):
<sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"caught signal %i\0A\00"
define void @sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"caught signal %i\0A\00"
define void @sig(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void appendExtToFile(char *dest, char *source, char *ext) {
  strcat(dest, source);
  strcat(dest, ext);
}


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

x86 assembly (clang, -O2):
<appendExtToFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define void @appendExtToFile(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcat(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
int TXboxAdpcmDecoder_guess_output_size(int SourceSize) {
  return ((SourceSize / 36) * 130);
}


x86 assembly (clang, -O0):
<TXboxAdpcmDecoder_guess_output_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
imul   $0x82,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TXboxAdpcmDecoder_guess_output_size>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x7,%ecx
lea    (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @TXboxAdpcmDecoder_guess_output_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 36
%5 = mul nsw i32 %4, 130
ret i32 %5
}

LLVM IR (-O2):
define i32 @TXboxAdpcmDecoder_guess_output_size(i32 %0) {
%2 = sdiv i32 %0, 36
%3 = mul nsw i32 %2, 130
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void set_sclk(uint32_t sclk) {
  if (sclk == 0) {
    (*((volatile uint32_t *)0xE0200C04)) &= ~(0x02);
  } else {
    (*((volatile uint32_t *)0xE0200C04)) |= 0x02;
  }
}


x86 assembly (clang, -O0):
<set_sclk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <set_sclk+0x2c>
mov    $0xe0200c04,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0xe0200c04,%eax
mov    %rcx,(%rax)
jmp    1140 <set_sclk+0x40>
mov    $0xe0200c04,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0xe0200c04,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sclk>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    $0xe0200c04,%ecx
mov    (%rcx),%rdx
and    $0xfffffffffffffffd,%rdx
lea    (%rdx,%rax,2),%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @set_sclk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%7 = and i64 %6, -3
store volatile i64 %7, i64* inttoptr (i64 3760196612 to i64*)
br label %11
8: ; preds = %1
%9 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%10 = or i64 %9, 2
store volatile i64 %10, i64* inttoptr (i64 3760196612 to i64*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @set_sclk(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%4 = and i64 %3, -3
%5 = select i1 %2, i64 0, i64 2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3760196612 to i64*)
ret void
}
int foo8() { return 8; }


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

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

LLVM IR (-O0):
define i32 @foo8() {
ret i32 8
}

LLVM IR (-O2):
define i32 @foo8() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ bitmap_size(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int /*<<< orphan*/);
void bitmap_clear(void *addr, int nr_bits) {
  memset(addr, 0, bitmap_size(nr_bits));
}


x86 assembly (clang, -O0):
<bitmap_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <bitmap_size@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_clear>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <bitmap_size@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bitmap_clear(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @bitmap_size(i32 %6)
%8 = call i32 @memset(i8* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @bitmap_clear(i8* %0, i32 %1) {
%3 = tail call i32 @bitmap_size(i32 %1)
%4 = tail call i32 @memset(i8* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_new_signal(void *bus, void **m, const char *path,
                          const char *interface, const char *member) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_new_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_new_signal>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_new_signal(i8* %0, i8** %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_new_signal(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ uuid2str(unsigned char *, char *, int);
const char *prl_uuid2str(unsigned char *in, char *out, int len) {
  assert(!(len < 39));
  out[0] = '{';
  uuid2str(in, out + 1, len - 2);
  out[37] = '}';
  out[38] = '\0';
  return out;
}


x86 assembly (clang, -O0):
<prl_uuid2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x27,-0x14(%rbp)
setl   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movb   $0x7b,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
sub    $0x2,%edx
call   1040 <uuid2str@plt>
mov    -0x10(%rbp),%rax
movb   $0x7d,0x25(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x26(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prl_uuid2str>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x27,%edx
setge  %dil
call   1030 <assert@plt>
movb   $0x7b,(%r14)
lea    0x1(%r14),%rsi
add    $0xfffffffe,%ebx
mov    %r15,%rdi
mov    %ebx,%edx
call   1040 <uuid2str@plt>
movw   $0x7d,0x25(%r14)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @prl_uuid2str(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 39
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 123, i8* %13
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i32, i32* %6
%18 = sub nsw i32 %17, 2
%19 = call i32 @uuid2str(i8* %14, i8* %16, i32 %18)
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 37
store i8 125, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 38
store i8 0, i8* %23
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @prl_uuid2str(i8* %0, i8* returned %1, i32 %2) {
%4 = icmp sgt i32 %2, 38
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
store i8 123, i8* %1
%7 = getelementptr inbounds i8, i8* %1, i64 1
%8 = add nsw i32 %2, -2
%9 = tail call i32 @uuid2str(i8* %0, i8* %7, i32 %8)
%10 = getelementptr inbounds i8, i8* %1, i64 37
store i8 125, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 38
store i8 0, i8* %11
ret i8* %1
}
/* Variables and functions */
double acos(double);
double Func_Acos(double *oplist, unsigned int numops) {
  return acos(oplist[0]);
}


x86 assembly (clang, -O0):
<Func_Acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Func_Acos>:
movsd  (%rdi),%xmm0
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @Func_Acos(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = call double @acos(double %7)
ret double %8
}

LLVM IR (-O2):
define double @Func_Acos(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
%4 = tail call double @acos(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x6f() {
  Assert_real((isbdigit(111) == 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_isbdigit.c",
              560, ("isbdigit should be 0 for o"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x6f>:
push   %rax
mov    $0x6f,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x230,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for o\00"
define void @t_isbdigit_0x6f() {
%1 = call i64 @isbdigit(i32 111)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for o\00"
define void @t_isbdigit_0x6f() {
%1 = tail call i64 @isbdigit(i32 111)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ send_msg();
void sig_alrm(int signo) {
  send_msg();
  alarm(1);
}


x86 assembly (clang, -O0):
<sig_alrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <send_msg@plt>
mov    $0x1,%edi
call   1030 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alrm>:
push   %rax
xor    %eax,%eax
call   1040 <send_msg@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <alarm@plt>

LLVM IR (-O0):
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @send_msg()
%4 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
define void @sig_alrm(i32 %0) {
%2 = tail call i32 (...) @send_msg()
%3 = tail call i32 @alarm(i32 1)
ret void
}
int test_imm_ADuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xAD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ADuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 173
%7 = icmp ne i64 %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_ADuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11337728
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int i = 0;
#pragma omp parallel shared(i)
  {
#pragma omp single
    { i++; }
  }
  if (i != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1140 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Faculty of Engineering,\n   Hiroshima University\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Faculty of Engineering,\0A Hiroshima University\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"Faculty of Engineering,\0A Hiroshima University\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Direct(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op85M1(void) { STA8(Direct(2)); }


x86 assembly (clang, -O0):
<Op85M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op85M1>:
push   %rax
mov    $0x2,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op85M1() {
%1 = call i32 @Direct(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op85M1() {
%1 = tail call i32 @Direct(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int UTF8_char_len(unsigned char);
size_t UTF8_strlen(const char *str) {
  size_t result = 0;
  while (str[0] != '\0') {
    const int n = UTF8_char_len((unsigned char)*str);
    str += n;
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<UTF8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <UTF8_strlen+0x55>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <UTF8_char_len@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <UTF8_strlen+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8_strlen>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113d <UTF8_strlen+0x2d>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movzbl %al,%edi
call   1030 <UTF8_char_len@plt>
movslq %eax,%rcx
movzbl (%r14,%rcx,1),%eax
add    %rcx,%r14
add    $0x1,%rbx
test   %al,%al
jne    1120 <UTF8_strlen+0x10>
jmp    113f <UTF8_strlen+0x2f>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @UTF8_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = tail call i32 @UTF8_char_len(i8 zeroext %5)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = add i64 %7, 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
int parity_letter(char c) {
  switch (c) {
  case 'N':
  case 'n':
    return 0;
  case 'O':
  case 'o':
    return 1;
  case 'E':
  case 'e':
    return 2;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<parity_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x45,%eax
je     118c <parity_letter+0x8c>
jmp    111f <parity_letter+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x4e,%eax
je     1174 <parity_letter+0x74>
jmp    1130 <parity_letter+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4f,%eax
je     1180 <parity_letter+0x80>
jmp    1141 <parity_letter+0x41>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     118c <parity_letter+0x8c>
jmp    1152 <parity_letter+0x52>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     1174 <parity_letter+0x74>
jmp    1163 <parity_letter+0x63>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     1180 <parity_letter+0x80>
jmp    1198 <parity_letter+0x98>
movl   $0x0,-0x4(%rbp)
jmp    119f <parity_letter+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    119f <parity_letter+0x9f>
movl   $0x2,-0x4(%rbp)
jmp    119f <parity_letter+0x9f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity_letter>:
add    $0xffffffbb,%edi
cmp    $0x2a,%edi
ja     1146 <parity_letter+0x46>
movabs $0x100000001,%rax
bt     %rdi,%rax
jb     1140 <parity_letter+0x40>
xor    %eax,%eax
movabs $0x20000000200,%rcx
bt     %rdi,%rcx
jb     114b <parity_letter+0x4b>
movabs $0x40000000400,%rax
bt     %rdi,%rax
jae    1146 <parity_letter+0x46>
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @parity_letter(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 78, label %6
i32 110, label %6
i32 79, label %7
i32 111, label %7
i32 69, label %8
i32 101, label %8
]
6: ; preds = %1, %1
store i32 0, i32* %2
br label %10
7: ; preds = %1, %1
store i32 1, i32* %2
br label %10
8: ; preds = %1, %1
store i32 2, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @parity_letter(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 78, label %6
i32 110, label %6
i32 79, label %3
i32 111, label %3
i32 69, label %4
i32 101, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3
%7 = phi i32 [ -1, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int tidy_ok(char const *, char const *, char *);
int tidy_nop_ok(const char *inout) {
  return tidy_ok(inout, inout, "tidy is nop");
}


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

x86 assembly (clang, -O2):
<tidy_nop_ok>:
lea    0xee9(%rip),%rdx
mov    %rdi,%rsi
jmp    1030 <tidy_ok@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"tidy is nop\00"
define i32 @tidy_nop_ok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @tidy_ok(i8* %3, i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@.str = [12 x i8] c"tidy is nop\00"
define i32 @tidy_nop_ok(i8* %0) {
%2 = tail call i32 @tidy_ok(i8* %0, i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int bits;

/* Variables and functions */
int UINTMAX_C(int);
unsigned bit_mask_nz(unsigned bits) {
  return (UINTMAX_C(1) << ((bits)-1) << 1) - 1;
}


x86 assembly (clang, -O0):
<bit_mask_nz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <UINTMAX_C@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
shl    $0x1,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_mask_nz>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <UINTMAX_C@plt>
add    $0xff,%bl
mov    %ebx,%ecx
shl    %cl,%eax
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bit_mask_nz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @UINTMAX_C(i32 1)
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = shl i32 %3, %5
%7 = shl i32 %6, 1
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_mask_nz(i32 %0) {
%2 = tail call i32 @UINTMAX_C(i32 1)
%3 = add i32 %0, -1
%4 = shl i32 %2, %3
%5 = shl i32 %4, 1
%6 = add nsw i32 %5, -1
ret i32 %6
}
void d2i_ASN1_BOOLEAN(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_BOOLEAN() {
ret void
}
/* Variables and functions */
bool nrf53_errata_29(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_29() {
ret i32 0
}
int emptyTest(int n) {
  if (n == 10)
    ;
}


x86 assembly (clang, -O0):
<emptyTest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1116 <emptyTest+0x16>
jmp    1116 <emptyTest+0x16>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @emptyTest(i32 %0) {
ret i32 undef
}
void InitSPI() {
  (*(char *)0x5200) = 0x54;
  (*(char *)0x5201) = 0x03;
}


x86 assembly (clang, -O0):
<InitSPI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5200,%eax
movb   $0x54,(%rax)
mov    $0x5201,%eax
movb   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitSPI>:
movb   $0x54,0x5200
54
movb   $0x3,0x5201
03
ret

LLVM IR (-O0):
define void @InitSPI() {
store i8 84, i8* inttoptr (i64 20992 to i8*)
store i8 3, i8* inttoptr (i64 20993 to i8*)
ret void
}

LLVM IR (-O2):
define void @InitSPI() {
store i8 84, i8* inttoptr (i64 20992 to i8*)
store i8 3, i8* inttoptr (i64 20993 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shu(int, int *);
int main(int argc, const char *argv[]) {
  int array[13];
  shu(11, array);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    %rsp,%rsi
mov    $0xb,%edi
call   1030 <shu@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [13 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 0
%8 = call i32 @shu(i32 11, i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [13 x i32]
%4 = bitcast [13 x i32]* %3 to i8*
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 0
%6 = call i32 @shu(i32 11, i32* %5)
ret i32 0
}
/* Type definitions */
struct ticks {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ticks *);
void ticks_finish(struct ticks *tc) { free(tc); }


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

x86 assembly (clang, -O2):
<ticks_finish>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ticks = type { i32 }
define void @ticks_finish(%struct.ticks* nocapture %0) {
%2 = tail call i32 @free(%struct.ticks* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void endlessWait() {
  while (1) {
    sleep(100);
  }
}


x86 assembly (clang, -O0):
<endlessWait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <endlessWait+0x9>
mov    $0x64,%edi
call   1030 <sleep@plt>
jmp    1119 <endlessWait+0x9>

x86 assembly (clang, -O2):
<endlessWait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <sleep@plt>
jmp    1120 <endlessWait+0x10>

LLVM IR (-O0):
define void @endlessWait() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 100)
br label %1
}

LLVM IR (-O2):
define void @endlessWait() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 100)
br label %1
}