xunge/DecIR huggingface dataset:
void htsstr_argsplit_free(char **argv) {
  int i;
  for (i = 0; argv[i]; i++)
    free(argv[i]);
  free(argv);
}


x86 assembly (clang, -O0):
<htsstr_argsplit_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <htsstr_argsplit_free+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <htsstr_argsplit_free+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htsstr_argsplit_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <htsstr_argsplit_free+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <htsstr_argsplit_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @htsstr_argsplit_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
uintptr_t hash_int32(uintptr_t, unsigned int);
uintptr_t hash_int64(uintptr_t, unsigned int);
uintptr_t hash_ptr(const void *ptr, unsigned int bits) {
  if (sizeof(uintptr_t) == 8) {
    return hash_int64((uintptr_t)ptr, bits);
  } else {
    return hash_int32((uintptr_t)ptr, bits);
  }
}


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

x86 assembly (clang, -O2):
<hash_ptr>:
jmp    1030 <hash_int64@plt>

LLVM IR (-O0):
define i64 @hash_ptr(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 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %4
%8 = call i64 @hash_int64(i64 %6, i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @hash_ptr(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i64 @hash_int64(i64 %3, i32 %1)
ret i64 %4
}
/* Variables and functions */
int isalpha(int);
int bow_isalpha(int character) { return isalpha(character); }


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

x86 assembly (clang, -O2):
<bow_isalpha>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @bow_isalpha(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
ret i32 %2
}
unsigned int plus(unsigned int a, unsigned int b) { return a + b; }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @plus(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 = add i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @plus(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
int deployWrekavoc(struct sNodeProperty **pListe) { return 0; }


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

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

LLVM IR (-O0):
%struct.sNodeProperty = type opaque
define i32 @deployWrekavoc(%struct.sNodeProperty** %0) {
%2 = alloca %struct.sNodeProperty**
store %struct.sNodeProperty** %0, %struct.sNodeProperty*** %2
ret i32 0
}

LLVM IR (-O2):
%struct.sNodeProperty = type opaque
define i32 @deployWrekavoc(%struct.sNodeProperty** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int sort_compare_strings_desc(const void *a, const void *b) {
  return strcmp(*(const char **)b, *(const char **)a);
}


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

x86 assembly (clang, -O2):
<sort_compare_strings_desc>:
mov    (%rsi),%rax
mov    (%rdi),%rsi
mov    %rax,%rdi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @sort_compare_strings_desc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sort_compare_strings_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %0 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Toseqc_toseqc(struct Cyc_List_List *);
struct Cyc_List_List *Cyc_do_toseqc(int ignore, struct Cyc_List_List *tds) {
  return ({ Cyc_Toseqc_toseqc(tds); });
}


x86 assembly (clang, -O0):
<Cyc_do_toseqc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_Toseqc_toseqc@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_do_toseqc>:
push   %rax
mov    %rsi,%rdi
call   1030 <Cyc_Toseqc_toseqc@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_toseqc(i32 %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%7 = call i32 @Cyc_Toseqc_toseqc(%struct.Cyc_List_List* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.Cyc_List_List*
ret %struct.Cyc_List_List* %10
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_toseqc(i32 %0, %struct.Cyc_List_List* %1) {
%3 = tail call i32 @Cyc_Toseqc_toseqc(%struct.Cyc_List_List* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.Cyc_List_List*
ret %struct.Cyc_List_List* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
struct tm *gmtime_r(const time_t *timep, struct tm *ttm) {
  ttm = gmtime(timep);
  return ttm;
}


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

x86 assembly (clang, -O2):
<gmtime_r>:
jmp    1030 <gmtime@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* nocapture readnone %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
ret %struct.tm* %3
}
/* Variables and functions */
int /*<<< orphan*/ dummy(int);
void pause(int t) {
  int i;
  for (; t > 0; t--) {
    for (i = 5000; i > 0; i--)
      dummy(i);
  }
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115f <pause+0x4f>
movl   $0x1388,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114c <pause+0x3c>
mov    -0x8(%rbp),%edi
call   1030 <dummy@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <pause+0x1c>
jmp    1151 <pause+0x41>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <pause+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1149 <pause+0x39>
mov    %edi,%ebx
nopl   0x0(%rax)
mov    $0x1389,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%ebp
mov    %ebp,%edi
call   1030 <dummy@plt>
cmp    $0x1,%ebp
ja     1130 <pause+0x20>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jg     1120 <pause+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @pause(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
store i32 5000, i32* %3
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %3
%13 = call i32 @dummy(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %8
17: ; preds = %8
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = add nsw i32 %19, -1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @pause(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %10
%4 = phi i32 [ %11, %10 ], [ %0, %1 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 5000, %3 ], [ %8, %5 ]
%7 = tail call i32 @dummy(i32 %6)
%8 = add nsw i32 %6, -1
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5
%11 = add nsw i32 %4, -1
%12 = icmp sgt i32 %4, 1
br i1 %12, label %3, label %13
13: ; preds = %10, %1
ret void
}
/* Variables and functions */
unsigned int ascii_lengthz(char *);
unsigned int buffer_match(char *, char *, unsigned int);
unsigned int ascii_match(char *in1, char *in2) {
  unsigned int n1 = ascii_lengthz(in1);
  unsigned int n2 = ascii_lengthz(in2);
  return buffer_match(in1, in2, (n1 < n2) ? n1 : n2);
}


x86 assembly (clang, -O0):
<ascii_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ascii_lengthz@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ascii_lengthz@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    116f <ascii_match+0x4f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1175 <ascii_match+0x55>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
call   1030 <buffer_match@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_match>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ascii_lengthz@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <ascii_lengthz@plt>
cmp    %eax,%ebp
cmovae %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <buffer_match@plt>

LLVM IR (-O0):
define i32 @ascii_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @ascii_lengthz(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @ascii_lengthz(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp ult i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i32, i32* %5
br label %20
18: ; preds = %2
%19 = load i32, i32* %6
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
%22 = call i32 @buffer_match(i8* %11, i8* %12, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @ascii_match(i8* %0, i8* %1) {
%3 = tail call i32 @ascii_lengthz(i8* %0)
%4 = tail call i32 @ascii_lengthz(i8* %1)
%5 = icmp ult i32 %3, %4
%6 = select i1 %5, i32 %3, i32 %4
%7 = tail call i32 @buffer_match(i8* %0, i8* %1, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ itemDisplayEq();
void input_eq(void) { itemDisplayEq(); }


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

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

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

LLVM IR (-O2):
define void @input_eq() {
%1 = tail call i32 (...) @itemDisplayEq()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509V3_EXT_METHOD;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck, BIO *out,
                     int indent) {
  return 1;
}


x86 assembly (clang, -O0):
<i2r_ocsp_nocheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @i2r_ocsp_nocheck(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @i2r_ocsp_nocheck(i32* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2, i32 %3) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void flusha() {
  fflush(stdout);
  fflush(stdin);
}


x86 assembly (clang, -O0):
<flusha>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flusha>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
define void @flusha() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stdin
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define void @flusha() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stdin
%4 = tail call i32 @fflush(i32 %3)
ret void
}
OP(fd, c0) { op_c0(); }


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 <op_c0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_c0@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 (...) @op_c0()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c0()
ret i32 undef
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_exists(char *file_path) {
  struct stat st;
  return (stat(file_path, &st) == 0);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void EC_GROUP_get_cofactor(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_cofactor() {
ret void
}
int main(void) {
  __builtin_printf("%s %s\n", "Mar 18 2022", "13:16:46");
  __builtin_printf("%s %s\n", "Mar 18 2022", "13:16:46");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xee4(%rip),%rbx
lea    0xee4(%rip),%r14
lea    0xee9(%rip),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"13:16:46\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"13:16:46\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int close(int);
int Close(int sock) { return close(sock); }


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

x86 assembly (clang, -O2):
<Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_ins_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_ins_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_ins_wstr+0x2a>
jmp    1170 <cmd_ins_wstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_ins_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_ins_wstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_ins_wstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
scalar_t__ msg_data(struct tipc_msg *);
struct tipc_msg *msg_get_wrapped(struct tipc_msg *m) {
  return (struct tipc_msg *)msg_data(m);
}


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

x86 assembly (clang, -O2):
<msg_get_wrapped>:
jmp    1030 <msg_data@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define %struct.tipc_msg* @msg_get_wrapped(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i64 @msg_data(%struct.tipc_msg* %3)
%5 = inttoptr i64 %4 to %struct.tipc_msg*
ret %struct.tipc_msg* %5
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define %struct.tipc_msg* @msg_get_wrapped(%struct.tipc_msg* %0) {
%2 = tail call i64 @msg_data(%struct.tipc_msg* %0)
%3 = inttoptr i64 %2 to %struct.tipc_msg*
ret %struct.tipc_msg* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ retval;

/* Variables and functions */
int /*<<< orphan*/ extractAfterLastSlash(char const *, char *, int);
char *pm_arg0toprogname(const char arg0[]) {
  static char retval[64 + 1];
  extractAfterLastSlash(arg0, retval, sizeof(retval));
  return retval;
}


x86 assembly (clang, -O0):
<pm_arg0toprogname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f19(%rip),%rsi
mov    $0x41,%edx
call   1030 <extractAfterLastSlash@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_arg0toprogname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x41,%edx
call   1030 <extractAfterLastSlash@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@pm_arg0toprogname.retval = internal global [65 x i8] zeroinitializer
define i8* @pm_arg0toprogname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @extractAfterLastSlash(i8* %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @pm_arg0toprogname.retval, i64 0, i64 0), i32 65)
ret i8* getelementptr inbounds ([65 x i8], [65 x i8]* @pm_arg0toprogname.retval, i64 0, i64 0)
}

LLVM IR (-O2):
@pm_arg0toprogname.retval = internal global [65 x i8] zeroinitializer
define i8* @pm_arg0toprogname(i8* %0) {
%2 = tail call i32 @extractAfterLastSlash(i8* %0, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @pm_arg0toprogname.retval, i64 0, i64 0), i32 65)
ret i8* getelementptr inbounds ([65 x i8], [65 x i8]* @pm_arg0toprogname.retval, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void pnicorr_debugbreak(const char *s, const char *file, int line) {
  fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, line);
  fflush(stderr);
  raise(SIGABRT);
}


x86 assembly (clang, -O0):
<pnicorr_debugbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnicorr_debugbreak>:
push   %rbx
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2e9f(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Assertion failure: %s, at %s:%d\0A\00"
@SIGABRT = global i32 0
define void @pnicorr_debugbreak(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
%14 = load i32, i32* @SIGABRT
%15 = call i32 @raise(i32 %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Assertion failure: %s, at %s:%d\0A\00"
@SIGABRT = global i32 0
define void @pnicorr_debugbreak(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @SIGABRT
%9 = tail call i32 @raise(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int *);
scalar_t__ malloc(int);
int socket(int namespace_, int style, int protocol) {
  int *ret = (int *)malloc(sizeof(int));
  if (ret) {
    __set_file_attribute(ret);
    if (ret < (int *)1)
      while (1)
        ;
    return (size_t)ret;
  }
  return -1;
}


x86 assembly (clang, -O0):
<socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1178 <socket+0x58>
mov    -0x18(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    $0x1,%eax
cmp    %rax,-0x18(%rbp)
jae    116c <socket+0x4c>
jmp    1167 <socket+0x47>
jmp    1167 <socket+0x47>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    117f <socket+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1142 <socket+0x22>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__set_file_attribute@plt>
test   %rbx,%rbx
jne    1147 <socket+0x27>
jmp    1140 <socket+0x20>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %8
%11 = load i32*, i32** %8
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %24
13: ; preds = %3
%14 = load i32*, i32** %8
%15 = call i32 @__set_file_attribute(i32* %14)
%16 = load i32*, i32** %8
%17 = icmp ult i32* %16, inttoptr (i64 1 to i32*)
br i1 %17, label %18, label %20
18: ; preds = %13
br label %19
19: ; preds = %18, %19
br label %19
20: ; preds = %13
%21 = load i32*, i32** %8
%22 = ptrtoint i32* %21 to i64
%23 = trunc i64 %22 to i32
store i32 %23, i32* %4
br label %25
24: ; preds = %3
store i32 -1, i32* %4
br label %25
25: ; preds = %24, %20
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
%6 = icmp eq i64 %4, 0
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = tail call i32 @__set_file_attribute(i32* %5)
%9 = icmp ult i32* %5, inttoptr (i64 1 to i32*)
br i1 %9, label %10, label %11
10: ; preds = %7, %10
br label %10
11: ; preds = %7
%12 = trunc i64 %4 to i32
br label %13
13: ; preds = %3, %11
%14 = phi i32 [ %12, %11 ], [ -1, %3 ]
ret i32 %14
}
/* Variables and functions */
char *pack_msg(int, char *);
char *read_car(char *car) { return pack_msg(55, car); }


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

x86 assembly (clang, -O2):
<read_car>:
mov    %rdi,%rsi
mov    $0x37,%edi
jmp    1030 <pack_msg@plt>

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

LLVM IR (-O2):
define i8* @read_car(i8* %0) {
%2 = tail call i8* @pack_msg(i32 55, i8* %0)
ret i8* %2
}
int board_is_series(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @board_is_series() {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int get_integer(char *string) {
  char *s = string;
  while (*s)
    if (*s < '0' || *(s++) > '9')
      return -1;
  return atoi(string);
}


x86 assembly (clang, -O0):
<get_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <get_integer+0x5d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     115c <get_integer+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1168 <get_integer+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <get_integer+0x69>
jmp    1124 <get_integer+0x14>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_integer>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1139 <get_integer+0x29>
add    $0x1,%rax
add    $0xc6,%cl
cmp    $0xf6,%cl
jae    1120 <get_integer+0x10>
mov    $0xffffffff,%eax
ret
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @get_integer(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = add i8 %4, -58
%9 = icmp ult i8 %8, -10
br i1 %9, label %12, label %2
10: ; preds = %2
%11 = tail call i32 @atoi(i8* %0)
br label %12
12: ; preds = %6, %10
%13 = phi i32 [ %11, %10 ], [ -1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(int);
int print_last_digit(int n) {
  int other = n % 10;
  if (n < 0) {
    n = n * -1;
    _putchar(n % 10 + '0');
    return (n % 10);
  } else {
    _putchar(other + '0');
    return (n % 10);
  }
}


x86 assembly (clang, -O0):
<print_last_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1162 <print_last_digit+0x52>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <_putchar@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    117b <print_last_digit+0x6b>
mov    -0xc(%rbp),%edi
add    $0x30,%edi
call   1030 <_putchar@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_last_digit>:
push   %rbx
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
mov    %edx,%ebx
neg    %ebx
test   %eax,%eax
cmovns %edx,%ebx
lea    0x30(%rbx),%edi
call   1030 <_putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_last_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = srem i32 %5, 10
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, -1
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = srem i32 %12, 10
%14 = add nsw i32 %13, 48
%15 = call i32 @_putchar(i32 %14)
%16 = load i32, i32* %3
%17 = srem i32 %16, 10
store i32 %17, i32* %2
br label %24
18: ; preds = %1
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 48
%21 = call i32 @_putchar(i32 %20)
%22 = load i32, i32* %3
%23 = srem i32 %22, 10
store i32 %23, i32* %2
br label %24
24: ; preds = %18, %9
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @print_last_digit(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp slt i32 %0, 0
%4 = sub nsw i32 0, %2
%5 = sub nsw i32 0, %2
%6 = select i1 %3, i32 %5, i32 %2
%7 = add nsw i32 %6, 48
%8 = select i1 %3, i32 %4, i32 %2
%9 = tail call i32 @_putchar(i32 %7)
ret i32 %8
}
int fun448() { return 448; }


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

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

LLVM IR (-O0):
define i32 @fun448() {
ret i32 448
}

LLVM IR (-O2):
define i32 @fun448() {
ret i32 448
}
int test_imm_03int8_reg(signed char val) {
  return ((val) & (-0x03 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_03int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xfffffffd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_03int8_reg>:
test   $0xfd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_03int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -3
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_03int8_reg(i8 signext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int number_lowers(int lower_result, int current_number_lowers) {
  if (lower_result == 5) {
    current_number_lowers++;
  }
  return current_number_lowers;
}


x86 assembly (clang, -O0):
<number_lowers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    111d <number_lowers+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_lowers>:
xor    %eax,%eax
cmp    $0x5,%edi
sete   %al
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @number_lowers(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 = icmp eq i32 %5, 5
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @number_lowers(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 5
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
void f5(signed char a, short b) {}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f5(i8 signext %0, i16 signext %1) {
ret void
}
void open_out(void) {}


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

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

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

LLVM IR (-O2):
define void @open_out() {
ret void
}
int ceillog2(int radix) {
  int y = radix, n = 0;
  while ((y >> 1) > 0) {
    y >>= 1;
    n++;
  }
  if ((1 << n) != radix) {
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<ceillog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
cmp    $0x0,%eax
jle    113a <ceillog2+0x3a>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <ceillog2+0x14>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
je     1156 <ceillog2+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceillog2>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jl     111c <ceillog2+0x1c>
xor    %ecx,%ecx
mov    %edi,%edx
mov    %edi,%eax
nopl   (%rax)
shr    %eax
add    $0x1,%ecx
cmp    $0x3,%edx
mov    %eax,%edx
ja     1110 <ceillog2+0x10>
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    %edi,%edx
setne  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceillog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = ashr i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %4
%17 = shl i32 1, %16
%18 = load i32, i32* %2
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %23
23: ; preds = %20, %15
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @ceillog2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = shl nuw i32 1, %10
%12 = icmp ne i32 %11, %0
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %10, %13
ret i32 %14
}
void EC_POINT_clear_free(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_clear_free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_UNIVERSALSTRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_UNIVERSALSTRING_it;
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ASN1_UNIVERSALSTRING_it);
}


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

x86 assembly (clang, -O2):
<ASN1_UNIVERSALSTRING_free>:
mov    0x2ee1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@ASN1_UNIVERSALSTRING_it = global i32 0
define void @ASN1_UNIVERSALSTRING_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @ASN1_UNIVERSALSTRING_it)
ret void
}

LLVM IR (-O2):
@ASN1_UNIVERSALSTRING_it = global i32 0
define void @ASN1_UNIVERSALSTRING_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ASN1_UNIVERSALSTRING_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asin(int);
double ln_rad_to_deg(int /*<<< orphan*/);
double ln_get_alt_from_airmass(double X, double airmass_scale) {
  return ln_rad_to_deg(
      asin((2 * airmass_scale + 1 - X * X) / (2 * X * airmass_scale)));
}


x86 assembly (clang, -O0):
<ln_get_alt_from_airmass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xec5(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe88(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <asin@plt>
mov    %eax,%edi
call   1030 <ln_rad_to_deg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_alt_from_airmass>:
push   %rax
movapd %xmm0,%xmm2
addsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm1
addsd  0xec7(%rip),%xmm1
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <asin@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ln_rad_to_deg@plt>

LLVM IR (-O0):
define double @ln_get_alt_from_airmass(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %5, double 1.000000e+00)
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fneg double %7
%10 = call double @llvm.fmuladd.f64(double %9, double %8, double %6)
%11 = load double, double* %3
%12 = fmul double 2.000000e+00, %11
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = fdiv double %10, %14
%16 = fptosi double %15 to i32
%17 = call i32 @asin(i32 %16)
%18 = call double @ln_rad_to_deg(i32 %17)
ret double %18
}

LLVM IR (-O2):
define double @ln_get_alt_from_airmass(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double 1.000000e+00)
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %3)
%6 = fmul double %0, 2.000000e+00
%7 = fmul double %6, %1
%8 = fdiv double %5, %7
%9 = fptosi double %8 to i32
%10 = tail call i32 @asin(i32 %9)
%11 = tail call double @ln_rad_to_deg(i32 %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128SpiP__SPI__sleep();
void Atm128SpiP__Spi__sleep(void) { HplAtm128SpiP__SPI__sleep(); }


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

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

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

LLVM IR (-O2):
define void @Atm128SpiP__Spi__sleep() {
%1 = tail call i32 (...) @HplAtm128SpiP__SPI__sleep()
ret void
}
/* Variables and functions */
int MIDI_GetVolume();
int MUSIC_GetVolume(void) { return (MIDI_GetVolume()); }


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

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

LLVM IR (-O0):
define i32 @MUSIC_GetVolume() {
%1 = call i32 (...) @MIDI_GetVolume()
ret i32 %1
}

LLVM IR (-O2):
define i32 @MUSIC_GetVolume() {
%1 = tail call i32 (...) @MIDI_GetVolume()
ret i32 %1
}