xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ write(int, char *, int);
void die(char *msg, int code) {
  syslog(LOG_NOTICE, "(%u) %s", code, msg);
  write(1, "?", 1);
  _exit(code);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x1,%edx
lea    0xea1(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    -0xc(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %ebx,%edx
call   1050 <syslog@plt>
lea    0xeb4(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [8 x i8] c"(%u) %s\00"
@.str.1 = [2 x i8] c"?\00"
define void @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @LOG_NOTICE
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = load i32, i32* %4
%11 = call i32 @_exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [8 x i8] c"(%u) %s\00"
@.str.1 = [2 x i8] c"?\00"
define void @die(i8* %0, i32 %1) {
%3 = load i32, i32* @LOG_NOTICE
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 @_exit(i32 %1)
unreachable
}
int main(int argc, char **argv) {
  int *iptr;
  char *cptr;
  __asm__("pushf\norl $0x40000,(%rsp)\npopf");
  cptr = malloc(sizeof(int) + 1);
  iptr = (int *)++cptr;
  *iptr = 42;
  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)
pushf
orl    $0x40000,(%rsp)
popf
mov    $0x5,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x2a,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
pushf
orl    $0x40000,(%rsp)
popf
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @malloc(i64 5)
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %7
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %6
%12 = load i32*, i32** %6
store i32 42, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "pushf\0Aorl $$0x40000,(%rsp)\0Apopf", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void gart_iommu_hole_init(void) {}


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

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

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

LLVM IR (-O2):
define void @gart_iommu_hole_init() {
ret void
}
int foo_linear(int *b) { return *b + 1; }


x86 assembly (clang, -O0):
<foo_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo_linear(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ print_string(char const *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  const char *my_str = "the brown fox jumps over the lazy dog.";
  print_string(my_str);
  int i = 3, j = 4;
  printf("%d + %d = %d\n", i, j, add(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <print_string@plt>
movl   $0x3,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <add@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <print_string@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <add@plt>
lea    0xed4(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"the brown fox jumps over the lazy dog.\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @print_string(i8* %9)
store i32 3, i32* %7
store i32 4, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @add(i32 %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"the brown fox jumps over the lazy dog.\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @add(i32 3, i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 4, i32 %4)
ret i32 0
}
int ppc_cannot_fetch_register(int regno) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ppc_cannot_fetch_register(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *int_to_base64(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char const *);
char *make_ext_salt_para(int rounds, const char *saltpara) {
  static char salt[10];
  sprintf(salt, "_%s%s", int_to_base64(rounds), saltpara);
  return salt;
}


x86 assembly (clang, -O0):
<make_ext_salt_para>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <int_to_base64@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0x2eec(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ed9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ext_salt_para>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <int_to_base64@plt>
lea    0x2efe(%rip),%r14
lea    0xec6(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@make_ext_salt_para.salt = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"_%s%s\00"
define i8* @make_ext_salt_para(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i8* @int_to_base64(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0)
}

LLVM IR (-O2):
@make_ext_salt_para.salt = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"_%s%s\00"
define i8* @make_ext_salt_para(i32 %0, i8* %1) {
%3 = tail call i8* @int_to_base64(i32 %0)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0)
}
short int func2(short int a, unsigned int b) { return !b ? a : a >> b; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <func2+0x24>
movswl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <func2+0x30>
movswl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define signext i16 @func2(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
br label %15
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
br label %15
15: ; preds = %10, %7
%16 = phi i32 [ %9, %7 ], [ %14, %10 ]
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @func2(i16 signext %0, i32 %1) {
%3 = sext i16 %0 to i32
%4 = ashr i32 %3, %1
%5 = trunc i32 %4 to i16
ret i16 %5
}
void RTAvlroGCPtrRangeRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrRangeRemove() {
ret void
}
/* Variables and functions */
size_t calculateIndex(size_t bucketCount, int hash) {
  return ((size_t)hash) % (bucketCount);
}


x86 assembly (clang, -O0):
<calculateIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateIndex>:
movslq %esi,%rax
mov    %rax,%rcx
or     %rdi,%rcx
shr    $0x20,%rcx
je     1118 <calculateIndex+0x18>
xor    %edx,%edx
div    %rdi
mov    %rdx,%rax
ret
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @calculateIndex(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = load i64, i64* %3
%8 = urem i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @calculateIndex(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = urem i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int closedev(int fd) {
  int rval;
  rval = close(fd);
  if (rval == -1) {
    perror("close");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<closedev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1158 <closedev+0x38>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <closedev+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closedev>:
push   %rax
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <closedev+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define i32 @closedev(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
void gspir_(scan_no, feed_no, phase_no, rec_no, record,
            return_code) int *scan_no,
    phase_no, rec_no;
int *feed_no;
float *record;
int *return_code;
{}


x86 assembly (clang, -O0):
<gspir_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gspir_(i32* %0, i32* %1, i32 %2, i32 %3, float* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store float* %4, float** %11
store i32* %5, i32** %12
ret void
}

LLVM IR (-O2):
define void @gspir_(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3, float* nocapture %4, i32* nocapture %5) {
ret void
}
/* Variables and functions */
unsigned char *blowfish448ecb_encrypt(unsigned char *, size_t *,
                                      unsigned char const *, size_t,
                                      unsigned char const *,
                                      unsigned char const *);
unsigned char *crypt_encrypt_blowfish448ecb(unsigned char *out, size_t *out_len,
                                            const unsigned char *in,
                                            size_t in_len,
                                            const unsigned char *nonce,
                                            const unsigned char *key) {
  return blowfish448ecb_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_blowfish448ecb>:
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    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <blowfish448ecb_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_blowfish448ecb>:
jmp    1030 <blowfish448ecb_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_blowfish448ecb(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @blowfish448ecb_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_blowfish448ecb(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @blowfish448ecb_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Type definitions */
struct bt431_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bt431_write_reg(struct bt431_regs *, int, int);
void bt431_erase_cursor(struct bt431_regs *regs) {
  bt431_write_reg(regs, 0x0000, 0x04);
}


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

x86 assembly (clang, -O2):
<bt431_erase_cursor>:
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <bt431_write_reg@plt>

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

LLVM IR (-O2):
%struct.bt431_regs = type { i32 }
define void @bt431_erase_cursor(%struct.bt431_regs* %0) {
%2 = tail call i32 @bt431_write_reg(%struct.bt431_regs* %0, i32 0, i32 4)
ret void
}
void io_footprint_end(void) { return; }


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

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

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

LLVM IR (-O2):
define void @io_footprint_end() {
ret void
}
__typeof__(vfprintf(1, "")) test_vfprintf_265(void) { return vfprintf(1, ""); }


x86 assembly (clang, -O0):
<test_vfprintf_265>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <vfprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfprintf_265>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_vfprintf_265() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfprintf to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_vfprintf_265() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfprintf to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
main() { return -1 >> 1 == -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%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
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void rootshell() { system("/bin/sh"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define void @rootshell() {
%1 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @rootshell() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_32uint16_mem(unsigned short *val) {
  return ((*val) & (-0x32 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_32uint16_mem>:
movzwl (%rdi),%eax
test   $0xffce,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_32uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -50
%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_32uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -50
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int yywrap() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 0
}
unsigned xrop3_198_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_198_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_198_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
xor    %esi,%ecx
xor    $0xff,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_198_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_198_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %5
%8 = xor i32 %7, 255
%9 = or i32 %6, %4
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = or i8 %1, %0
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
char *getmem(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int strlen(char *);
char *make_ident(char *name, unsigned u) {
  size_t n = strlen(name) + 1;
  char *ident = getmem(n + sizeof(unsigned));
  *(unsigned *)ident = u & ~1U;
  memcpy(ident + sizeof(unsigned), name, n);
  return ident;
}


x86 assembly (clang, -O0):
<make_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
call   1050 <getmem@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xfffffffe,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ident>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rdi
lea    0x1(%rdi),%r15
add    $0x5,%rdi
call   1050 <getmem@plt>
mov    %rax,%rbx
and    $0xfffffffe,%ebp
mov    %ebp,(%rax)
lea    0x4(%rax),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @make_ident(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = add i64 %11, 4
%13 = call i8* @getmem(i64 %12)
store i8* %13, i8** %6
%14 = load i32, i32* %4
%15 = and i32 %14, -2
%16 = load i8*, i8** %6
%17 = bitcast i8* %16 to i32*
store i32 %15, i32* %17
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 4
%20 = load i8*, i8** %3
%21 = load i64, i64* %5
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
define i8* @make_ident(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, 4
%7 = tail call i8* @getmem(i64 %6)
%8 = and i32 %1, -2
%9 = bitcast i8* %7 to i32*
store i32 %8, i32* %9
%10 = getelementptr inbounds i8, i8* %7, i64 4
%11 = tail call i32 @memcpy(i8* %10, i8* %0, i64 %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ terminal_initialize();
int /*<<< orphan*/ terminal_writestring(char *);
void startdisplay() {
  terminal_initialize();
  terminal_writestring("Welcome to Obsidian\n");
}


x86 assembly (clang, -O0):
<startdisplay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <terminal_initialize@plt>
lea    0xece(%rip),%rdi
call   1030 <terminal_writestring@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startdisplay>:
push   %rax
xor    %eax,%eax
call   1040 <terminal_initialize@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <terminal_writestring@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Welcome to Obsidian\0A\00"
define void @startdisplay() {
%1 = call i32 (...) @terminal_initialize()
%2 = call i32 @terminal_writestring(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Welcome to Obsidian\0A\00"
define void @startdisplay() {
%1 = tail call i32 (...) @terminal_initialize()
%2 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ giterr_set_oom();
void *malloc(size_t);
void *git__malloc(size_t len) {
  void *ptr = malloc(len);
  if (!ptr)
    giterr_set_oom();
  return ptr;
}


x86 assembly (clang, -O0):
<git__malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <git__malloc+0x2b>
mov    $0x0,%al
call   1030 <giterr_set_oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <git__malloc+0x15>
xor    %eax,%eax
call   1030 <giterr_set_oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @git__malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @giterr_set_oom()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @git__malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @giterr_set_oom()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void iface1_ver1_destructor(void *context) {
  printf("A - version 1 destructor context %p\n", context);
}


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

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

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

LLVM IR (-O2):
@.str = [37 x i8] c"A - version 1 destructor context %p\0A\00"
define void @iface1_ver1_destructor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
yyPrintOpaque(i) long i;
{ printf("<<%d>>", i); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"<<%d>>\00"
define i32 @yyPrintOpaque(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"<<%d>>\00"
define i32 @yyPrintOpaque(i64 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
/* Variables and functions */
double dcn_bw_fabs(double a) {
  if (a > 0)
    return (a);
  else
    return (-a);
}


x86 assembly (clang, -O0):
<dcn_bw_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <dcn_bw_fabs+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <dcn_bw_fabs+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcn_bw_fabs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dcn_bw_fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @dcn_bw_fabs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ _actionlist(char const **);
int /*<<< orphan*/ _wholist(char const **);
void _clause(char const **mode) {
  char c = **mode;
  if (c == 'u' || c == 'g' || c == 'o' || c == 'a')
    _wholist(mode);
  _actionlist(mode);
}


x86 assembly (clang, -O0):
<_clause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x75,%eax
je     116c <_clause+0x4c>
movsbl -0x9(%rbp),%eax
cmp    $0x67,%eax
je     116c <_clause+0x4c>
movsbl -0x9(%rbp),%eax
cmp    $0x6f,%eax
je     116c <_clause+0x4c>
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jne    1175 <_clause+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <_wholist@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_actionlist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clause>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%al
add    $0x9f,%al
cmp    $0x14,%al
ja     1145 <_clause+0x25>
movzbl %al,%eax
mov    $0x104041,%ecx
bt     %rax,%rcx
jae    1145 <_clause+0x25>
mov    %rbx,%rdi
call   1040 <_wholist@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <_actionlist@plt>

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

LLVM IR (-O2):
define void @_clause(i8** %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
switch i8 %3, label %6 [
i8 117, label %4
i8 111, label %4
i8 103, label %4
i8 97, label %4
]
4: ; preds = %1, %1, %1, %1
%5 = tail call i32 @_wholist(i8** %0)
br label %6
6: ; preds = %1, %4
%7 = tail call i32 @_actionlist(i8** %0)
ret void
}
int main(void) {
  char *argv[] = {"ls", "-al", "/etc/passwd", '\0'};
  execv("/bin/ls", argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cd4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xede(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-al\00"
@.str.2 = [12 x i8] c"/etc/passwd\00"
@__const.main.argv = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [8 x i8] c"/bin/ls\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
store i32 0, i32* %1
%3 = bitcast [4 x i8*]* %2 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execv to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-al\00"
@.str.2 = [12 x i8] c"/etc/passwd\00"
@__const.main.argv = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [8 x i8] c"/bin/ls\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execv to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *cJSON_strdup(const char *str) {
  size_t len;
  char *copy;
  len = strlen(str) + 1;
  if (!(copy = (char *)malloc(len)))
    return 0;
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<cJSON_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <cJSON_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <cJSON_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1163 <cJSON_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <cJSON_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @cJSON_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
int arr_equal(int *a, int *b, int num_elem) {
  for (int i = 0; i < num_elem; i++) {
    if (a[i] != b[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<arr_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <arr_equal+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <arr_equal+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <arr_equal+0x64>
jmp    114f <arr_equal+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <arr_equal+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_equal>:
test   %edx,%edx
jle    113d <arr_equal+0x3d>
mov    (%rdi),%ecx
mov    $0x1,%eax
cmp    (%rsi),%ecx
jne    113c <arr_equal+0x3c>
mov    %edx,%r8d
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdx
cmp    %rax,%r8
je     1134 <arr_equal+0x34>
mov    (%rdi,%rdx,4),%ecx
lea    0x1(%rdx),%rax
cmp    (%rsi,%rdx,4),%ecx
je     1120 <arr_equal+0x20>
xor    %eax,%eax
cmp    %r8,%rdx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @arr_equal(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %5, %14
%12 = phi i64 [ %20, %14 ], [ 1, %5 ]
%13 = icmp eq i64 %12, %7
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = getelementptr inbounds i32, i32* %0, i64 %12
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %1, i64 %12
%18 = load i32, i32* %17
%19 = icmp eq i32 %16, %18
%20 = add nuw nsw i64 %12, 1
br i1 %19, label %11, label %21
21: ; preds = %11, %14
%22 = icmp ult i64 %12, %6
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %21, %5, %3
%25 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %23, %21 ]
ret i32 %25
}
/* Variables and functions */
int /*<<< orphan*/ getNoKill();
int /*<<< orphan*/ shutDown(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ termReset();
void sigintHandler(int signum) {
  termReset();
  shutDown(getNoKill(), 1, 0);
}


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <termReset@plt>
mov    $0x0,%al
call   1030 <getNoKill@plt>
mov    %eax,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <shutDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigintHandler>:
push   %rax
xor    %eax,%eax
call   1050 <termReset@plt>
xor    %eax,%eax
call   1030 <getNoKill@plt>
mov    %eax,%edi
mov    $0x1,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <shutDown@plt>

LLVM IR (-O0):
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @termReset()
%4 = call i32 (...) @getNoKill()
%5 = call i32 @shutDown(i32 %4, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @sigintHandler(i32 %0) {
%2 = tail call i32 (...) @termReset()
%3 = tail call i32 (...) @getNoKill()
%4 = tail call i32 @shutDown(i32 %3, i32 1, i32 0)
ret void
}
int test_imm_FCuint16_reg(unsigned short val) {
  return ((val) & (-0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff04,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_FCuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -252
%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_FCuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -252
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned long xt_core_hash_sdbm(char *string) {
  assert(string);
  unsigned long hash;
  int c;
  hash = 0;
  while ((c = *string++)) {
    hash = c + (hash << 6) + (hash << 16) - hash;
  }
  return hash;
}


x86 assembly (clang, -O0):
<xt_core_hash_sdbm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1172 <xt_core_hash_sdbm+0x62>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112d <xt_core_hash_sdbm+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_hash_sdbm>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     114b <xt_core_hash_sdbm+0x3b>
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <xt_core_hash_sdbm+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @xt_core_hash_sdbm(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %3, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = phi i64 [ %12, %5 ], [ 0, %1 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %6 to i64
%11 = mul i64 %8, 65599
%12 = add i64 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i64 [ 0, %1 ], [ %12, %5 ]
ret i64 %16
}