xunge/DecIR huggingface dataset:
/* Variables and functions */
bool ascii_isdigit(int c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<ascii_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ascii_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ascii_isdigit(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 label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ascii_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void test95_ArrMod_targetInit__I() {}


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

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

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

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

/* Type definitions */
struct TYPE_2__ {
  int width;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_width(void *_p, int _v) {
  ((XWindowAttributes *)_p)->width = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_width>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_width(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getwd(char *);
int /*<<< orphan*/ strcat(char *, char *);
void Q_getwd(char *out) {
  getwd(out);
  strcat(out, "/");
}


x86 assembly (clang, -O0):
<Q_getwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getwd@plt>
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_getwd>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getwd@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @Q_getwd(i8* %0) {
%2 = tail call i32 @getwd(i8* %0)
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int ch) {
  if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66) || isdigit(ch))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112f <isxdigit+0x1f>
cmpl   $0x46,-0x8(%rbp)
jle    1155 <isxdigit+0x45>
cmpl   $0x61,-0x8(%rbp)
jl     1143 <isxdigit+0x33>
cmpl   $0x66,-0x8(%rbp)
jle    1155 <isxdigit+0x45>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1161 <isxdigit+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1168 <isxdigit+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x41(%rdi),%ecx
cmp    $0x25,%ecx
ja     112e <isxdigit+0x1e>
mov    $0x1,%eax
movabs $0x3f0000003f,%rdx
bt     %rcx,%rdx
jae    112e <isxdigit+0x1e>
ret
push   %rax
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 70
br i1 %8, label %19, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 102
br i1 %14, label %19, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = call i64 @isdigit(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15, %12, %6
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
switch i32 %0, label %2 [
i32 102, label %6
i32 101, label %6
i32 100, label %6
i32 99, label %6
i32 98, label %6
i32 97, label %6
i32 70, label %6
i32 69, label %6
i32 68, label %6
i32 67, label %6
i32 66, label %6
i32 65, label %6
]
2: ; preds = %1
%3 = tail call i64 @isdigit(i32 %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ %5, %2 ]
ret i32 %7
}
int bst_comp_uint(void *data1, void *data2) {
  return *((unsigned int *)data1) - *((unsigned int *)data2);
}


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

x86 assembly (clang, -O2):
<bst_comp_uint>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @bst_comp_uint(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bst_comp_uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %4, %6
ret i32 %7
}
__attribute__((no, noclone)) short foo4(short arg) {
  short ret = 1;
  if (arg + 1 < 12 || arg + 1 > ((!0) ? ((1L << (sizeof(short) * 8 - 1)) - 1)
                                      : ((1L << (sizeof(short) * 8)) - 1)) +
                                    1)
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xc,%eax
jl     1136 <foo4+0x36>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x8000,%rax
jle    1143 <foo4+0x43>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1161 <foo4+0x61>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
lea    0x1(%rdi),%ecx
cmp    $0xb,%di
mov    $0x1,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo4(i16 signext %0) {
%2 = alloca i16
%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 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, 12
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = icmp sgt i64 %13, 32768
br i1 %14, label %15, label %17
15: ; preds = %9, %1
%16 = load i16, i16* %4
store i16 %16, i16* %2
br label %26
17: ; preds = %9
%18 = load i16, i16* %3
%19 = sext i16 %18 to i32
%20 = add nsw i32 %19, 1
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = trunc i16 %22 to i8
%24 = sext i8 %23 to i16
store i16 %24, i16* %4
%25 = load i16, i16* %3
store i16 %25, i16* %2
br label %26
26: ; preds = %17, %15
%27 = load i16, i16* %2
ret i16 %27
}

LLVM IR (-O2):
define signext i16 @foo4(i16 signext %0) {
%2 = add i16 %0, 1
%3 = icmp slt i16 %0, 11
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
size_t lmc_string_len(char *s) { return *(size_t *)s; }


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

x86 assembly (clang, -O2):
<lmc_string_len>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @lmc_string_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @lmc_string_len(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void WriteMagicBytes(int tfd) {
  write(tfd, "Name515635200", strlen("Name515635200"));
}


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

x86 assembly (clang, -O2):
<WriteMagicBytes>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Name515635200\00"
define void @WriteMagicBytes(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int ls_costN_nm8_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_costN_nm8_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_costN_nm8_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_costN_nm8_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_costN_nm8_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_costN_nm8_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm8_work>:
test   %rdi,%rdi
je     110b <ls_costN_nm8_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <ls_costN_nm8_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_costN_nm8_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_costN_nm8_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ls_costN_nm8_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%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
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 1, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 1, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @ls_costN_nm8_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
void justWork(unsigned load) {
  unsigned j;
  for (j = 0; j < load; j++) {
  };
}


x86 assembly (clang, -O0):
<justWork>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112d <justWork+0x2d>
jmp    111f <justWork+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <justWork+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @justWork(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage: reader <samplesfile> <channel>\n\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: reader <samplesfile> <channel>\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Usage: reader <samplesfile> <channel>\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Update(char *, char *, char *);
int HandleSubmitSYSUPD() {
  return Update("SYSUPD", "/local/root/sysupdate.sh",
                "chmod +x /local/root/sysupdate.sh"
                " && /local/root/sysupdate.sh"
                " && rm -f /local/root/sysupdate.sh");
}


x86 assembly (clang, -O0):
<HandleSubmitSYSUPD>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf2c(%rip),%rsi
lea    0xede(%rip),%rdx
call   1030 <Update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleSubmitSYSUPD>:
lea    0xee9(%rip),%rdi
lea    0xf30(%rip),%rsi
lea    0xee2(%rip),%rdx
jmp    1030 <Update@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SYSUPD\00"
@.str.1 = [25 x i8] c"/local/root/sysupdate.sh\00"
@.str.2 = [96 x i8] c"chmod +x /local/root/sysupdate.sh && /local/root/sysupdate.sh && rm -f /local/root/sysupdate.sh\00"
define i32 @HandleSubmitSYSUPD() {
%1 = call i32 @Update(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"SYSUPD\00"
@.str.1 = [25 x i8] c"/local/root/sysupdate.sh\00"
@.str.2 = [96 x i8] c"chmod +x /local/root/sysupdate.sh && /local/root/sysupdate.sh && rm -f /local/root/sysupdate.sh\00"
define i32 @HandleSubmitSYSUPD() {
%1 = tail call i32 @Update(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
scalar_t__ declare_arrayN(int, int, int, int);
double **declare_double(int first, int second) {
  return (double **)declare_arrayN(2, sizeof(double), first, second);
}


x86 assembly (clang, -O0):
<declare_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <declare_arrayN@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declare_double>:
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x8,%esi
jmp    1030 <declare_arrayN@plt>

LLVM IR (-O0):
define double** @declare_double(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @declare_arrayN(i32 2, i32 8, i32 %5, i32 %6)
%8 = inttoptr i64 %7 to double**
ret double** %8
}

LLVM IR (-O2):
define double** @declare_double(i32 %0, i32 %1) {
%3 = tail call i64 @declare_arrayN(i32 2, i32 8, i32 %0, i32 %1)
%4 = inttoptr i64 %3 to double**
ret double** %4
}
int BIO_fd_non_fatal_error(int err) {
  switch (err) {
    return (1);
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_fd_non_fatal_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <BIO_fd_non_fatal_error+0xc>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BIO_fd_non_fatal_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @BIO_fd_non_fatal_error(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int isLowerOrDigitStr(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void isLowerOrDigitStrTestC() {
  bool result = isLowerOrDigitStr("", 0);
  assert(result == true);
  printf("Test successful.");
}


x86 assembly (clang, -O0):
<isLowerOrDigitStrTestC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1050 <isLowerOrDigitStr@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLowerOrDigitStrTestC>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1050 <isLowerOrDigitStr@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeac(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [17 x i8] c"Test successful.\00"
define void @isLowerOrDigitStrTestC() {
%1 = alloca i32
%2 = call i32 @isLowerOrDigitStr(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [17 x i8] c"Test successful.\00"
define void @isLowerOrDigitStrTestC() {
%1 = tail call i32 @isLowerOrDigitStr(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double machine_epsilon() {
  int i;
  double x = 1.0;
  for (i = 0; i < 52; i++)
    x /= 2;
  return x;
}


x86 assembly (clang, -O0):
<machine_epsilon>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x34,-0x4(%rbp)
jge    1146 <machine_epsilon+0x46>
movsd  -0x10(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <machine_epsilon+0x18>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<machine_epsilon>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @machine_epsilon() {
%1 = alloca i32
%2 = alloca double
store double 1.000000e+00, double* %2
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 52
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load double, double* %2
%8 = fdiv double %7, 2.000000e+00
store double %8, double* %2
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @machine_epsilon() {
ret double 0x3CB0000000000000
}
/* Variables and functions */
int /*<<< orphan*/ abort();
f() { abort(); }


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ two();
int main() {
  two();
  sleep(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @two()
%2 = tail call i32 @sleep(i32 1)
ret i32 0
}
unsigned long USBHostAddrGet(unsigned long ulBase, unsigned long ulEndpoint,
                             unsigned long ulFlags) {
  ;

  ;
  if (ulFlags & 0x00002000) {
    return ((*(
        (volatile unsigned char *)(ulBase + 0x00000080 + (ulEndpoint >> 1)))));
  } else {
    return ((*((volatile unsigned char *)(ulBase + 0x00000080 + 4 +
                                          (ulEndpoint >> 1)))));
  }
}


x86 assembly (clang, -O0):
<USBHostAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     1147 <USBHostAddrGet+0x47>
mov    -0x10(%rbp),%rax
add    $0x80,%rax
mov    -0x18(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    (%rax),%al
movzbl %al,%eax
mov    %rax,-0x8(%rbp)
jmp    1169 <USBHostAddrGet+0x69>
mov    -0x10(%rbp),%rax
add    $0x80,%rax
add    $0x4,%rax
mov    -0x18(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    (%rax),%al
movzbl %al,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostAddrGet>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
lea    (%rdi,%rax,4),%rax
shr    %rsi
movzbl 0x80(%rsi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define i64 @USBHostAddrGet(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 8192
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 132, i64 128
%7 = add i64 %6, %0
%8 = lshr i64 %1, 1
%9 = add i64 %7, %8
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = zext i8 %11 to i64
ret i64 %12
}
void read_employee_database(const char *file_name) { return; }


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

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

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

LLVM IR (-O2):
define void @read_employee_database(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t softfloat_shortShift64RightJam(uint64_t a, unsigned int count) {
  return a >> count | ((a & (((uint64_t)1 << count) - 1)) != 0);
}


x86 assembly (clang, -O0):
<softfloat_shortShift64RightJam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0xc(%rbp),%ecx
sub    $0x1,%edx
and    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shortShift64RightJam>:
mov    %esi,%ecx
mov    %edi,%edx
shr    %cl,%edx
mov    $0xffffffff,%esi
shl    %cl,%esi
not    %esi
xor    %eax,%eax
test   %edi,%esi
setne  %al
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @softfloat_shortShift64RightJam(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = shl i32 1, %9
%11 = sub i32 %10, 1
%12 = and i32 %8, %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
%15 = or i32 %7, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @softfloat_shortShift64RightJam(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = shl nsw i32 -1, %1
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = or i32 %3, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ __update_pidfile(int);
int /*<<< orphan*/ isns_fatal(char *, char const *);
int open(char const *, int /*<<< orphan*/);
void isns_update_pidfile(const char *filename) {
  int fd;
  fd = open(filename, O_WRONLY);
  if (fd < 0) {
    isns_fatal("Error opening pid file %s: %m\n", filename);
  }
  __update_pidfile(fd);
}


x86 assembly (clang, -O0):
<isns_update_pidfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116b <isns_update_pidfile+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <isns_fatal@plt>
mov    -0xc(%rbp),%edi
call   1050 <__update_pidfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isns_update_pidfile>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1159 <isns_update_pidfile+0x29>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <isns_fatal@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <__update_pidfile@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@.str = [31 x i8] c"Error opening pid file %s: %m\0A\00"
define void @isns_update_pidfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @isns_fatal(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = call i32 @__update_pidfile(i32 %13)
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@.str = [31 x i8] c"Error opening pid file %s: %m\0A\00"
define void @isns_update_pidfile(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @isns_fatal(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @__update_pidfile(i32 %3)
ret void
}
double copy_double(const double _val) { return _val; }


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

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

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

LLVM IR (-O2):
define double @copy_double(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void util_printfix(long i) {
  if ((i & 0x80000000) != 0) {
    printf("-");
    i = ~i + 1;
  }
  printf("%ld.%04ld", i >> 16, 10000 * (unsigned long)(i & 0xffff) >> 16);
}


x86 assembly (clang, -O0):
<util_printfix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x80000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1152 <util_printfix+0x42>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
sar    $0x10,%rsi
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
imul   $0x2710,%rax,%rdx
shr    $0x10,%rdx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_printfix>:
push   %rbx
mov    %rdi,%rbx
test   $0x80000000,%ebx
je     1139 <util_printfix+0x19>
mov    $0x2d,%edi
call   1030 <putchar@plt>
neg    %rbx
mov    %rbx,%rsi
sar    $0x10,%rsi
movzwl %bx,%eax
imul   $0x2710,%rax,%rdx
shr    $0x10,%rdx
lea    0xeab(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [10 x i8] c"%ld.%04ld\00"
define void @util_printfix(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2147483648
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %2
%9 = xor i64 %8, -1
%10 = add nsw i64 %9, 1
store i64 %10, i64* %2
br label %11
11: ; preds = %6, %1
%12 = load i64, i64* %2
%13 = ashr i64 %12, 16
%14 = load i64, i64* %2
%15 = and i64 %14, 65535
%16 = mul i64 10000, %15
%17 = lshr i64 %16, 16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %13, i64 %17)
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%ld.%04ld\00"
define void @util_printfix(i64 %0) {
%2 = and i64 %0, 2147483648
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @putchar(i32 45)
%6 = sub i64 0, %0
br label %7
7: ; preds = %4, %1
%8 = phi i64 [ %6, %4 ], [ %0, %1 ]
%9 = ashr i64 %8, 16
%10 = and i64 %8, 65535
%11 = mul nuw nsw i64 %10, 10000
%12 = lshr i64 %11, 16
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %9, i64 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fmtint(char *, int, int, int);
int fputs(char *, int /*<<< orphan*/ *);
int fputd(int d, FILE *f) {
  char buff[32];
  fmtint(buff, d, 10, 1);
  return fputs(buff, f);
}


x86 assembly (clang, -O0):
<fputd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0xa,%edx
mov    $0x1,%ecx
call   1030 <fmtint@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputd>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%edx
mov    $0x1,%ecx
call   1030 <fmtint@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputd(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @fmtint(i8* %6, i32 %7, i32 10, i32 1)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @fputs(i8* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fputd(i32 %0, i32* nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @fmtint(i8* %4, i32 %0, i32 10, i32 1)
%6 = call i32 @fputs(i8* %4, i32* %1)
ret i32 %6
}
sprntf(cpp, c) char **cpp;
char c;
{ return (*(*cpp)++ = c); }


x86 assembly (clang, -O0):
<sprntf>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %al,(%rcx)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprntf>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
movsbl %sil,%eax
ret

LLVM IR (-O0):
define i32 @sprntf(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i8
%5 = trunc i32 %1 to i8
store i8** %0, i8*** %3
store i8 %5, i8* %4
%6 = load i8, i8* %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %7
store i8 %6, i8* %8
%10 = sext i8 %6 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @sprntf(i8** nocapture %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
store i8 %3, i8* %4
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
ret i32 %7
}
void test_1(void) {}


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

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

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

LLVM IR (-O2):
define void @test_1() {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t special_div64(int64_t a, int64_t b) {
  int64_t t = (a >= (b << 1));
  a -= t * (b << 1);
  return (t << 1) + (a >= b);
}


x86 assembly (clang, -O0):
<special_div64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
imul   %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<special_div64>:
lea    (%rsi,%rsi,1),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    %edi,%eax
setle  %dl
cmovle %eax,%ecx
sub    %ecx,%edi
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
lea    (%rax,%rdx,2),%eax
ret

LLVM IR (-O0):
define i32 @special_div64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %7, 1
%9 = icmp sge i32 %6, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = shl i32 %12, 1
%14 = mul nsw i32 %11, %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %5
%18 = shl i32 %17, 1
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = icmp sge i32 %19, %20
%22 = zext i1 %21 to i32
%23 = add nsw i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @special_div64(i32 %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = icmp sgt i32 %3, %0
%5 = select i1 %4, i32 0, i32 %3
%6 = sub nsw i32 %0, %5
%7 = select i1 %4, i32 0, i32 2
%8 = icmp sge i32 %6, %1
%9 = zext i1 %8 to i32
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("Hello %d:%d\n", getuid(), getgid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello %d:%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void xor_reg64_imm32(int reg64, unsigned int imm32) {
  put8(0x48);
  put8(0x81);
  put8(0xF0 + reg64);
  put32(imm32);
}


x86 assembly (clang, -O0):
<xor_reg64_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xf0,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_reg64_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xf0,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @xor_reg64_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 129)
%7 = load i32, i32* %3
%8 = add nsw i32 240, %7
%9 = call i32 @put8(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @xor_reg64_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 129)
%5 = add nsw i32 %0, 240
%6 = tail call i32 @put8(i32 %5)
%7 = tail call i32 @put32(i32 %1)
ret void
}
void __attribute__((weak)) _or1k_board_exit(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<_or1k_board_exit>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <_or1k_board_exit+0x9>
jmp    1109 <_or1k_board_exit+0x9>

x86 assembly (clang, -O2):
<_or1k_board_exit>:
jmp    1100 <_or1k_board_exit>

LLVM IR (-O0):
define weak void @_or1k_board_exit() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @_or1k_board_exit() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ MicroDelay(int);
void Delay(unsigned char val) {
  unsigned char i;
  for (i = 0; i < val; i++) {
    MicroDelay(0xFFFF);
    MicroDelay(0xFFFF);
    MicroDelay(0xFFFF);
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    115d <Delay+0x4d>
mov    $0xffff,%edi
call   1030 <MicroDelay@plt>
mov    $0xffff,%edi
call   1030 <MicroDelay@plt>
mov    $0xffff,%edi
call   1030 <MicroDelay@plt>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1122 <Delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
push   %rbx
test   %edi,%edi
je     1143 <Delay+0x33>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xffff,%edi
call   1030 <MicroDelay@plt>
mov    $0xffff,%edi
call   1030 <MicroDelay@plt>
mov    $0xffff,%edi
call   1030 <MicroDelay@plt>
add    $0xff,%bl
jne    1120 <Delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Delay(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
br label %4
4: ; preds = %14, %1
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = call i32 @MicroDelay(i32 65535)
%12 = call i32 @MicroDelay(i32 65535)
%13 = call i32 @MicroDelay(i32 65535)
br label %14
14: ; preds = %10
%15 = load i8, i8* %3
%16 = add i8 %15, 1
store i8 %16, i8* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %8, %3 ], [ 0, %1 ]
%5 = tail call i32 @MicroDelay(i32 65535)
%6 = tail call i32 @MicroDelay(i32 65535)
%7 = tail call i32 @MicroDelay(i32 65535)
%8 = add nuw i8 %4, 1
%9 = icmp eq i8 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bpf_error(char *);
int pfaction_to_num(const char *action) {
  bpf_error("libpcap was compiled on a machine without pf support");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"libpcap was compiled on a machine without pf support\00"
define i32 @pfaction_to_num(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @bpf_error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [53 x i8] c"libpcap was compiled on a machine without pf support\00"
define i32 @pfaction_to_num(i8* nocapture readnone %0) {
%2 = tail call i32 @bpf_error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_mem(char *buf) { free(buf); }


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

x86 assembly (clang, -O2):
<free_mem>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}