xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *sixteen() {
  char *s = malloc(6);
  strcpy(s, "Hello");
  return s;
}


x86 assembly (clang, -O0):
<sixteen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sixteen>:
push   %rbx
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i8* @sixteen() {
%1 = tail call dereferenceable_or_null(6) i8* @malloc(i32 6)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ foo08();
void bar08() { foo08(); }


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

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

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

LLVM IR (-O2):
define void @bar08() {
%1 = tail call i32 (...) @foo08()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int close_uart(int fd_uart) {
  if (fd_uart) {
    close(fd_uart);
  }
}


x86 assembly (clang, -O0):
<close_uart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112d <close_uart+0x1d>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_uart>:
test   %edi,%edi
je     111e <close_uart+0xe>
push   %rax
call   1030 <close@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @close_uart(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_spam_who(int);
void nsblk_spam_who4(void) { nsblk_spam_who(4); }


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

x86 assembly (clang, -O2):
<nsblk_spam_who4>:
mov    $0x4,%edi
jmp    1030 <nsblk_spam_who@plt>

LLVM IR (-O0):
define void @nsblk_spam_who4() {
%1 = call i32 @nsblk_spam_who(i32 4)
ret void
}

LLVM IR (-O2):
define void @nsblk_spam_who4() {
%1 = tail call i32 @nsblk_spam_who(i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *breakSingleXOR(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *parseHexString(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  uint8_t *input = parseHexString(
      "1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736",
      68);
  int inputlen = 34;
  char *message = breakSingleXOR(input, inputlen);
  printf("Message: %s\n", message);
  free(message);
  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    0xea3(%rip),%rdi
mov    $0x44,%esi
call   1050 <parseHexString@plt>
mov    %rax,-0x18(%rbp)
movl   $0x22,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <breakSingleXOR@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
mov    $0x44,%esi
call   1050 <parseHexString@plt>
mov    %rax,%rdi
mov    $0x22,%esi
call   1060 <breakSingleXOR@plt>
mov    %rax,%rbx
lea    0xedc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736\00"
@.str.1 = [13 x i8] c"Message: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32* @parseHexString(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 68)
store i32* %9, i32** %6
store i32 34, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = call i8* @breakSingleXOR(i32* %10, i32 %11)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %8
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736\00"
@.str.1 = [13 x i8] c"Message: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @parseHexString(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 68)
%4 = tail call i8* @breakSingleXOR(i32* %3, i32 34)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fac(int);
int main(void) { fac(5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <fac@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @fac(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fac(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ pop3_ser();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  daemon(0, 0);
  signal(SIGCHLD, SIG_IGN);
  pop3_ser();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1050 <daemon@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <pop3_ser@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1050 <daemon@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <pop3_ser@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
@SIG_IGN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @daemon(i32 0, i32 0)
%3 = load i32, i32* @SIGCHLD
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = call i32 (...) @pop3_ser()
ret i32 0
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@SIG_IGN = global i32 0
define i32 @main() {
%1 = tail call i32 @daemon(i32 0, i32 0)
%2 = load i32, i32* @SIGCHLD
%3 = load i32, i32* @SIG_IGN
%4 = tail call i32 @signal(i32 %2, i32 %3)
%5 = tail call i32 (...) @pop3_ser()
ret i32 0
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_find(int /*<<< orphan*/ *, void const *);
int sk_OPENSSL_CSTRING_find(struct stack_st_OPENSSL_CSTRING *sk,
                            const char *ptr) {
  return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_find>:
jmp    1030 <OPENSSL_sk_find@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_find(%struct.stack_st_OPENSSL_CSTRING* %0, i8* %1) {
%3 = alloca %struct.stack_st_OPENSSL_CSTRING*
%4 = alloca i8*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %3
store i8* %1, i8** %4
%5 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %3
%6 = bitcast %struct.stack_st_OPENSSL_CSTRING* %5 to i32*
%7 = load i8*, i8** %4
%8 = call i32 @OPENSSL_sk_find(i32* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_find(%struct.stack_st_OPENSSL_CSTRING* %0, i8* %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%4 = tail call i32 @OPENSSL_sk_find(i32* %3, i8* %1)
ret i32 %4
}
void uninit() {}


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

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

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

LLVM IR (-O2):
define void @uninit() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
TYPE_1__ div(int, int);
int /*<<< orphan*/ printf(char *, int, int);
void test_safe_index(int num, int den) {
  div_t d = div(num, den);
  printf("num  = %-10dden  = %-10d\n", num, den);
  printf("quot = %-10drem  = %-10d\n", d.quot, d.rem);
}


x86 assembly (clang, -O0):
<test_safe_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <div@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_safe_index>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <div@plt>
mov    %rax,%r15
mov    %rax,%rbx
shr    $0x20,%rbx
lea    0xebe(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [26 x i8] c"num = %-10dden = %-10d\0A\00"
@.str.1 = [26 x i8] c"quot = %-10drem = %-10d\0A\00"
define void @test_safe_index(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.TYPE_3__
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @div(i32 %6, i32 %7)
%9 = bitcast %struct.TYPE_3__* %5 to i64*
store i64 %8, i64* %9
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 1
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"num = %-10dden = %-10d\0A\00"
@.str.1 = [26 x i8] c"quot = %-10drem = %-10d\0A\00"
define void @test_safe_index(i32 %0, i32 %1) {
%3 = tail call i64 @div(i32 %0, i32 %1)
%4 = trunc i64 %3 to i32
%5 = lshr i64 %3, 32
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret void
}
/* Type definitions */
struct resolver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct resolver *);
void resolver_free(struct resolver *resolver) { free(resolver); }


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

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

LLVM IR (-O2):
%struct.resolver = type { i32 }
define void @resolver_free(%struct.resolver* nocapture %0) {
%2 = tail call i32 @free(%struct.resolver* %0)
ret void
}
int test_imm_BCuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xBC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BCuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 188
%6 = icmp ne i64 %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_BCuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 188
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_set_extension(uint8_t *p_rtp) { p_rtp[0] |= 0x10; }


x86 assembly (clang, -O0):
<rtp_set_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_set_extension>:
orb    $0x10,(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_extension(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = or i32 %5, 16
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp_set_extension(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = or i32 %2, 16
store i32 %3, i32* %0
ret void
}
int jstp_parse_dec_digit(char c) {
  int v = c;
  v -= '0';
  if (v < 0 || v > 9)
    return -1;
  return v;
}


x86 assembly (clang, -O0):
<jstp_parse_dec_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     112e <jstp_parse_dec_digit+0x2e>
cmpl   $0x9,-0xc(%rbp)
jle    113a <jstp_parse_dec_digit+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <jstp_parse_dec_digit+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jstp_parse_dec_digit>:
lea    -0x3a(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xf6,%al
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @jstp_parse_dec_digit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 9
br i1 %13, label %14, label %15
14: ; preds = %11, %1
store i32 -1, i32* %2
br label %17
15: ; preds = %11
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @jstp_parse_dec_digit(i8 signext %0) {
%2 = add i8 %0, -58
%3 = icmp ult i8 %2, -10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int getegid(void) { return 1000; }


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

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

LLVM IR (-O0):
define i32 @getegid() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @getegid() {
ret i32 1000
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x30_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x30_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x30_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x30_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x30_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void flowctrl_cpu_suspend_enter(unsigned int cpuid) {}


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

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

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

LLVM IR (-O2):
define void @flowctrl_cpu_suspend_enter(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t abs64(int64_t x) { return (x < 0) ? -x : x; }


x86 assembly (clang, -O0):
<abs64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs64+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs64+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs64>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs64(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
long double expl(long double);
long double logl(long double);
long double powl(long double num, long double power) {
  return expl(logl(num) * power);
}


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fstpt  0x1c(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1030 <logl@plt>
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1040 <expl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = call x86_fp80 @logl(x86_fp80 %5)
%7 = load x86_fp80, x86_fp80* %4
%8 = fmul x86_fp80 %6, %7
%9 = call x86_fp80 @expl(x86_fp80 %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @logl(x86_fp80 %0)
%4 = fmul x86_fp80 %3, %1
%5 = tail call x86_fp80 @expl(x86_fp80 %4)
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wFOpen(char *, char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFOpen() {
  char *fname, *fmode;
  fmode = wPopString();
  fname = wPopString();
  wPushNumber(wFOpen(fname, fmode));
  free(fname);
  free(fmode);
}


x86 assembly (clang, -O0):
<wBasFOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <wFOpen@plt>
mov    %eax,%edi
call   1050 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFOpen>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <wFOpen@plt>
mov    %eax,%edi
call   1050 <wPushNumber@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wBasFOpen() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @wPopString()
store i8* %3, i8** %2
%4 = call i8* (...) @wPopString()
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = call i32 @wFOpen(i8* %5, i8* %6)
%8 = call i32 @wPushNumber(i32 %7)
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @wBasFOpen() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i32 @wFOpen(i8* %2, i8* %1)
%4 = tail call i32 @wPushNumber(i32 %3)
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int file_size(char const *);
int file_exists(const char *filename) { return -1 != file_size(filename); }


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <file_size@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
call   1030 <file_size@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @file_size(i8* %3)
%5 = icmp ne i32 -1, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @file_exists(i8* %0) {
%2 = tail call i32 @file_size(i8* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int machdep_sys_wait4(int, int *, int, int /*<<< orphan*/ *);
machdep_sys_waitpid(int pid, int *statusp, int options) {
  return machdep_sys_wait4(pid, statusp, options, NULL);
}


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

x86 assembly (clang, -O2):
<machdep_sys_waitpid>:
xor    %ecx,%ecx
jmp    1030 <machdep_sys_wait4@plt>

LLVM IR (-O0):
define i32 @machdep_sys_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @machdep_sys_wait4(i32 %7, i32* %8, i32 %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
define i32 @machdep_sys_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @machdep_sys_wait4(i32 %0, i32* %1, i32 %2, i32* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eulerd_from_mat3d(double *, double *, char const *);
int /*<<< orphan*/ mat3d_from_mat4d(double *, double const *);
void eulerd_from_mat4d(double angles[3], const double m[16],
                       const char order[3]) {
  double tmpMat[9];
  mat3d_from_mat4d(tmpMat, m);
  eulerd_from_mat3d(angles, tmpMat, order);
}


x86 assembly (clang, -O0):
<eulerd_from_mat4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mat3d_from_mat4d@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <eulerd_from_mat3d@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eulerd_from_mat4d>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <mat3d_from_mat4d@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <eulerd_from_mat3d@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @eulerd_from_mat4d(double* %0, double* %1, i8* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i8*
%7 = alloca [9 x double]
store double* %0, double** %4
store double* %1, double** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%9 = load double*, double** %5
%10 = call i32 @mat3d_from_mat4d(double* %8, double* %9)
%11 = load double*, double** %4
%12 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i32 @eulerd_from_mat3d(double* %11, double* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @eulerd_from_mat4d(double* %0, double* %1, i8* %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%7 = call i32 @mat3d_from_mat4d(double* %6, double* %1)
%8 = call i32 @eulerd_from_mat3d(double* %0, double* %6, i8* %2)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t S1(uint64_t x) {
  return (((x) >> (14)) | ((x) << (64 - (14)))) ^
         (((x) >> (18)) | ((x) << (64 - (18)))) ^
         (((x) >> (41)) | ((x) << (64 - (41))));
}


x86 assembly (clang, -O0):
<S1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xe,%eax
mov    -0x4(%rbp),%edx
mov    $0x32,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x12,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2e,%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%ecx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x29,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x17,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @S1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 14
%5 = load i32, i32* %2
%6 = shl i32 %5, 50
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 18
%10 = load i32, i32* %2
%11 = shl i32 %10, 46
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 41
%16 = load i32, i32* %2
%17 = shl i32 %16, 23
%18 = or i32 %15, %17
%19 = xor i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @S1(i32 %0) {
ret i32 poison
}
void foo() {
  int *ptr = 0;
  *ptr = 7;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 7, i32* %2
ret void
}

LLVM IR (-O2):
void s0fillbuffer(void) {}


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

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

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

LLVM IR (-O2):
define void @s0fillbuffer() {
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ die(char *, size_t);
void *realloc(void *, size_t);
void *xalloc(void *ptr, size_t sz) {
  if (!ptr)
    ptr = calloc(1, sz);
  else
    ptr = realloc(ptr, sz);
  if (!ptr)
    die("out of memory (%ld)\n", sz);
  return ptr;
}


x86 assembly (clang, -O0):
<xalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1162 <xalloc+0x32>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1173 <xalloc+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118e <xalloc+0x5e>
mov    -0x10(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1050 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %rdi,%rdi
je     1146 <xalloc+0x16>
mov    %r14,%rsi
call   1040 <realloc@plt>
jmp    1153 <xalloc+0x23>
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116a <xalloc+0x3a>
lea    0xe9e(%rip),%rdi
mov    %r14,%rsi
call   1050 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"out of memory (%ld)\0A\00"
define i8* @xalloc(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 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %4
%9 = call i8* @calloc(i32 1, i64 %8)
store i8* %9, i8** %3
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i8* @realloc(i8* %11, i64 %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %10, %7
%15 = load i8*, i8** %3
%16 = icmp ne i8* %15, null
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i64, i64* %4
%19 = call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %18)
br label %20
20: ; preds = %17, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [21 x i8] c"out of memory (%ld)\0A\00"
define i8* @xalloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @calloc(i32 1, i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %7, %6 ], [ %5, %4 ]
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %13
13: ; preds = %11, %8
ret i8* %9
}
void __test_internal_skip() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @EVP_Digest() {
ret void
}
void mdelay(unsigned long x) {}


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

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

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

LLVM IR (-O2):
define void @mdelay(i64 %0) {
ret void
}
imm0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (22 <= (((double *)(11111111 & ~(__alignof__(double) - 1)))[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x20(%rbp),%rcx
mov    $0xa98ac0,%eax
movsd  (%rax,%rcx,8),%xmm0
movsd  0xece(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1148 <imm0adrx1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <imm0adrx1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adrx1>:
movslq %esi,%rax
movsd  0xa98ac0(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0xeea(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @imm0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 11111104 to double*), i64 %15
%17 = load double, double* %16
%18 = fcmp ole double 2.200000e+01, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @imm0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 11111104 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp oge double %9, 2.200000e+01
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
char *get_string_value(char *);
int /*<<< orphan*/ set_lang(char *, char *);
int /*<<< orphan*/ set_locale_var(char *, char *);
void set_default_lang() {
  char *v;
  v = get_string_value("LC_ALL");
  set_locale_var("LC_ALL", v);
  v = get_string_value("LANG");
  set_lang("LANG", v);
}


x86 assembly (clang, -O0):
<set_default_lang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <get_string_value@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <set_locale_var@plt>
lea    0xea8(%rip),%rdi
call   1040 <get_string_value@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1050 <set_lang@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_lang>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <get_string_value@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <set_locale_var@plt>
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
call   1040 <get_string_value@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1050 <set_lang@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"LC_ALL\00"
@.str.1 = [5 x i8] c"LANG\00"
define void @set_default_lang() {
%1 = alloca i8*
%2 = call i8* @get_string_value(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @set_locale_var(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @get_string_value(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @set_lang(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"LC_ALL\00"
@.str.1 = [5 x i8] c"LANG\00"
define void @set_default_lang() {
%1 = tail call i8* @get_string_value(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @set_locale_var(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @get_string_value(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @set_lang(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: kallsyms < in.map > out.S\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: kallsyms < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: kallsyms < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double N1z_y(double, double, double, double);
double N2z_x(double sign, double xi, double et, double qq) {
  return N1z_y(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<N2z_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <N1z_y@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<N2z_x>:
jmp    1030 <N1z_y@plt>

LLVM IR (-O0):
define double @N2z_x(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @N1z_y(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @N2z_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @N1z_y(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ sum_n(int);
int main() {
  sum_n(10);
  sum_n(20);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <sum_n@plt>
mov    $0x14,%edi
call   1030 <sum_n@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <sum_n@plt>
mov    $0x14,%edi
call   1030 <sum_n@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sum_n(i32 10)
%2 = call i32 @sum_n(i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum_n(i32 10)
%2 = tail call i32 @sum_n(i32 20)
ret i32 0
}
int Min0(arg1, arg2)
int arg1, arg2;
{
  if (arg1 < arg2)
    return (arg1);
  else
    return (arg2);
}


x86 assembly (clang, -O0):
<Min0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <Min0+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Min0+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min0>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Min0(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ normalize(int, double *);
double random_double();
void simplex(int size, double v[]) {
  int i;
  for (i = 0; i < size; i++) {
    v[i] = random_double();
  }
  normalize(size, v);
}


x86 assembly (clang, -O0):
<simplex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <simplex+0x44>
mov    $0x0,%al
call   1040 <random_double@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <simplex+0x16>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <normalize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplex>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%r14d
test   %edi,%edi
jle    1156 <simplex+0x36>
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <random_double@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <simplex+0x20>
mov    %r14d,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <normalize@plt>

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

LLVM IR (-O2):
define void @simplex(i32 %0, double* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call double (...) @random_double()
%9 = getelementptr inbounds double, double* %1, i64 %7
store double %8, double* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = tail call i32 @normalize(i32 %0, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swapstk() { ol("popl\tr2\npushl\tr0\nmovl\tr2,r0"); }


x86 assembly (clang, -O0):
<swapstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"popl\09r2\0Apushl\09r0\0Amovl\09r2,r0\00"
define i32 @swapstk() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [28 x i8] c"popl\09r2\0Apushl\09r0\0Amovl\09r2,r0\00"
define i32 @swapstk() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void font_(id) int *id;
{ font(*id); }


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

x86 assembly (clang, -O2):
<font_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <font@plt>

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

LLVM IR (-O2):
define void @font_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @font to i32 (i32, ...)*)(i32 %2)
ret void
}
void ScaleARGBRowDown2Linear_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2Linear_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage();
void help(void) {
  usage();
  printf("Options:\n"
         "    -c         skip invalid characters, see iconv(1).\n"
         "    -D <dst>   where to place the results.\n"
         "    -f <code>  the 'from' charset, i.e.: UTF-8.\n"
         "    -h         this help.\n"
         "    -t <code>  the 'to' charset, i.e.: KOI8-RU.\n"
         "    -v         be verbose.\n");
}


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

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

LLVM IR (-O0):
@.str = [256 x i8] c"Options:\0A -c skip invalid characters, see iconv(1).\0A -D <dst> where to place the results.\0A -f <code> the 'from' charset, i.e.: UTF-8.\0A -h this help.\0A -t <code> the 'to' charset, i.e.: KOI8-RU.\0A -v be verbose.\0A\00"
define void @help() {
%1 = call i32 (...) @usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [255 x i8] c"Options:\0A -c skip invalid characters, see iconv(1).\0A -D <dst> where to place the results.\0A -f <code> the 'from' charset, i.e.: UTF-8.\0A -h this help.\0A -t <code> the 'to' charset, i.e.: KOI8-RU.\0A -v be verbose.\00"
define void @help() {
%1 = tail call i32 (...) @usage()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([255 x i8], [255 x i8]* @str, i64 0, i64 0))
ret void
}