xunge/DecIR huggingface dataset:
/* Type definitions */
struct tp {
  int dummy;
};

/* Variables and functions */
int tp_unfetched(struct tp *);
int tp_replyerrorlen(struct tp *p) { return tp_unfetched(p); }


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

x86 assembly (clang, -O2):
<tp_replyerrorlen>:
jmp    1030 <tp_unfetched@plt>

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

LLVM IR (-O2):
%struct.tp = type { i32 }
define i32 @tp_replyerrorlen(%struct.tp* %0) {
%2 = tail call i32 @tp_unfetched(%struct.tp* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int get_bit(int len, uint64_t *array, int element) {
  int array_index = element / 64;
  element -= (array_index * 64);
  return 1 & (array[array_index] >> (63 - element));
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x3f,%ecx
sub    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
lea    0x3f(%rdx),%ecx
test   %edx,%edx
cmovns %edx,%ecx
mov    %ecx,%eax
sar    $0x6,%eax
cltq
mov    (%rsi,%rax,4),%eax
and    $0xc0,%ecx
sub    %edx,%ecx
add    $0x3f,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sdiv i32 %8, 64
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, 64
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %6
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %6
%20 = sub nsw i32 63, %19
%21 = ashr i32 %18, %20
%22 = and i32 1, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sdiv i32 %2, 64
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = shl nsw i32 %4, 6
%9 = sub i32 63, %2
%10 = add i32 %9, %8
%11 = lshr i32 %7, %10
%12 = and i32 %11, 1
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int setdomainname(const char *name, size_t len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<setdomainname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setdomainname>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @setdomainname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @setdomainname(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ anvil_syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ errno;
int chmod(const char *path, mode_t mode) {
  anvil_syslog(0, "chmod - NOT IMPLEMENTED\n");
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
lea    0xed8(%rip),%rsi
call   1030 <anvil_syslog@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9b(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <anvil_syslog@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    0x2ea9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"chmod - NOT IMPLEMENTED\0A\00"
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @chmod(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@.str = [25 x i8] c"chmod - NOT IMPLEMENTED\0A\00"
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printUsage(const char *programName) {
  static int mExecPrev = 0;
  if (mExecPrev++ != 0)
    return;
  printf("Python Launcher for Android\n"
         "\n"
         "usage: %s [launcher-arguments] [python-arguments]\n"
         "\n"
         "Launcher arguments:\n"
         "\n"
         "-N  : Launch the latest Python N.x version\n"
         "-X.Y: Launch the specified Python version\n"
         "\n"
         "The following help text is from Python:\n\n",
         programName);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
je     113b <printUsage+0x2b>
jmp    114b <printUsage+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    0x2f16(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
test   %eax,%eax
je     1124 <printUsage+0x14>
ret
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@printUsage.mExecPrev = internal global i32 0
@.str = [229 x i8] c"Python Launcher for Android\0A\0Ausage: %s [launcher-arguments] [python-arguments]\0A\0ALauncher arguments:\0A\0A-N : Launch the latest Python N.x version\0A-X.Y: Launch the specified Python version\0A\0AThe following help text is from Python:\0A\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @printUsage.mExecPrev
%4 = add nsw i32 %3, 1
store i32 %4, i32* @printUsage.mExecPrev
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@printUsage.mExecPrev = internal unnamed_addr global i32 0
@.str = [229 x i8] c"Python Launcher for Android\0A\0Ausage: %s [launcher-arguments] [python-arguments]\0A\0ALauncher arguments:\0A\0A-N : Launch the latest Python N.x version\0A-X.Y: Launch the specified Python version\0A\0AThe following help text is from Python:\0A\0A\00"
define void @printUsage(i8* %0) {
%2 = load i32, i32* @printUsage.mExecPrev
%3 = add nsw i32 %2, 1
store i32 %3, i32* @printUsage.mExecPrev
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *s1, const char *s2) {
  strcpy(s1 + strlen(s1), s2);
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ eliminate();
int /*<<< orphan*/ f1(void *, void *);
void g1(void *p, void *q) {
  f1(q, p);
  if (p == 0)
    eliminate();
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <f1@plt>
cmpq   $0x0,-0x8(%rbp)
jne    114f <g1+0x2f>
mov    $0x0,%al
call   1030 <eliminate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <f1@plt>
test   %rbx,%rbx
je     1136 <g1+0x16>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <eliminate@plt>

LLVM IR (-O0):
define void @g1(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 = call i32 @f1(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @eliminate()
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @g1(i8* %0, i8* %1) {
%3 = tail call i32 @f1(i8* %1, i8* %0)
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @eliminate()
br label %7
7: ; preds = %5, %2
ret void
}
int main(int argc, char **argv) { return 10 / 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 poison
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 poison
}
/* Variables and functions */
scalar_t__ isleap(int);
int daysinmonth(int year, int month) {
  int days[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  if (month == 2 && isleap(year))
    return 29;
  return days[month];
}


x86 assembly (clang, -O0):
<daysinmonth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x34,%edx
call   1040 <memcpy@plt>
cmpl   $0x2,-0xc(%rbp)
jne    116b <daysinmonth+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <isleap@plt>
cmp    $0x0,%rax
je     116b <daysinmonth+0x4b>
movl   $0x1d,-0x4(%rbp)
jmp    1176 <daysinmonth+0x56>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daysinmonth>:
push   %rbx
mov    %esi,%ebx
cmp    $0x2,%esi
jne    112c <daysinmonth+0x1c>
call   1030 <isleap@plt>
mov    %rax,%rcx
mov    $0x1d,%eax
test   %rcx,%rcx
je     112c <daysinmonth+0x1c>
pop    %rbx
ret
movslq %ebx,%rax
lea    0xeca(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.daysinmonth.days = [13 x i32] [i32 -1, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @daysinmonth(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [13 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = bitcast [13 x i32]* %6 to i8*
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i64 @isleap(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 29, i32* %3
br label %20
15: ; preds = %10, %2
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %14
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@__const.daysinmonth.days = [13 x i32] [i32 -1, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @daysinmonth(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i64 @isleap(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4, %2
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds [13 x i32], [13 x i32]* @__const.daysinmonth.days, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %4, %7
%12 = phi i32 [ %10, %7 ], [ 29, %4 ]
ret i32 %12
}
int test_imm_9Eint64_lowword_reg(long long val) {
  return ((val) & (0x9E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 158
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void clr6(int *x) { memset(x, 0, 6); }


x86 assembly (clang, -O0):
<clr6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr6>:
xor    %esi,%esi
mov    $0x6,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clr6(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 6)
ret void
}
void deallocate(int ***array, int r) {
  int i;
  for (i = 0; i < r; i++)
    free((*array)[i]);
  free(*array);
  printf("Deallocated memory for array\n");
}


x86 assembly (clang, -O0):
<deallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <deallocate+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <deallocate+0x16>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deallocate>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1155 <deallocate+0x35>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <deallocate+0x20>
mov    (%r14),%rdi
call   1030 <free@plt>
lea    0xe9c(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Deallocated memory for array\0A\00"
define void @deallocate(i32*** %0, i32 %1) {
%3 = alloca i32***
%4 = alloca i32
%5 = alloca i32
store i32*** %0, i32**** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32***, i32**** %3
%12 = load i32**, i32*** %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32*, i32** %12, i64 %14
%16 = load i32*, i32** %15
%17 = bitcast i32* %16 to i8*
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = load i32***, i32**** %3
%23 = load i32**, i32*** %22
%24 = bitcast i32** %23 to i8*
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Deallocated memory for array\00"
define void @deallocate(i32*** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load i32**, i32*** %0
%9 = getelementptr inbounds i32*, i32** %8, i64 %7
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast i32*** %0 to i8**
%16 = load i8*, i8** %15
tail call void @free(i8* %16)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *skipWhite(const char *inString) {
  const char *retval = inString;
  while ('\0' != *retval && isspace(*retval)) {
    retval++;
  }
  return retval;
}


x86 assembly (clang, -O0):
<skipWhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1150 <skipWhite+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1160 <skipWhite+0x50>
jmp    1171 <skipWhite+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skipWhite+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWhite>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skipWhite+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skipWhite+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipWhite+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipWhite(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %17, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 0, %8
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call i64 @isspace(i8 signext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %5
20: ; preds = %15
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skipWhite(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, up, down;
  printf("Input an integer with 3 digits:");
  scanf("%d", &n);
  down = (n / 100) * 100;
  up = down + 99;
  printf("up=%d,down=%d", up, down);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x64,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x63,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%edx
lea    0x63(%rdx),%esi
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Input an integer with 3 digits:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"up=%d,down=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 100
%9 = mul nsw i32 %8, 100
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 99
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Input an integer with 3 digits:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"up=%d,down=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 100
%7 = sub i32 %5, %6
%8 = add nsw i32 %7, 99
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dmmtcadd_(int *, int *, double *, double *, int *, double *,
                             double *, int *);
void wcc_dmmtcadd_(int *M, int *N, char *ALPHA, char *A, int *LDA, char *BETA,
                   char *B, int *LDB) {
  dmmtcadd_(M, N, (double *)ALPHA, (double *)A, LDA, (double *)BETA,
            (double *)B, LDB);
}


x86 assembly (clang, -O0):
<wcc_dmmtcadd_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dmmtcadd_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_dmmtcadd_>:
jmp    1030 <dmmtcadd_@plt>

LLVM IR (-O0):
define void @wcc_dmmtcadd_(i32* %0, i32* %1, i8* %2, i8* %3, i32* %4, i8* %5, i8* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32* %4, i32** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i32* %7, i32** %16
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i8*, i8** %11
%20 = bitcast i8* %19 to double*
%21 = load i8*, i8** %12
%22 = bitcast i8* %21 to double*
%23 = load i32*, i32** %13
%24 = load i8*, i8** %14
%25 = bitcast i8* %24 to double*
%26 = load i8*, i8** %15
%27 = bitcast i8* %26 to double*
%28 = load i32*, i32** %16
%29 = call i32 @dmmtcadd_(i32* %17, i32* %18, double* %20, double* %22, i32* %23, double* %25, double* %27, i32* %28)
ret void
}

LLVM IR (-O2):
define void @wcc_dmmtcadd_(i32* %0, i32* %1, i8* %2, i8* %3, i32* %4, i8* %5, i8* %6, i32* %7) {
%9 = bitcast i8* %2 to double*
%10 = bitcast i8* %3 to double*
%11 = bitcast i8* %5 to double*
%12 = bitcast i8* %6 to double*
%13 = tail call i32 @dmmtcadd_(i32* %0, i32* %1, double* %9, double* %10, i32* %4, double* %11, double* %12, i32* %7)
ret void
}
/* Variables and functions */
int cmp_tx(const void *x, const void *y) {
  int a = ((int *)x)[1], b = ((int *)y)[1];
  return a < b ? -1 : a == b ? 0 : +1;
}


x86 assembly (clang, -O0):
<cmp_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1139 <cmp_tx+0x39>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <cmp_tx+0x4e>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_tx>:
mov    0x4(%rdi),%eax
xor    %ecx,%ecx
cmp    0x4(%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_tx(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %2
br label %25
19: ; preds = %2
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = icmp eq i32 %20, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 0, i32 1
br label %25
25: ; preds = %19, %18
%26 = phi i32 [ -1, %18 ], [ %24, %19 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @cmp_tx(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = getelementptr inbounds i8, i8* %1, i64 4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = icmp slt i32 %5, %8
%10 = icmp ne i32 %5, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
int qeth_create_procfs_entries(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @qeth_create_procfs_entries() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ example1();
int /*<<< orphan*/ example2();
int /*<<< orphan*/ example3();
int /*<<< orphan*/ example4();
int /*<<< orphan*/ example5();
int /*<<< orphan*/ example6();
int /*<<< orphan*/ example7();
int /*<<< orphan*/ example8();
int main(void) {
  example1();
  example2();
  example3();
  example4();
  example5();
  example6();
  example7();
  example8();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <example1@plt>
mov    $0x0,%al
call   1060 <example2@plt>
mov    $0x0,%al
call   10a0 <example3@plt>
mov    $0x0,%al
call   1040 <example4@plt>
mov    $0x0,%al
call   1070 <example5@plt>
mov    $0x0,%al
call   1050 <example6@plt>
mov    $0x0,%al
call   1080 <example7@plt>
mov    $0x0,%al
call   1030 <example8@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <example1@plt>
xor    %eax,%eax
call   1060 <example2@plt>
xor    %eax,%eax
call   10a0 <example3@plt>
xor    %eax,%eax
call   1040 <example4@plt>
xor    %eax,%eax
call   1070 <example5@plt>
xor    %eax,%eax
call   1050 <example6@plt>
xor    %eax,%eax
call   1080 <example7@plt>
xor    %eax,%eax
call   1030 <example8@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @example1()
%3 = call i32 (...) @example2()
%4 = call i32 (...) @example3()
%5 = call i32 (...) @example4()
%6 = call i32 (...) @example5()
%7 = call i32 (...) @example6()
%8 = call i32 (...) @example7()
%9 = call i32 (...) @example8()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example1()
%2 = tail call i32 (...) @example2()
%3 = tail call i32 (...) @example3()
%4 = tail call i32 (...) @example4()
%5 = tail call i32 (...) @example5()
%6 = tail call i32 (...) @example6()
%7 = tail call i32 (...) @example7()
%8 = tail call i32 (...) @example8()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", "Hello, World!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ w(struct generator *, char *);
void generate_start_comment(struct generator *g) {
  w(g, "~N/* This file was generated automatically by the Snowball to ANSI C "
       "compiler */~N");
}


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

x86 assembly (clang, -O2):
<generate_start_comment>:
lea    0xee9(%rip),%rsi
jmp    1030 <w@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
@.str = [83 x i8] c"~N/* This file was generated automatically by the Snowball to ANSI C compiler */~N\00"
define void @generate_start_comment(%struct.generator* %0) {
%2 = alloca %struct.generator*
store %struct.generator* %0, %struct.generator** %2
%3 = load %struct.generator*, %struct.generator** %2
%4 = call i32 @w(%struct.generator* %3, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
@.str = [83 x i8] c"~N/* This file was generated automatically by the Snowball to ANSI C compiler */~N\00"
define void @generate_start_comment(%struct.generator* %0) {
%2 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
ret void
}
float __floatdisf(long x) { return (float)(double)x; }


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

x86 assembly (clang, -O2):
<__floatdisf>:
cvtsi2sd %rdi,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @__floatdisf(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @__floatdisf(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fptrunc double %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: eye <-c <server_ip> | -s> [-i <interval>]\n");
  printf("\t-s\tStandalone mode\n");
  printf("\t-c\tConnected mode\n");
  printf("\t-i <interval> Time (in seconds) between 2 refreshes\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"usage: eye <-c <server_ip> | -s> [-i <interval>]\0A\00"
@.str.1 = [21 x i8] c"\09-s\09Standalone mode\0A\00"
@.str.2 = [20 x i8] c"\09-c\09Connected mode\0A\00"
@.str.3 = [54 x i8] c"\09-i <interval> Time (in seconds) between 2 refreshes\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"usage: eye <-c <server_ip> | -s> [-i <interval>]\00"
@str.4 = [20 x i8] c"\09-s\09Standalone mode\00"
@str.5 = [19 x i8] c"\09-c\09Connected mode\00"
@str.6 = [53 x i8] c"\09-i <interval> Time (in seconds) between 2 refreshes\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test(int n) {
  if (n > 10) {
    printf("aaa");
    if (n < 30) {
      printf("bbb");
    }
  } else {
    printf("ccc");
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    114c <test+0x3c>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1e,-0x8(%rbp)
jge    1147 <test+0x37>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <test+0x48>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
cmp    $0xb,%edi
jl     1132 <test+0x22>
mov    %edi,%ebx
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x1d,%ebx
ja     113e <test+0x2e>
lea    0xed4(%rip),%rdi
jmp    1139 <test+0x29>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"aaa\00"
@.str.1 = [4 x i8] c"bbb\00"
@.str.2 = [4 x i8] c"ccc\00"
define i32 @test(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp ult i32 %0, 30
br i1 %5, label %6, label %9
6: ; preds = %1, %3
%7 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %1 ]
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %6, %3
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerPrescaleMatchGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;

  ;
  return ((ui32Timer == 0x000000ff)
              ? (*((volatile uint32_t *)(ui32Base + 0x00000040)))
              : (*((volatile uint32_t *)(ui32Base + 0x00000044))));
}


x86 assembly (clang, -O0):
<TimerPrescaleMatchGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    1129 <TimerPrescaleMatchGet+0x29>
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <TimerPrescaleMatchGet+0x36>
mov    -0x4(%rbp),%eax
add    $0x44,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleMatchGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x40(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @TimerPrescaleMatchGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 64
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 68
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
br label %19
19: ; preds = %13, %7
%20 = phi i32 [ %12, %7 ], [ %18, %13 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @TimerPrescaleMatchGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 64, i32 68
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(int argc, char *argv[], char *envp[]) {
  test(-5);
  test(-2);
  test(0);
  test(argc);
  test(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xfffffffb,%edi
call   1030 <test@plt>
mov    $0xfffffffe,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
mov    -0x8(%rbp),%edi
call   1030 <test@plt>
mov    $0x5,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
mov    $0xfffffffb,%edi
call   1030 <test@plt>
mov    $0xfffffffe,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
mov    %ebx,%edi
call   1030 <test@plt>
mov    $0x5,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @test(i32 -5)
%9 = call i32 @test(i32 -2)
%10 = call i32 @test(i32 0)
%11 = load i32, i32* %5
%12 = call i32 @test(i32 %11)
%13 = call i32 @test(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @test(i32 -5)
%5 = tail call i32 @test(i32 -2)
%6 = tail call i32 @test(i32 0)
%7 = tail call i32 @test(i32 %0)
%8 = tail call i32 @test(i32 5)
ret i32 0
}
/* Variables and functions */
int f15(int *);
int f16(int *p) { return f15(p); }


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

x86 assembly (clang, -O2):
<f16>:
jmp    1030 <f15@plt>

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

LLVM IR (-O2):
define i32 @f16(i32* %0) {
%2 = tail call i32 @f15(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GmfSetLin(int, int, int *);
int gmfsetsolf77_(int *MshIdx, int *kwd, int *SolTab) {
  GmfSetLin(*MshIdx, *kwd, SolTab);
  return (1);
}


x86 assembly (clang, -O0):
<gmfsetsolf77_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1030 <GmfSetLin@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmfsetsolf77_>:
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <GmfSetLin@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gmfsetsolf77_(i32* nocapture %0, i32* nocapture %1, i32* %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @GmfSetLin(i32 %4, i32 %5, i32* %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ incr(int);
int main() {
  int b = 2;
  incr(b);
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @incr(i32 2)
ret i32 2
}
int test_imm_4Euint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x4E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Euint64_midword_reg>:
test   $0x4e0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Euint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5111808
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *btjpg_malloc(size_t sz) {
  void *ptr;
  ptr = malloc(sz);
  memset(ptr, 0, sz);
  return (ptr);
}


x86 assembly (clang, -O0):
<btjpg_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btjpg_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @btjpg_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @btjpg_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
size_t stringLength(char *String) {
  size_t Result = 0;
  for (; *String; ++String, ++Result) {
  }
  return Result;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <stringLength+0x3f>
jmp    1122 <stringLength+0x22>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <stringLength+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
cmpb   $0x0,(%rdi)
je     111f <stringLength+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <stringLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @stringLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}