xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ imprime_par();
int main() {
  imprime_par();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @imprime_par()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @imprime_par()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void default_error_handler(const char *reason) {
  fprintf(stderr, "%s\n", reason);
  exit(1);
}


x86 assembly (clang, -O0):
<default_error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<default_error_handler>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @default_error_handler(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int ifWORK(int i, struct ks10_uinsn *insn) { return 0; }


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

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

LLVM IR (-O0):
%struct.ks10_uinsn = type opaque
define i32 @ifWORK(i32 %0, %struct.ks10_uinsn* %1) {
%3 = alloca i32
%4 = alloca %struct.ks10_uinsn*
store i32 %0, i32* %3
store %struct.ks10_uinsn* %1, %struct.ks10_uinsn** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ks10_uinsn = type opaque
define i32 @ifWORK(i32 %0, %struct.ks10_uinsn* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ print_string(char *);
int main(int argc, char *argv[]) {
  char str[5] = "asdf";
  print_string(str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x15(%rbp),%rdi
call   1030 <print_string@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x66647361,(%rsp)
mov    %rsp,%rdi
call   1030 <print_string@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [5 x i8] c"asdf\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [5 x i8]* %6 to i8*
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%9 = call i32 @print_string(i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@__const.main.str = [5 x i8] c"asdf\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @print_string(i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void) { return NULL; }


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

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

LLVM IR (-O0):
define i32* @EVP_aes_128_cbc_hmac_sha1() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @EVP_aes_128_cbc_hmac_sha1() {
ret i32* null
}
/* Type definitions */
struct tree {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
struct node *tree_RB_NEXT(struct node *);
__attribute__((unused)) struct node *tree_next_node(struct tree *t,
                                                    struct node *e) {
  (void)t;
  return tree_RB_NEXT(e);
}


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

x86 assembly (clang, -O2):
<tree_next_node>:
mov    %rsi,%rdi
jmp    1030 <tree_RB_NEXT@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
%struct.node = type { i32 }
define %struct.node* @tree_next_node(%struct.tree* %0, %struct.node* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.node*
store %struct.tree* %0, %struct.tree** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = load %struct.node*, %struct.node** %4
%7 = call %struct.node* @tree_RB_NEXT(%struct.node* %6)
ret %struct.node* %7
}

LLVM IR (-O2):
%struct.tree = type { i32 }
%struct.node = type { i32 }
define %struct.node* @tree_next_node(%struct.tree* nocapture readnone %0, %struct.node* %1) {
%3 = tail call %struct.node* @tree_RB_NEXT(%struct.node* %1)
ret %struct.node* %3
}
int tun6_runscript(struct tun6_t *this, char *script) {
  (void)this;
  (void)script;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.tun6_t = type opaque
define i32 @tun6_runscript(%struct.tun6_t* %0, i8* %1) {
%3 = alloca %struct.tun6_t*
%4 = alloca i8*
store %struct.tun6_t* %0, %struct.tun6_t** %3
store i8* %1, i8** %4
%5 = load %struct.tun6_t*, %struct.tun6_t** %3
%6 = load i8*, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.tun6_t = type opaque
define i32 @tun6_runscript(%struct.tun6_t* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *alloca(size_t size) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @alloca(i64 %0) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t decode_special_opcode(uint32_t instruction) {
  return (instruction & 0x3f);
}


x86 assembly (clang, -O0):
<decode_special_opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_special_opcode>:
mov    %edi,%eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @decode_special_opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 63
ret i32 %4
}

LLVM IR (-O2):
define i32 @decode_special_opcode(i32 %0) {
%2 = and i32 %0, 63
ret i32 %2
}
int check_if_char_in_string(char search_string[], char target_char,
                            int search_string_length) {
  int i;
  for (i = 0; i < search_string_length; i++) {
    if (search_string[i] == target_char) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_if_char_in_string>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    115b <check_if_char_in_string+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <check_if_char_in_string+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1162 <check_if_char_in_string+0x62>
jmp    114d <check_if_char_in_string+0x4d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <check_if_char_in_string+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_char_in_string>:
test   %edx,%edx
jle    111f <check_if_char_in_string+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rdi,%rcx,1)
je     1122 <check_if_char_in_string+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <check_if_char_in_string+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_if_char_in_string(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %1
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usleep(int);
int write(int, char *, int);
int portwrite1(int fd, char *data) {
  int len = 1, n = 0;
  n = write(fd, data, len);
  usleep(500000);
  if (n < 0) {
    fputs("write failed!\n", stderr);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<portwrite1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    $0x7a120,%edi
call   1050 <usleep@plt>
cmpl   $0x0,-0x18(%rbp)
jge    1194 <portwrite1+0x64>
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
lea    0xe7d(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x4(%rbp)
jmp    119b <portwrite1+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portwrite1>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,%ebp
mov    $0x7a120,%edi
call   1050 <usleep@plt>
test   %ebp,%ebp
jns    1169 <portwrite1+0x39>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
lea    0xe9e(%rip),%rdi
call   1040 <fputs@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"write failed!\0A\00"
@stderr = global i32 0
define i32 @portwrite1(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 1, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = call i32 @usleep(i32 500000)
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 0, i32* %3
br label %19
18: ; preds = %2
store i32 1, i32* %3
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"write failed!\0A\00"
@stderr = global i32 0
define i32 @portwrite1(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 1)
%4 = tail call i32 @usleep(i32 500000)
%5 = icmp slt i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %10
}
unsigned short int f62(unsigned short int x, long int y) {
  return (x << ((-y) & (8 * sizeof(unsigned short) - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f62>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f62>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 0, %7
%9 = and i64 %8, 15
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = ashr i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 15
%7 = shl nuw nsw i32 %3, %6
%8 = lshr i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
double atof(char const *);
int numcmp(const char *s1, const char *s2) {
  double v1 = atof(s1);
  double v2 = atof(s2);
  if (v1 < v2)
    return -1;
  else if (v1 > v2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <numcmp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1178 <numcmp+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int is_set_structure_supporting(int *inout) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(118, inout, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<is_set_structure_supporting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x76,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_set_structure_supporting>:
mov    %rdi,%rsi
mov    $0x76,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @is_set_structure_supporting(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 118, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_set_structure_supporting(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 118, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void m94_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0(((val >> 2) & 0xF) << 14);
}


x86 assembly (clang, -O0):
<m94_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x2,%edi
and    $0xf,%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m94_setParams>:
mov    %esi,%edi
and    $0x3c,%edi
shl    $0xc,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @m94_setParams(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 = ashr i32 %6, 2
%8 = and i32 %7, 15
%9 = shl i32 %8, 14
%10 = call i32 @prg16setBank0(i32 %9)
ret void
}

LLVM IR (-O2):
define void @m94_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = and i32 %3, 245760
%5 = tail call i32 @prg16setBank0(i32 %4)
ret void
}
/* Variables and functions */
long double fabs(double);
double fabsf(double);
void tst_float_size(double *pd, long double *pld) {
  *pd = fabsf(*pd);
  *pld = fabs(*pld);
  *pld = fabs((double)*pld);
}


x86 assembly (clang, -O0):
<tst_float_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <fabsf@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <fabs@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_float_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
andps  0xedd(%rip),%xmm0
movlps %xmm0,(%rdi)
fldt   (%rsi)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
fld    %st(0)
fstpt  (%rbx)
fstpl  (%rsp)
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
fstpt  (%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @tst_float_size(double* %0, x86_fp80* %1) {
%3 = alloca double*
%4 = alloca x86_fp80*
store double* %0, double** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call double @fabsf(double %6)
%8 = load double*, double** %3
store double %7, double* %8
%9 = load x86_fp80*, x86_fp80** %4
%10 = load x86_fp80, x86_fp80* %9
%11 = fptrunc x86_fp80 %10 to double
%12 = call x86_fp80 @fabs(double %11)
%13 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %12, x86_fp80* %13
%14 = load x86_fp80*, x86_fp80** %4
%15 = load x86_fp80, x86_fp80* %14
%16 = fptrunc x86_fp80 %15 to double
%17 = call x86_fp80 @fabs(double %16)
%18 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %17, x86_fp80* %18
ret void
}

LLVM IR (-O2):
define void @tst_float_size(double* nocapture %0, x86_fp80* nocapture %1) {
%3 = load double, double* %0
%4 = tail call double @llvm.fabs.f64(double %3)
store double %4, double* %0
%5 = load x86_fp80, x86_fp80* %1
%6 = fptrunc x86_fp80 %5 to double
%7 = tail call x86_fp80 @fabs(double %6)
store x86_fp80 %7, x86_fp80* %1
%8 = fptrunc x86_fp80 %7 to double
%9 = tail call x86_fp80 @fabs(double %8)
store x86_fp80 %9, x86_fp80* %1
ret void
}
/* Variables and functions */
size_t random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int generate_random(size_t len) {
  srandom(time(NULL));
  return random() % len;
}


x86 assembly (clang, -O0):
<generate_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1050 <random@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1050 <random@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     115f <generate_random+0x2f>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @generate_random(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srandom(i32 %3)
%5 = call i64 (...) @random()
%6 = load i64, i64* %2
%7 = urem i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @generate_random(i64 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srandom(i32 %2)
%4 = tail call i64 (...) @random()
%5 = urem i64 %4, %0
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
char *ltrim(char *);
char *popString();
int /*<<< orphan*/ pushStringCopy(char *);
void basLTrim() {
  char *string;
  char *dest;
  string = popString();
  dest = ltrim(string);
  pushStringCopy(dest);
  eFree(string);
}


x86 assembly (clang, -O0):
<basLTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ltrim@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <pushStringCopy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basLTrim>:
push   %rbx
xor    %eax,%eax
call   1040 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ltrim@plt>
mov    %rax,%rdi
call   1060 <pushStringCopy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basLTrim() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @popString()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @ltrim(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @pushStringCopy(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @eFree(i8* %8)
ret void
}

LLVM IR (-O2):
define void @basLTrim() {
%1 = tail call i8* (...) @popString()
%2 = tail call i8* @ltrim(i8* %1)
%3 = tail call i32 @pushStringCopy(i8* %2)
%4 = tail call i32 @eFree(i8* %1)
ret void
}
/* Variables and functions */
int d26(int);
int d27(int a) { return d26(d26(a)); }


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

x86 assembly (clang, -O2):
<d27>:
push   %rax
call   1030 <d26@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d26@plt>

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

LLVM IR (-O2):
define i32 @d27(i32 %0) {
%2 = tail call i32 @d26(i32 %0)
%3 = tail call i32 @d26(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank0(int);
void vrc1setParams8000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank0((val & 0xF) << 13);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
and    $0xf,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank0@plt>

LLVM IR (-O0):
define void @vrc1setParams8000(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 = and i32 %6, 15
%8 = shl i32 %7, 13
%9 = call i32 @prg8setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @vrc1setParams8000(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = and i32 %3, 122880
%5 = tail call i32 @prg8setBank0(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ socket(int, int, int);
int util_safeio_get_fd(int /*<<< orphan*/);
int util_safeio_socket(int domain, int type, int protocol) {
  return util_safeio_get_fd(socket(domain, type, protocol));
}


x86 assembly (clang, -O0):
<util_safeio_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,%edi
call   1030 <util_safeio_get_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @util_safeio_socket(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 @socket(i32 %7, i32 %8, i32 %9)
%11 = call i32 @util_safeio_get_fd(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @util_safeio_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @util_safeio_get_fd(i32 %4)
ret i32 %5
}
/* Variables and functions */
float M_PI;
float radians(float degrees) { return degrees * (M_PI / 180.0f); }


x86 assembly (clang, -O0):
<radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
movss  (%rax),%xmm1
movss  0xedf(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radians>:
mov    0x2ee1(%rip),%rax
movss  (%rax),%xmm1
divss  0xeed(%rip),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fdiv float %4, 1.800000e+02
%6 = fmul float %3, %5
ret float %6
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @radians(float %0) {
%2 = load float, float* @M_PI
%3 = fdiv float %2, 1.800000e+02
%4 = fmul float %3, %0
ret float %4
}
void check_source(cond, clean_p) int cond;
const char *clean_p;
{
  if (!cond)
    declare_source_confusing(clean_p);
}


x86 assembly (clang, -O0):
<check_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <check_source+0x24>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <declare_source_confusing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_source>:
test   %edi,%edi
je     1115 <check_source+0x5>
ret
mov    %rsi,%rdi
xor    %eax,%eax
jmp    1030 <declare_source_confusing@plt>

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

LLVM IR (-O2):
define void @check_source(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @declare_source_confusing to i32 (i8*, ...)*)(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
void av_encryption_init_info_free() {}


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

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

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

LLVM IR (-O2):
define void @av_encryption_init_info_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ restack_units();
void process_restack(void) { restack_units(); }


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

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

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

LLVM IR (-O2):
define void @process_restack() {
%1 = tail call i32 (...) @restack_units()
ret void
}
/* Variables and functions */
int rd_open_file(char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rd_open_file(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *string;
  if (argc <= 1) {
    string = "World";
  } else {
    string = argv[1];
  }
  printf("hello %s!\n", string);
  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)
cmpl   $0x1,-0x8(%rbp)
jg     1140 <main+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    111f <main+0xf>
lea    0xee3(%rip),%rsi
jmp    1123 <main+0x13>
mov    0x8(%rsi),%rsi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"World\00"
@.str.1 = [11 x i8] c"hello %s!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %6
br label %14
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %6
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"World\00"
@.str.1 = [11 x i8] c"hello %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
int *f(int c) {
  int x = 3;
  if (c == 0) {
    return &x;
  } else {
    int sa[10];
    sa[0] = 35;
    sa[2] = 37;
    if (c == 1) {
      return sa;
    } else {
      return &sa[0];
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1125 <f+0x25>
lea    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <f+0x52>
movl   $0x23,-0x40(%rbp)
movl   $0x25,-0x38(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    114a <f+0x4a>
lea    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <f+0x52>
lea    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     110a <f+0xa>
lea    -0x28(%rsp),%rax
ret
lea    -0x2c(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @f(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
store i32 %0, i32* %3
store i32 3, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32* %4, i32** %2
br label %18
9: ; preds = %1
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32 35, i32* %10
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 2
store i32 37, i32* %11
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32* %15, i32** %2
br label %18
16: ; preds = %9
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32* %17, i32** %2
br label %18
18: ; preds = %16, %14, %8
%19 = load i32*, i32** %2
ret i32* %19
}

LLVM IR (-O2):
define noalias i32* @f(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = bitcast i32* %2 to i8*
%5 = icmp eq i32 %0, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = bitcast [10 x i32]* %3 to i8*
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
br label %9
9: ; preds = %1, %6
%10 = phi i32* [ %8, %6 ], [ %2, %1 ]
ret i32* %10
}
/* Variables and functions */
int /*<<< orphan*/ rank_of(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  rank_of(num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <rank_of@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @rank_of(i32 %4)
ret i32 0
}
void click(void) {
  int i;
  for (i = 1; i < 2; i++) {
    ;
    ;
    ;
  }
}


x86 assembly (clang, -O0):
<click>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1128 <click+0x28>
jmp    111a <click+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <click+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @click() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void mfence() {
  db(0x0F);
  db(0xAE);
  db(0xF0);
}


x86 assembly (clang, -O0):
<mfence>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0xae,%edi
call   1030 <db@plt>
mov    $0xf0,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfence>:
push   %rax
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0xae,%edi
call   1030 <db@plt>
mov    $0xf0,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @mfence() {
%1 = call i32 @db(i32 15)
%2 = call i32 @db(i32 174)
%3 = call i32 @db(i32 240)
ret void
}

LLVM IR (-O2):
define void @mfence() {
%1 = tail call i32 @db(i32 15)
%2 = tail call i32 @db(i32 174)
%3 = tail call i32 @db(i32 240)
ret void
}
/* Variables and functions */
size_t hashnode_nextsize(unsigned items) {
  size_t increment = ((items + (256 / 2)) / 256);
  if (increment > 4) {
    increment = 4;
  }
  return 253 + increment * 256;
}


x86 assembly (clang, -O0):
<hashnode_nextsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%eax
shr    $0x8,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
cmpq   $0x4,-0x10(%rbp)
jbe    112b <hashnode_nextsize+0x2b>
movq   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
add    $0xfd,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashnode_nextsize>:
sub    $0xffffff80,%edi
shr    $0x8,%edi
cmp    $0x4,%edi
mov    $0x4,%eax
cmovb  %rdi,%rax
shl    $0x8,%rax
or     $0xfd,%rax
ret

LLVM IR (-O0):
define i64 @hashnode_nextsize(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 128
%6 = udiv i32 %5, 256
%7 = zext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp ugt i64 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 4, i64* %3
br label %11
11: ; preds = %10, %1
%12 = load i64, i64* %3
%13 = mul i64 %12, 256
%14 = add i64 253, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @hashnode_nextsize(i32 %0) {
%2 = add i32 %0, 128
%3 = lshr i32 %2, 8
%4 = zext i32 %3 to i64
%5 = icmp ult i64 %4, 4
%6 = select i1 %5, i64 %4, i64 4
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, 253
ret i64 %8
}
void _fixed_interval_timer() { printf("Exception: %s\n", __FUNCTION__); }


x86 assembly (clang, -O0):
<_fixed_interval_timer>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._fixed_interval_timer = [22 x i8] c"_fixed_interval_timer\00"
define void @_fixed_interval_timer() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__._fixed_interval_timer, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._fixed_interval_timer = [22 x i8] c"_fixed_interval_timer\00"
define void @_fixed_interval_timer() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__._fixed_interval_timer, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(void **);
void sa_free_node(void **p) { OPENSSL_free(p); }


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

x86 assembly (clang, -O2):
<sa_free_node>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @sa_free_node(i8** %0) {
%2 = tail call i32 @OPENSSL_free(i8** %0)
ret void
}
/* Variables and functions */
int strlen(char *);
void trim_suffix_c(char *s, int c) {
  if (!*s)
    return;
  s += strlen(s) - 1;
  if (*s == c)
    *s = '\0';
}


x86 assembly (clang, -O0):
<trim_suffix_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1131 <trim_suffix_c+0x21>
jmp    1164 <trim_suffix_c+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1164 <trim_suffix_c+0x54>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_suffix_c>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1132 <trim_suffix_c+0x22>
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movsbl -0x1(%rax,%rbx,1),%ecx
cmp    %ebp,%ecx
jne    1132 <trim_suffix_c+0x22>
movb   $0x0,-0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @trim_suffix_c(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %14
13: ; preds = %5
store i8 0, i8* %9
br label %14
14: ; preds = %2, %13, %5
ret void
}
/* Variables and functions */
size_t utf8_len(unsigned char c) {
  if ((c & (1 << 7)) == 0) {
    return 1;
  }
  if ((c & (1 << 6)) == 0) {
    return 0;
  }
  if ((c & (1 << 5)) == 0) {
    return 2;
  }
  if ((c & (1 << 4)) == 0) {
    return 3;
  }
  return 4;
}


x86 assembly (clang, -O0):
<utf8_len>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1129 <utf8_len+0x29>
movq   $0x1,-0x8(%rbp)
jmp    1188 <utf8_len+0x88>
movzbl -0x9(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    1146 <utf8_len+0x46>
movq   $0x0,-0x8(%rbp)
jmp    1188 <utf8_len+0x88>
movzbl -0x9(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1163 <utf8_len+0x63>
movq   $0x2,-0x8(%rbp)
jmp    1188 <utf8_len+0x88>
movzbl -0x9(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
jne    1180 <utf8_len+0x80>
movq   $0x3,-0x8(%rbp)
jmp    1188 <utf8_len+0x88>
movq   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_len>:
mov    $0x1,%eax
test   $0x80,%dil
je     112e <utf8_len+0x2e>
test   $0x40,%dil
jne    1114 <utf8_len+0x14>
xor    %eax,%eax
ret
mov    $0x2,%eax
test   $0x20,%dil
je     112e <utf8_len+0x2e>
and    $0x10,%edi
cmp    $0x1,%edi
mov    $0x4,%eax
sbb    $0x0,%rax
ret

LLVM IR (-O0):
define i64 @utf8_len(i8 zeroext %0) {
%2 = alloca i64
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 1, i64* %2
br label %28
9: ; preds = %1
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 64
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i64 0, i64* %2
br label %28
15: ; preds = %9
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = and i32 %17, 32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i64 2, i64* %2
br label %28
21: ; preds = %15
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = and i32 %23, 16
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %21
store i64 3, i64* %2
br label %28
27: ; preds = %21
store i64 4, i64* %2
br label %28
28: ; preds = %27, %26, %20, %14, %8
%29 = load i64, i64* %2
ret i64 %29
}

LLVM IR (-O2):
define i64 @utf8_len(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = and i32 %2, 64
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = and i32 %2, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = and i32 %2, 16
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i64 3, i64 4
br label %15
15: ; preds = %11, %8, %5, %1
%16 = phi i64 [ 1, %1 ], [ 0, %5 ], [ 2, %8 ], [ %14, %11 ]
ret i64 %16
}
OP(ed, e4) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int munmap(void *, size_t);
int unmapfile(void *ptr, size_t sz) {
  assert(ptr != NULL);
  return munmap(ptr, sz);
}


x86 assembly (clang, -O0):
<unmapfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmapfile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <munmap@plt>

LLVM IR (-O0):
define i32 @unmapfile(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
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @munmap(i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @unmapfile(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 %6
}