xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char *SnapshotV3_WriteByte(unsigned char *, unsigned char);
unsigned char *SnapshotV3_WriteWord(unsigned char *buffer,
                                    unsigned short WordData) {
  unsigned char ByteData;
  ByteData = WordData & 0x0ff;
  buffer = SnapshotV3_WriteByte(buffer, ByteData);
  ByteData = (WordData >> 8) & 0x0ff;
  buffer = SnapshotV3_WriteByte(buffer, ByteData);
  return buffer;
}


x86 assembly (clang, -O0):
<SnapshotV3_WriteWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xb(%rbp),%esi
call   1030 <SnapshotV3_WriteByte@plt>
mov    %rax,-0x8(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xb(%rbp),%esi
call   1030 <SnapshotV3_WriteByte@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SnapshotV3_WriteWord>:
push   %rbx
mov    %esi,%ebx
movzbl %bl,%esi
call   1030 <SnapshotV3_WriteByte@plt>
shr    $0x8,%ebx
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <SnapshotV3_WriteByte@plt>

LLVM IR (-O0):
define i8* @SnapshotV3_WriteWord(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %5
%12 = call i8* @SnapshotV3_WriteByte(i8* %10, i8 zeroext %11)
store i8* %12, i8** %3
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i8*, i8** %3
%19 = load i8, i8* %5
%20 = call i8* @SnapshotV3_WriteByte(i8* %18, i8 zeroext %19)
store i8* %20, i8** %3
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @SnapshotV3_WriteWord(i8* %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i8* @SnapshotV3_WriteByte(i8* %0, i8 zeroext %3)
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
%7 = tail call i8* @SnapshotV3_WriteByte(i8* %4, i8 zeroext %6)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ south_occluded_fill(int, int);
void south_occluded_fill_test(void **state) {
  assert_int_equal(
      south_occluded_fill(0x0000002400000000ul, 0x00FFFFFFFFFFFF00ul),
      0x0000002424242400ul);
}


x86 assembly (clang, -O0):
<south_occluded_fill_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0xffffff00,%esi
call   1040 <south_occluded_fill@plt>
mov    %eax,%edi
mov    $0x24242400,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<south_occluded_fill_test>:
push   %rax
xor    %edi,%edi
mov    $0xffffff00,%esi
call   1040 <south_occluded_fill@plt>
mov    %eax,%edi
mov    $0x24242400,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @south_occluded_fill_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @south_occluded_fill(i32 0, i32 -256)
%4 = call i32 @assert_int_equal(i32 %3, i32 606348288)
ret void
}

LLVM IR (-O2):
define void @south_occluded_fill_test(i8** nocapture readnone %0) {
%2 = tail call i32 @south_occluded_fill(i32 0, i32 -256)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 606348288)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void str_delete(char *s, char *p) {
  if (p < s)
    return;
  if (*p == '\0')
    return;
  memmove(p, p + 1, strlen(p));
}


x86 assembly (clang, -O0):
<str_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1143 <str_delete+0x23>
jmp    1184 <str_delete+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1158 <str_delete+0x38>
jmp    1184 <str_delete+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_delete>:
push   %r14
push   %rbx
push   %rax
cmp    %rdi,%rsi
jb     1151 <str_delete+0x31>
mov    %rsi,%rbx
cmpb   $0x0,(%rsi)
je     1151 <str_delete+0x31>
lea    0x1(%rbx),%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memmove@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @str_delete(i8* readnone %0, i8* %1) {
%3 = icmp ult i8* %1, %0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = tail call i32 @strlen(i8* %1)
%10 = tail call i32 @memmove(i8* %1, i8* %8, i32 %9)
br label %11
11: ; preds = %4, %2, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check(long array[], int length) {
  int i;
  for (i = 0; i < length - 1; i++) {
    if (array[i] > array[i + 1]) {
      abort();
    }
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1174 <check+0x64>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,8),%rax
jle    1161 <check+0x51>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1166 <check+0x56>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <check+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
add    $0xffffffff,%esi
xor    %eax,%eax
test   %esi,%esi
cmovle %eax,%esi
nopl   0x0(%rax,%rax,1)
cmp    %rax,%rsi
je     113e <check+0x2e>
mov    (%rdi,%rax,8),%rcx
lea    0x1(%rax),%rdx
cmp    0x8(%rdi,%rax,8),%rcx
mov    %rdx,%rax
jle    1120 <check+0x10>
xor    %eax,%eax
call   1030 <abort@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @check(i64* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = getelementptr inbounds i64, i64* %0, i64 %7
%11 = load i64, i64* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i64, i64* %0, i64 %12
%14 = load i64, i64* %13
%15 = icmp sgt i64 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %9
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %6
ret void
}
/* Type definitions */
typedef int posix_madvise;

/* Variables and functions */
int /*<<< orphan*/ POSIX_MADV_SEQUENTIAL;
int main(void) {
  static char buf[256];
  return (posix_madvise)(buf, sizeof buf, POSIX_MADV_SEQUENTIAL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@main.buf = internal global [256 x i8] zeroinitializer
@POSIX_MADV_SEQUENTIAL = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @POSIX_MADV_SEQUENTIAL
ret i32 %2
}

LLVM IR (-O2):
@POSIX_MADV_SEQUENTIAL = global i32 0
define i32 @main() {
%1 = load i32, i32* @POSIX_MADV_SEQUENTIAL
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_client_info_list() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_client_info_list"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_context_get_client_info_list\0A\00"
define i32 @pa_context_get_client_info_list() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_context_get_client_info_list\00"
define i32 @pa_context_get_client_info_list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void tube_Mouse(unsigned int *reg) {}


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

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

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

LLVM IR (-O2):
define void @tube_Mouse(i32* nocapture %0) {
ret void
}
void D(void) {}


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

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

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

LLVM IR (-O2):
define void @D() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void EssentialFunc10(char *Input) {
  char Buffer2S[140];
  strcpy(Buffer2S, Input);
}


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

x86 assembly (clang, -O2):
<EssentialFunc10>:
sub    $0x98,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x98,%rsp
ret

LLVM IR (-O0):
define void @EssentialFunc10(i8* %0) {
%2 = alloca i8*
%3 = alloca [140 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [140 x i8], [140 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @EssentialFunc10(i8* %0) {
%2 = alloca [140 x i8]
%3 = getelementptr inbounds [140 x i8], [140 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncasecmp(char const *, char const *, int /*<<< orphan*/);
bool istreq_prefix(const char *s1, const char *s2) {
  return strncasecmp(s1, s2, strlen(s1)) == 0;
}


x86 assembly (clang, -O0):
<istreq_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<istreq_prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @istreq_prefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncasecmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @istreq_prefix(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int CalcFatorVencto(data)
char *data;
{
  int d, m, a;
  sscanf(data, "%d/%d/%d", &d, &m, &a);
  if (a < 100)
    a += 1900;
  return (Date2Int(d, m, a) - 729747);
}


x86 assembly (clang, -O0):
<CalcFatorVencto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
mov    $0x0,%al
call   1030 <sscanf@plt>
cmpl   $0x64,-0x14(%rbp)
jge    115f <CalcFatorVencto+0x3f>
mov    -0x14(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <Date2Int@plt>
sub    $0xb2293,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcFatorVencto>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0xc(%rsp),%edx
cmp    $0x63,%edx
jg     1154 <CalcFatorVencto+0x34>
add    $0x76c,%edx
mov    %edx,0xc(%rsp)
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <Date2Int@plt>
add    $0xfff4dd6d,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d/%d/%d\00"
define i32 @CalcFatorVencto(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1900
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @Date2Int to i32 (i32, i32, i32, ...)*)(i32 %14, i32 %15, i32 %16)
%18 = sub nsw i32 %17, 729747
ret i32 %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d/%d/%d\00"
define i32 @CalcFatorVencto(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = add nsw i32 %9, 1900
store i32 %12, i32* %4
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ %12, %11 ], [ %9, %1 ]
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @Date2Int to i32 (i32, i32, i32, ...)*)(i32 %15, i32 %16, i32 %14)
%18 = add nsw i32 %17, -729747
ret i32 %18
}
/* Variables and functions */
scalar_t__ mik_islower(int);
int mik_toupper(int c) { return ((mik_islower(c)) ? (c & ~('a' - 'A')) : c); }


x86 assembly (clang, -O0):
<mik_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mik_islower@plt>
cmp    $0x0,%rax
je     113b <mik_toupper+0x2b>
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <mik_toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mik_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <mik_islower@plt>
mov    %ebx,%ecx
and    $0xffffffdf,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mik_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @mik_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, -33
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @mik_toupper(i32 %0) {
%2 = tail call i64 @mik_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
int security_bprm_check(struct linux_binprm *bprm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.linux_binprm = type opaque
define i32 @security_bprm_check(%struct.linux_binprm* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setDoublePrecision();
void initialisePlatform() { setDoublePrecision(); }


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

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

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

LLVM IR (-O2):
define void @initialisePlatform() {
%1 = tail call i32 (...) @setDoublePrecision()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Object_attack(void *self, int damage) {
  printf("You can't attack that\n");
  return 0;
}


x86 assembly (clang, -O0):
<Object_attack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Object_attack>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"You can't attack that\0A\00"
define i32 @Object_attack(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"You can't attack that\00"
define i32 @Object_attack(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *_itoa(int v) {
  static char buf[16];
  sprintf(buf, "%d", v);
  return buf;
}


x86 assembly (clang, -O0):
<_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_itoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@_itoa.buf = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @_itoa(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @_itoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @_itoa.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void tell(char *what) { write(2, what, strlen(what)); }


x86 assembly (clang, -O0):
<tell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tell>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @tell(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @tell(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
int test_imm_CDuint16_reg(unsigned short val) {
  return ((val) & (0xCD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CDuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 205
%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_CDuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 205
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int *a) {
  int i = 1;
  while (i <= a[0]) {
    printf("%d;", a[i]);
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jg     1157 <printArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printArray+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %rbx
cmpl   $0x0,(%rdi)
jle    1149 <printArray+0x39>
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movslq (%r15),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1130 <printArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d;\00"
define void @printArray(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = icmp sle i32 %5, %8
br i1 %9, label %10, label %19
10: ; preds = %4
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d;\00"
define void @printArray(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 1
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 1, %1 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %5, 1
%10 = load i32, i32* %0
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %5, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int _pack2(int /*<<< orphan*/, int /*<<< orphan*/);
short cosf(short);
int /*<<< orphan*/ roundf(short);
short sinf(short);
unsigned mkPolar_fun_short(short r, short t) {
  return _pack2(roundf(r * cosf(t)), roundf(r * sinf(t)));
}


x86 assembly (clang, -O0):
<mkPolar_fun_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ax
movswl %ax,%edi
call   1050 <cosf@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%eax
movswl %cx,%ecx
imul   %ecx,%eax
movswl %ax,%edi
call   1060 <roundf@plt>
mov    %eax,-0x8(%rbp)
movswl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ax
movswl %ax,%edi
call   1030 <sinf@plt>
mov    %ax,%cx
mov    -0xc(%rbp),%eax
movswl %cx,%ecx
imul   %ecx,%eax
movswl %ax,%edi
call   1060 <roundf@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_pack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkPolar_fun_short>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1050 <cosf@plt>
imul   %ebp,%eax
movswl %ax,%edi
call   1060 <roundf@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <sinf@plt>
imul   %ebp,%eax
movswl %ax,%edi
call   1060 <roundf@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_pack2@plt>

LLVM IR (-O0):
define i32 @mkPolar_fun_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = call signext i16 @cosf(i16 signext %7)
%9 = sext i16 %8 to i32
%10 = mul nsw i32 %6, %9
%11 = trunc i32 %10 to i16
%12 = call i32 @roundf(i16 signext %11)
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = load i16, i16* %4
%16 = call signext i16 @sinf(i16 signext %15)
%17 = sext i16 %16 to i32
%18 = mul nsw i32 %14, %17
%19 = trunc i32 %18 to i16
%20 = call i32 @roundf(i16 signext %19)
%21 = call i32 @_pack2(i32 %12, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @mkPolar_fun_short(i16 signext %0, i16 signext %1) {
%3 = tail call signext i16 @cosf(i16 signext %1)
%4 = mul i16 %3, %0
%5 = tail call i32 @roundf(i16 signext %4)
%6 = tail call signext i16 @sinf(i16 signext %1)
%7 = mul i16 %6, %0
%8 = tail call i32 @roundf(i16 signext %7)
%9 = tail call i32 @_pack2(i32 %5, i32 %8)
ret i32 %9
}
int mask(int a, int b) { return -(a == b); }


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @mask(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mask(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int first_avail_fd() {
  int fd;
  fd = open("test.txt", O_RDONLY);
  printf("fd = %d\n", fd);
  close(fd);
  return fd;
}


x86 assembly (clang, -O0):
<first_avail_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_avail_fd>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@O_RDONLY = global i32 0
@.str.1 = [9 x i8] c"fd = %d\0A\00"
define i32 @first_avail_fd() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @close(i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@O_RDONLY = global i32 0
@.str.1 = [9 x i8] c"fd = %d\0A\00"
define i32 @first_avail_fd() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @close(i32 %2)
ret i32 %2
}
const char *integck_get_description(void) {
  return "Create a directory named integck_test_dir_pid "
         "where pid is the process id. "
         "Randomly create and delete files and directories. "
         "Randomly write to and truncate files. "
         "Un-mount and re-mount test file "
         "system (if it is not the root file system ). "
         "Check data. Make more random changes. "
         "Un-mount and re-mount again. Check again. "
         "Repeat some number of times. "
         "The repeat count is set by the -n or --repeat option, "
         "otherwise it defaults to 1. "
         "A repeat count of zero repeats forever.";
}


x86 assembly (clang, -O0):
<integck_get_description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<integck_get_description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [471 x i8] c"Create a directory named integck_test_dir_pid where pid is the process id. Randomly create and delete files and directories. Randomly write to and truncate files. Un-mount and re-mount test file system (if it is not the root file system ). Check data. Make more random changes. Un-mount and re-mount again. Check again. Repeat some number of times. The repeat count is set by the -n or --repeat option, otherwise it defaults to 1. A repeat count of zero repeats forever.\00"
define i8* @integck_get_description() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"Create a directory named integck_test_dir_pid where pid is the process id. Randomly create and delete files and directories. Randomly write to and truncate files. Un-mount and re-mount test file system (if it is not the root file system ). Check data. Make more random changes. Un-mount and re-mount again. Check again. Repeat some number of times. The repeat count is set by the -n or --repeat option, otherwise it defaults to 1. A repeat count of zero repeats forever.\00"
define i8* @integck_get_description() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
char *_putc(char ch, char *pbuffer, char *buffer, unsigned int buffer_len) {
  if ((unsigned int)((pbuffer - buffer) + 1) >= buffer_len)
    return 0;
  *(pbuffer++) = ch;
  *(pbuffer) = '\0';
  return pbuffer;
}


x86 assembly (clang, -O0):
<_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
cmp    -0x24(%rbp),%eax
jb     113a <_putc+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    115d <_putc+0x5d>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_putc>:
mov    %esi,%eax
sub    %edx,%eax
add    $0x1,%eax
cmp    %ecx,%eax
jae    1117 <_putc+0x17>
lea    0x1(%rsi),%rax
mov    %dil,(%rsi)
movb   $0x0,0x1(%rsi)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @_putc(i8 signext %0, i8* %1, i8* %2, i32 %3) {
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = add i32 %8, 1
%10 = icmp ult i32 %9, %3
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %0, i8* %1
store i8 0, i8* %12
br label %13
13: ; preds = %4, %11
%14 = phi i8* [ %12, %11 ], [ null, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ nsbuf;

/* Variables and functions */
int /*<<< orphan*/ ns_c_in;
int /*<<< orphan*/ ns_t_mx;
scalar_t__ res_query(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/ *, int);
int check_mx(char *domain) {
  u_char nsbuf[4096];
  return res_query(domain, ns_c_in, ns_t_mx, nsbuf, sizeof(nsbuf)) > 0;
}


x86 assembly (clang, -O0):
<check_mx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4010,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
lea    -0x4010(%rbp),%rcx
mov    $0x4000,%r8d
call   1030 <res_query@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x4010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mx>:
sub    $0x4008,%rsp
mov    0x2eca(%rip),%rax
mov    (%rax),%esi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    $0x4000,%r8d
call   1030 <res_query@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x4008,%rsp
ret

LLVM IR (-O0):
@ns_c_in = global i32 0
@ns_t_mx = global i32 0
define i32 @check_mx(i8* %0) {
%2 = alloca i8*
%3 = alloca [4096 x i32]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @ns_c_in
%6 = load i32, i32* @ns_t_mx
%7 = getelementptr inbounds [4096 x i32], [4096 x i32]* %3, i64 0, i64 0
%8 = call i64 @res_query(i8* %4, i32 %5, i32 %6, i32* %7, i32 16384)
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@ns_c_in = global i32 0
@ns_t_mx = global i32 0
define i32 @check_mx(i8* %0) {
%2 = alloca [4096 x i32]
%3 = bitcast [4096 x i32]* %2 to i8*
%4 = load i32, i32* @ns_c_in
%5 = load i32, i32* @ns_t_mx
%6 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
%7 = call i64 @res_query(i8* %0, i32 %4, i32 %5, i32* %6, i32 16384)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
int isxdigit(int c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
         (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 90
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int core5_swap(char *, int);
int U_EMRREALIZEPALETTE_swap(char *record, int torev) {
  return (core5_swap(record, torev));
}


x86 assembly (clang, -O0):
<U_EMRREALIZEPALETTE_swap>:
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 <core5_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRREALIZEPALETTE_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRREALIZEPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ gethostname(char *, size_t);
int al_get_hostname(char *buf, size_t len) {
  if (gethostname(buf, len) != 0) {
    return -1;
  }
  buf[len - 1] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<al_get_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gethostname@plt>
cmp    $0x0,%rax
je     1143 <al_get_hostname+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <al_get_hostname+0x4a>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_get_hostname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <gethostname@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1134 <al_get_hostname+0x24>
movb   $0x0,-0x1(%r14,%rbx,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @al_get_hostname(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = load i64, i64* %5
%8 = call i64 @gethostname(i8* %6, i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %16
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
store i32 0, i32* %3
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @al_get_hostname(i8* %0, i64 %1) {
%3 = tail call i64 @gethostname(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = add i64 %1, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_abrt(int signo) { printf("SIGABRT caught\n"); }


x86 assembly (clang, -O0):
<sig_abrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"SIGABRT caught\0A\00"
define void @sig_abrt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"SIGABRT caught\00"
define void @sig_abrt(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int xio_set_log_level(int level) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @xio_set_log_level(i32 %0) {
ret i32 -1
}
/* Variables and functions */
char *lastchar(char *);
char *backslash(char *path) {
  char *p;
  p = lastchar(path);
  if (*p && !(*p == '/')) {
    if (*p != '\\')
      p++;
    *p = '/';
    *(++p) = 0;
  }
  return (path);
}


x86 assembly (clang, -O0):
<backslash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lastchar@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117f <backslash+0x6f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     117f <backslash+0x6f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1165 <backslash+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backslash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lastchar@plt>
mov    (%rax),%cl
test   %cl,%cl
je     1132 <backslash+0x22>
cmp    $0x2f,%cl
je     1132 <backslash+0x22>
cmp    $0x5c,%cl
je     112d <backslash+0x1d>
add    $0x1,%rax
movw   $0x2f,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @backslash(i8* returned %0) {
%2 = tail call i8* @lastchar(i8* %0)
%3 = load i8, i8* %2
switch i8 %3, label %4 [
i8 0, label %9
i8 47, label %9
i8 92, label %6
]
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
store i8 47, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %8
br label %9
9: ; preds = %1, %1, %6
ret i8* %0
}
void dummy_fillcircle(long r) { r = r; }


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

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

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

LLVM IR (-O2):
define void @dummy_fillcircle(i64 %0) {
ret void
}