xunge/DecIR huggingface dataset:
void rop3_138_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_138_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_138_0_0>:
not    %dl
or     %sil,%dl
and    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_138_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_138_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = or i8 %4, %1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *);
void write_external_string(char *string, size_t maxLength) {
  snprintf(string, maxLength, "Set from C");
}


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

x86 assembly (clang, -O2):
<write_external_string>:
lea    0xee9(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Set from C\00"
define void @write_external_string(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @snprintf(i8* %5, i64 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Set from C\00"
define void @write_external_string(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ G_fatal_error(int /*<<< orphan*/);
int /*<<< orphan*/ N_(char *);
int /*<<< orphan*/ _(char *);
int /*<<< orphan*/ xx(char *);
void main() {
  if (1 == 1) {
    G_fatal_error(xx("A big long string that is treated as a function argument "
                     "ends up breaking away from its function name."));
  } else if (2 == 2) {
    G_fatal_error(_("When the big long string is in the _() from gettext, "
                    "however, it's better to treat the _ as a string delimiter "
                    "rather than a function name."));
  } else {
    G_fatal_error(N_("When the big long string is in the N_() from gettext, "
                     "however, it's better to treat the N_ as a string "
                     "delimiter rather than a function name."));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <xx@plt>
mov    %eax,%edi
call   1030 <G_fatal_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <xx@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <G_fatal_error@plt>

LLVM IR (-O0):
@.str = [103 x i8] c"A big long string that is treated as a function argument ends up breaking away from its function name.\00"
define void @main() {
%1 = call i32 @xx(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @G_fatal_error(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [103 x i8] c"A big long string that is treated as a function argument ends up breaking away from its function name.\00"
define void @main() {
%1 = tail call i32 @xx(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @G_fatal_error(i32 %1)
ret void
}
void simtec_int_ctrl_setup_defaults() {}


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

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

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

LLVM IR (-O2):
define void @simtec_int_ctrl_setup_defaults() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void qemu_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<qemu_free>:
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):
<qemu_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @qemu_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void *__coverity_alloc__(unsigned long);
void *map_domain_page(unsigned long mfn) { return __coverity_alloc__(4096UL); }


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

x86 assembly (clang, -O2):
<map_domain_page>:
mov    $0x1000,%edi
jmp    1030 <__coverity_alloc__@plt>

LLVM IR (-O0):
define i8* @map_domain_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i8* @__coverity_alloc__(i64 4096)
ret i8* %3
}

LLVM IR (-O2):
define i8* @map_domain_page(i64 %0) {
%2 = tail call i8* @__coverity_alloc__(i64 4096)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int getline(char **lineptr, int *n, void *stream) { abort(); }


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<getline>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @getline(i8** %0, i32* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i8*
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @getline(i8** nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CRT_done();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void CRT_fatalError(const char *note) {
  char *sysMsg = strerror(errno);
  CRT_done();
  fprintf(stderr, "%s: %s\n", note, sysMsg);
  exit(2);
}


x86 assembly (clang, -O0):
<CRT_fatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <CRT_done@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<CRT_fatalError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <CRT_done@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @CRT_fatalError(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = call i32 (...) @CRT_done()
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @CRT_fatalError(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 (...) @CRT_done()
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%7 = tail call i32 @exit(i32 2)
unreachable
}
long monte_dlib_interface_type(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i64 @monte_dlib_interface_type() {
ret i64 1
}
char *num2str(num)
double num;
{
  static char buf[40];
  sprintf(buf, "%f", num);
  return buf;
}


x86 assembly (clang, -O0):
<num2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0x2f17(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x1,%al
call   1030 <sprintf@plt>
lea    0x2f02(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num2str>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@num2str.buf = internal global [40 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @num2str(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @num2str.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %3)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @num2str.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@num2str.buf = internal global [40 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @num2str(double %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @num2str.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @num2str.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ halt();
void _exit(int status) { halt(); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <halt@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
xor    %eax,%eax
call   1030 <halt@plt>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @halt()
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 (...) @halt()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
extern void testptr(void *ptr) {
  if (ptr) {
    puts("Is Not a NULL-ptr");
  } else {
    puts("Is a NULL-ptr");
  }
}


x86 assembly (clang, -O0):
<testptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <testptr+0x28>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
jmp    1144 <testptr+0x34>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testptr>:
test   %rdi,%rdi
lea    0xef8(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Is Not a NULL-ptr\00"
@.str.1 = [14 x i8] c"Is a NULL-ptr\00"
define void @testptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Is Not a NULL-ptr\00"
@.str.1 = [14 x i8] c"Is a NULL-ptr\00"
define void @testptr(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
void EVP_PKEY_get1_RSA(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_get1_RSA() {
ret void
}
int fun1259() { return 1259; }


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

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

LLVM IR (-O0):
define i32 @fun1259() {
ret i32 1259
}

LLVM IR (-O2):
define i32 @fun1259() {
ret i32 1259
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_print_fp(int /*<<< orphan*/, int /*<<< orphan*/ const *);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void showbn(const char *name, const BIGNUM *bn) {
  fputs(name, stdout);
  fputs(" = ", stdout);
  BN_print_fp(stdout, bn);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<showbn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
lea    0xe9e(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1050 <BN_print_fp@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showbn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x2ea2(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xeb2(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1050 <BN_print_fp@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c" = \00"
define void @showbn(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* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = load i32*, i32** %4
%12 = call i32 @BN_print_fp(i32 %10, i32* %11)
%13 = load i32, i32* @stdout
%14 = call i32 @putc(i8 signext 10, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c" = \00"
define void @showbn(i8* %0, i32* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @BN_print_fp(i32 %7, i32* %1)
%9 = load i32, i32* @stdout
%10 = tail call i32 @putc(i8 signext 10, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void XTAL16RDY_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @XTAL16RDY_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @XTAL16RDY_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int setcns(int, int, char *);
int cmd_radio_on(int argc, char **argv) {
  char data[4] = {0x00, 0x01, 0x00, 0x00};
  return setcns(0x1075, 4, data);
}


x86 assembly (clang, -O0):
<cmd_radio_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdx
mov    $0x1075,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_radio_on>:
push   %rax
movl   $0x100,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1075,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.cmd_radio_on.data = [4 x i8] c"\00\01\00\00"
define i32 @cmd_radio_on(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = call i32 @setcns(i32 4213, i32 4, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmd_radio_on(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 256, i32* %3
%5 = call i32 @setcns(i32 4213, i32 4, i8* %4)
ret i32 %5
}
/* Variables and functions */
unsigned int _rotl(unsigned int, int);
unsigned int _rotr(unsigned int value, int shift) {
  int max_bits = sizeof(unsigned int) << 3;
  if (shift < 0)
    return _rotl(value, -shift);
  if (shift > max_bits << 3)
    shift = shift % max_bits;
  return (value >> shift) | (value << (max_bits - shift));
}


x86 assembly (clang, -O0):
<_rotr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1144 <_rotr+0x34>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <_rotl@plt>
mov    %eax,-0x4(%rbp)
jmp    1179 <_rotr+0x69>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
cmp    %ecx,%eax
jle    115f <_rotr+0x4f>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rotr>:
test   %esi,%esi
js     111b <_rotr+0xb>
mov    %esi,%ecx
ror    %cl,%edi
mov    %edi,%eax
ret
neg    %esi
jmp    1030 <_rotl@plt>

LLVM IR (-O0):
define i32 @_rotr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 32, i32* %6
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 0, %11
%13 = call i32 @_rotl(i32 %10, i32 %12)
store i32 %13, i32* %3
br label %33
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = shl i32 %16, 3
%18 = icmp sgt i32 %15, %17
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = srem i32 %20, %21
store i32 %22, i32* %5
br label %23
23: ; preds = %19, %14
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = lshr i32 %24, %25
%27 = load i32, i32* %4
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = sub nsw i32 %28, %29
%31 = shl i32 %27, %30
%32 = or i32 %26, %31
store i32 %32, i32* %3
br label %33
33: ; preds = %23, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @_rotr(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = tail call i32 @_rotl(i32 %0, i32 %5)
br label %15
7: ; preds = %2
%8 = icmp ugt i32 %1, 256
%9 = and i32 %1, 31
%10 = select i1 %8, i32 %9, i32 %1
%11 = lshr i32 %0, %10
%12 = sub nsw i32 32, %10
%13 = shl i32 %0, %12
%14 = or i32 %13, %11
br label %15
15: ; preds = %7, %4
%16 = phi i32 [ %6, %4 ], [ %14, %7 ]
ret i32 %16
}
int blStrCmp(const char *mem1, const char *mem2) {
  int rVal;
  asm("0:\n"
      "\tlodsb\n"
      "\tscasb\n"
      "\tjne 1f\n"
      "\tor %%al, %%al\n"
      "\tjnz 0b\n"
      "\txor %%eax, %%eax\n"
      "\tjmp 2f\n"
      "1:\n"
      "\tlahf\n"
      "\tmovsx %%ah, %%eax\n"
      "\tsar $6, %%eax\n"
      "\txor $1, %%eax\n"
      "2:\n"
      "\tnop"
      : "=a"(rVal)
      : "S"(mem1), "D"(mem2));
  return rVal;
}


x86 assembly (clang, -O0):
<blStrCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <blStrCmp+0x2b>
or     %al,%al
jne    1114 <blStrCmp+0x14>
xor    %eax,%eax
jmp    1135 <blStrCmp+0x35>
lahf
movsbl %ah,%eax
sar    $0x6,%eax
xor    $0x1,%eax
nop
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blStrCmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <blStrCmp+0x15>
or     %al,%al
jne    1109 <blStrCmp+0x9>
xor    %eax,%eax
jmp    111f <blStrCmp+0x1f>
lahf
movsbl %ah,%eax
sar    $0x6,%eax
xor    $0x1,%eax
nop
ret

LLVM IR (-O0):
define i32 @blStrCmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 asm "0:\0A\09lodsb\0A\09scasb\0A\09jne 1f\0A\09or %al, %al\0A\09jnz 0b\0A\09xor %eax, %eax\0A\09jmp 2f\0A1:\0A\09lahf\0A\09movsx %ah, %eax\0A\09sar $$6, %eax\0A\09xor $$1, %eax\0A2:\0A\09nop", "={ax},{si},{di},~{dirflag},~{fpsr},~{flags}"(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @blStrCmp(i8* readnone %0, i8* readnone %1) {
%3 = tail call i32 asm "0:\0A\09lodsb\0A\09scasb\0A\09jne 1f\0A\09or %al, %al\0A\09jnz 0b\0A\09xor %eax, %eax\0A\09jmp 2f\0A1:\0A\09lahf\0A\09movsx %ah, %eax\0A\09sar $$6, %eax\0A\09xor $$1, %eax\0A2:\0A\09nop", "={ax},{si},{di},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret i32 %3
}
char *add_cljtag(char *p) { return (p + 0x02); }


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

x86 assembly (clang, -O2):
<add_cljtag>:
lea    0x2(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @add_cljtag(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ make_tables(int);
int /*<<< orphan*/ make_tables_32(int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int java;
  java = argc >= 2 && strcmp(argv[1], "java") == 0;
  make_tables(java);
  make_tables_32(java);
  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)
xor    %eax,%eax
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     1173 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <make_tables@plt>
mov    -0x14(%rbp),%edi
call   1050 <make_tables_32@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     1150 <main+0x20>
mov    0x8(%rsi),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%edi
call   1030 <make_tables@plt>
mov    %ebx,%edi
call   1050 <make_tables_32@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"java\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br label %15
15: ; preds = %9, %2
%16 = phi i1 [ false, %2 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @make_tables(i32 %18)
%20 = load i32, i32* %6
%21 = call i32 @make_tables_32(i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"java\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %9, %4 ]
%12 = tail call i32 @make_tables(i32 %11)
%13 = tail call i32 @make_tables_32(i32 %11)
ret i32 0
}
/* Variables and functions */
void set_pos(void *d, size_t val) {}


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

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

LLVM IR (-O0):
define void @set_pos(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @set_pos(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x > 0) {
    int old_x = x;
    x = __VERIFIER_nondet_int();
    if (2 * x > old_x) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115c <main+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    -0xc(%rbp),%eax
jle    1157 <main+0x47>
jmp    115c <main+0x4c>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
jle    1135 <main+0x25>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
add    %eax,%ecx
cmp    %ebx,%ecx
mov    %eax,%ebx
jle    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
store i32 %9, i32* %3
%10 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = mul nsw i32 2, %11
%13 = load i32, i32* %3
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %8
br label %17
16: ; preds = %8
br label %5
17: ; preds = %15, %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %5, %0
%3 = phi i32 [ %1, %0 ], [ %6, %5 ]
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = shl nsw i32 %6, 1
%8 = icmp sgt i32 %7, %3
br i1 %8, label %9, label %2
9: ; preds = %5, %2
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int main(void) {
  int32_t i;
  while (1) {
    *((uint32_t *)(0xA0000000)) = 0x2AA | *((volatile uint32_t *)(0xA0001000));
    for (i = 0; i < 0x1FFFFF; i++)
      ;
    *((uint32_t *)(0xA0000000)) = 0x155 | *((volatile uint32_t *)(0xA0001000));
    for (i = 0; i < 0x1FFFFF; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xa0001000,%eax
mov    (%rax),%ecx
or     $0x2aa,%ecx
mov    $0xa0000000,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1fffff,-0x8(%rbp)
jge    1146 <main+0x46>
jmp    1138 <main+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x26>
mov    $0xa0001000,%eax
mov    (%rax),%ecx
or     $0x155,%ecx
mov    $0xa0000000,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1fffff,-0x8(%rbp)
jge    1181 <main+0x81>
jmp    1173 <main+0x73>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x61>
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
mov    $0xa0000000,%eax
mov    $0x155,%ecx
nopw   0x0(%rax,%rax,1)
mov    0x1000(%rax),%edx
mov    0x1000(%rax),%edx
or     %ecx,%edx
mov    %edx,(%rax)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %23
%4 = load volatile i32, i32* inttoptr (i64 2684358656 to i32*)
%5 = or i32 682, %4
store i32 %5, i32* inttoptr (i64 2684354560 to i32*)
store i32 0, i32* %2
br label %6
6: ; preds = %10, %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 2097151
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %6
13: ; preds = %6
%14 = load volatile i32, i32* inttoptr (i64 2684358656 to i32*)
%15 = or i32 341, %14
store i32 %15, i32* inttoptr (i64 2684354560 to i32*)
store i32 0, i32* %2
br label %16
16: ; preds = %20, %13
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 2097151
br i1 %18, label %19, label %23
19: ; preds = %16
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %16
23: ; preds = %16
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 2684358656 to i32*)
%3 = or i32 %2, 682
store i32 %3, i32* inttoptr (i64 2684354560 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 2684358656 to i32*)
%5 = or i32 %4, 341
store i32 %5, i32* inttoptr (i64 2684354560 to i32*)
br label %1
}
/* Variables and functions */
char csyntax(int /*<<< orphan*/);
int /*<<< orphan*/ pair(char);
char cnpairs(char l) { return csyntax(pair(l)); }


x86 assembly (clang, -O0):
<cnpairs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <pair@plt>
mov    %eax,%edi
call   1030 <csyntax@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnpairs>:
push   %rax
call   1040 <pair@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <csyntax@plt>

LLVM IR (-O0):
define signext i8 @cnpairs(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @pair(i8 signext %3)
%5 = call signext i8 @csyntax(i32 %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @cnpairs(i8 signext %0) {
%2 = tail call i32 @pair(i8 signext %0)
%3 = tail call signext i8 @csyntax(i32 %2)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ sort(int, int *);
int main(int argc, char **argv) {
  int test[] = {1, 2, 34, 5, 67, 3, 23, 12, 13, 10};
  sort(10, test);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
mov    $0xa,%edi
call   1030 <sort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <sort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.test = [10 x i32] [i32 1, i32 2, i32 34, i32 5, i32 67, i32 3, i32 23, i32 12, i32 13, i32 10]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [10 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [10 x i32]* %5 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%8 = call i32 @sort(i32 10, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [10 x i32] [i32 1, i32 2, i32 34, i32 5, i32 67, i32 3, i32 23, i32 12, i32 13, i32 10]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = call i32 @sort(i32 10, i32* %5)
ret i32 0
}
int is_bracket(char c) {
  switch (c) {
  case '(':
    return 1;
  case ')':
    return 2;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_bracket>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     1130 <is_bracket+0x30>
jmp    111f <is_bracket+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x29,%eax
je     113c <is_bracket+0x3c>
jmp    1148 <is_bracket+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <is_bracket+0x4f>
movl   $0x2,-0x4(%rbp)
jmp    114f <is_bracket+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bracket>:
xor    %ecx,%ecx
cmp    $0x29,%dil
sete   %cl
add    %ecx,%ecx
cmp    $0x28,%dil
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_bracket(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 %8 [
i32 40, label %6
i32 41, label %7
]
6: ; preds = %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
store i32 2, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_bracket(i8 signext %0) {
%2 = icmp eq i8 %0, 41
%3 = select i1 %2, i32 2, i32 0
%4 = icmp eq i8 %0, 40
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int htoi(char *s) {
  int num;
  sscanf(s, "%x", &num);
  return num;
}


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

x86 assembly (clang, -O2):
<htoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @htoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void *def_calloc(size_t size, size_t nmemb) {
  void *p = calloc(nmemb, size);
  if (p == NULL) {
    syslog(LOG_ERR, "#FMS# calloc out of memory");
    abort();
    return NULL;
  }
  return p;
}


x86 assembly (clang, -O0):
<def_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <def_calloc+0x48>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_calloc>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1040 <calloc@plt>
test   %rax,%rax
je     1146 <def_calloc+0x16>
pop    %rcx
ret
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"#FMS# calloc out of memory\00"
define i8* @def_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @LOG_ERR
%13 = call i32 @syslog(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"#FMS# calloc out of memory\00"
define noalias i8* @def_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %1, i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @LOG_ERR
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
qreplace(f, n) int f;
int n;
{ return (replaces(1, f, n)); }


x86 assembly (clang, -O0):
<qreplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <replaces@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qreplace>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <replaces@plt>

LLVM IR (-O0):
define i32 @qreplace(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @replaces to i32 (i32, i32, i32, ...)*)(i32 1, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @qreplace(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @replaces to i32 (i32, i32, i32, ...)*)(i32 1, i32 %0, i32 %1)
ret i32 %3
}
int rmdir(char *path) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @rmdir(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ assert(int);
long clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec get_time_tick(void) {
  struct timespec ts;
  long ret;
  ts.tv_sec = 0;
  ts.tv_nsec = 0;
  ret = clock_gettime(CLOCK_MONOTONIC, &ts);
  assert(ret == 0);
  return ts;
}


x86 assembly (clang, -O0):
<get_time_tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
test   %rax,%rax
sete   %al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_tick>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    (%rsp),%rax
mov    0x8(%rsp),%rdx
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define { i64, i64 } @get_time_tick() {
%1 = alloca %struct.timespec
%2 = alloca i64
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i64 0, i64* %4
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = call i64 @clock_gettime(i32 %5, %struct.timespec* %1)
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = bitcast %struct.timespec* %1 to { i64, i64 }*
%12 = load { i64, i64 }, { i64, i64 }* %11
ret { i64, i64 } %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define { i64, i64 } @get_time_tick() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = bitcast %struct.timespec* %1 to i8*
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = call i64 @clock_gettime(i32 %5, %struct.timespec* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %3
%11 = insertvalue { i64, i64 } poison, i64 %10, 0
%12 = load i64, i64* %2
%13 = insertvalue { i64, i64 } %11, i64 %12, 1
ret { i64, i64 } %13
}
/* Variables and functions */
char *U_EMR_CORE5_set(int);
char *U_EMRCLOSEFIGURE_set(void) { return (U_EMR_CORE5_set(61)); }


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

x86 assembly (clang, -O2):
<U_EMRCLOSEFIGURE_set>:
mov    $0x3d,%edi
jmp    1030 <U_EMR_CORE5_set@plt>

LLVM IR (-O0):
define i8* @U_EMRCLOSEFIGURE_set() {
%1 = call i8* @U_EMR_CORE5_set(i32 61)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRCLOSEFIGURE_set() {
%1 = tail call i8* @U_EMR_CORE5_set(i32 61)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ fun_two(int, char const *);
void fun_one(int *x) { fun_two(10, (const char *)x); }


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

x86 assembly (clang, -O2):
<fun_one>:
mov    %rdi,%rsi
mov    $0xa,%edi
jmp    1030 <fun_two@plt>

LLVM IR (-O0):
define void @fun_one(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fun_two(i32 10, i8* %4)
ret void
}

LLVM IR (-O2):
define void @fun_one(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @fun_two(i32 10, i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ kmalloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *strdup(char *s) {
  char *t;
  int len;
  if (!s)
    return 0;
  len = strlen(s);
  t = (char *)kmalloc(len + 1);
  memcpy(t, s, len + 1);
  return t;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118a <strdup+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
add    $0x1,%edi
call   1050 <kmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     115d <strdup+0x2d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <kmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1160 <strdup+0x30>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @kmalloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %5)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
scalar_t__ atoi(char *);
char *getenv(char *);
char *dialog_tty(void) {
  char *result = getenv("DIALOG_TTY");
  if (result != 0 && atoi(result) == 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<dialog_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <dialog_tty+0x3e>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
cmp    $0x0,%rax
jne    115e <dialog_tty+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dialog_tty>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1146 <dialog_tty+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <atoi@plt>
test   %rax,%rax
cmove  %rax,%rbx
jmp    1148 <dialog_tty+0x28>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"DIALOG_TTY\00"
define i8* @dialog_tty() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @atoi(i8* %1)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* null, i8* %1
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ %6, %3 ], [ null, %0 ]
ret i8* %8
}