xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
pid_t __fork() { return fork(); }


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

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

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

LLVM IR (-O2):
define i32 @__fork() {
%1 = tail call i32 (...) @fork()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int EINVAL;
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr,
                                     int *prioceiling) {
  (void)attr;
  (void)prioceiling;
  return EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pthread_mutexattr_getprioceiling(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 = load i32, i32* @EINVAL
ret i32 %7
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_mutexattr_getprioceiling(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 f1(__m128 x, __m128 y) { return _mm_cmpord_ss(x, y); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <_mm_cmpord_ss@plt>

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int endswith(char *, char *);
void test_endswith(char *s1, char *s2, int expected) {
  int got = endswith(s1, s2);
  assert(got == expected);
}


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

x86 assembly (clang, -O2):
<test_endswith>:
push   %rbx
mov    %edx,%ebx
call   1030 <endswith@plt>
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test_endswith(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @endswith(i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @test_endswith(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @endswith(i8* %0, i8* %1)
%5 = icmp eq i32 %4, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
unsigned int __fixunsdfsi(double a __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__fixunsdfsi(double %0) {
ret i32 0
}
int d_ne_rc2(double a1) { return !(((a1) != (100))); }


x86 assembly (clang, -O0):
<d_ne_rc2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_rc2>:
cmpeqsd 0xef7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_ne_rc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_ne_rc2(double %0) {
%2 = fcmp oeq double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char const *Concat2_Strings(char const *, char const *);
const char *Concat3_Strings(const char *name1, const char *name2,
                            const char *name3) {
  return Concat2_Strings(name1, Concat2_Strings(name2, name3));
}


x86 assembly (clang, -O0):
<Concat3_Strings>:
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,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Concat2_Strings@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <Concat2_Strings@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Concat3_Strings>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <Concat2_Strings@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <Concat2_Strings@plt>

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

LLVM IR (-O2):
define i8* @Concat3_Strings(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @Concat2_Strings(i8* %1, i8* %2)
%5 = tail call i8* @Concat2_Strings(i8* %0, i8* %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *smartsupportcmd(const char *path, char *cmdresult) {
  sprintf(cmdresult,
          "disktool -i %s | grep 'Device supports SMART and is Enabled' "
          "1>/dev/null 2>/dev/null",
          path);
  return cmdresult;
}


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

x86 assembly (clang, -O2):
<smartsupportcmd>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [85 x i8] c"disktool -i %s | grep 'Device supports SMART and is Enabled' 1>/dev/null 2>/dev/null\00"
define i8* @smartsupportcmd(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 @sprintf(i8* %5, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [85 x i8] c"disktool -i %s | grep 'Device supports SMART and is Enabled' 1>/dev/null 2>/dev/null\00"
define i8* @smartsupportcmd(i8* %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %1
}
/* Variables and functions */
int copy_file(char *, char *);
int action_save(char *args[]) { return copy_file(args[0], args[1]); }


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

x86 assembly (clang, -O2):
<action_save>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rsi
mov    %rax,%rdi
jmp    1030 <copy_file@plt>

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

LLVM IR (-O2):
define i32 @action_save(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @copy_file(i8* %2, i8* %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseqx_set_lowdelay(uint8_t *p_mp2vseqx) { p_mp2vseqx[9] |= 0x8; }


x86 assembly (clang, -O0):
<mp2vseqx_set_lowdelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
or     $0x8,%ecx
mov    %ecx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_set_lowdelay>:
orb    $0x8,0x24(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseqx_set_lowdelay(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 9
%5 = load i32, i32* %4
%6 = or i32 %5, 8
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vseqx_set_lowdelay(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
%4 = or i32 %3, 8
store i32 %4, i32* %2
ret void
}
int fun1360() { return 1360; }


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

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

LLVM IR (-O0):
define i32 @fun1360() {
ret i32 1360
}

LLVM IR (-O2):
define i32 @fun1360() {
ret i32 1360
}
void M_EMPTY(void) {}


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

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

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

LLVM IR (-O2):
define void @M_EMPTY() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memfatal(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *s1 = strdup(s);
  if (!s1)
    memfatal("strdup");
  return s1;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <memfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <memfatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @memfatal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int O_RDWR;
int O_WRONLY;
int libc_open64(char const *, int);
int /*<<< orphan*/ watch_log(char *, char const *);
int __open64(const char *path, int flags, ...) {
  if ((flags & O_WRONLY) || (flags & O_RDWR)) {
    watch_log("open %s w\n", path);
  }
  return libc_open64(path, flags);
}


x86 assembly (clang, -O0):
<__open64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1159 <__open64+0x39>
mov    -0xc(%rbp),%eax
mov    0x2e9a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1169 <__open64+0x49>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <watch_log@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <libc_open64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__open64>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ea0(%rip),%rax
test   %esi,(%rax)
jne    113f <__open64+0x1f>
mov    0x2ead(%rip),%rax
test   %ebx,(%rax)
je     114e <__open64+0x2e>
lea    0xeba(%rip),%rdi
mov    %r14,%rsi
call   1040 <watch_log@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <libc_open64@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_RDWR = global i32 0
@.str = [11 x i8] c"open %s w\0A\00"
define i32 @__open64(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 i32, i32* @O_WRONLY
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* @O_RDWR
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9, %2
%15 = load i8*, i8** %3
%16 = call i32 @watch_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %9
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i32 @libc_open64(i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_RDWR = global i32 0
@.str = [11 x i8] c"open %s w\0A\00"
define i32 @__open64(i8* %0, i32 %1, ...) {
%3 = load i32, i32* @O_WRONLY
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @O_RDWR
%8 = and i32 %7, %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6, %2
%11 = tail call i32 @watch_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %6
%13 = tail call i32 @libc_open64(i8* %0, i32 %1)
ret i32 %13
}
int mop_is_shortopt(const char *arg) {
  return arg != 0 && arg[0] == '-' && arg[1] != '-' && arg[1] != '\0';
}


x86 assembly (clang, -O0):
<mop_is_shortopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1154 <mop_is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    1154 <mop_is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
je     1154 <mop_is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mop_is_shortopt>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <mop_is_shortopt+0x1b>
cmpb   $0x2d,(%rdi)
jne    111b <mop_is_shortopt+0x1b>
mov    0x1(%rdi),%cl
cmp    $0x2d,%cl
je     111b <mop_is_shortopt+0x1b>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @mop_is_shortopt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 45
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = icmp ne i8 %8, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %6, %3, %1
%14 = phi i32 [ 0, %6 ], [ 0, %3 ], [ 0, %1 ], [ %12, %10 ]
ret i32 %14
}
void hugo_init_screen(void) {}


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

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

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

LLVM IR (-O2):
define void @hugo_init_screen() {
ret void
}
int _unlink(const char *pathname) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_unlink(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int isnum(char *buf) {
  for (; *buf; buf++)
    if (!isdigit(*buf))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <isnum+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <isnum+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1167 <isnum+0x57>
jmp    114f <isnum+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isnum+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnum>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isnum+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isnum+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isnum+0x20>
jmp    114b <isnum+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void PWMGenFaultClear(unsigned long ulBase, unsigned long ulGen,
                      unsigned long ulGroup, unsigned long ulFaultTriggers) {
  ;
  ;
  ;

  ;

  ;
  if (ulGroup == 0) {
    (*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                   ((ulGen)-0x00000040) * 2) +
                                  0x00000004))) = ulFaultTriggers;
  } else {
    (*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                   ((ulGen)-0x00000040) * 2) +
                                  0x00000008))) = ulFaultTriggers;
  }
}


x86 assembly (clang, -O0):
<PWMGenFaultClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1145 <PWMGenFaultClear+0x45>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x4(%rax)
jmp    1166 <PWMGenFaultClear+0x66>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultClear>:
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
lea    (%rdi,%rax,4),%rax
mov    %rcx,0x784(%rax,%rsi,2)
ret

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

LLVM IR (-O2):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
%6 = shl i64 %1, 1
%7 = select i1 %5, i64 1924, i64 1928
%8 = add i64 %7, %0
%9 = add i64 %8, %6
%10 = inttoptr i64 %9 to i64*
store volatile i64 %3, i64* %10
ret void
}
/* Variables and functions */
scalar_t__ isprime(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int n;
  for (n = 2; n < 100; ++n) {
    if (isprime(n)) {
      printf("%d ", n);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1176 <main+0x56>
mov    -0x8(%rbp),%edi
call   1040 <isprime@plt>
cmp    $0x0,%rax
je     1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xec0(%rip),%r14
jmp    1158 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1172 <main+0x42>
mov    %ebx,%edi
call   1050 <isprime@plt>
test   %rax,%rax
je     1150 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 2, %0 ], [ %8, %7 ]
%3 = tail call i64 @isprime(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}
float clamp(float x) {
  return (((x) > (255.)) ? (255.) : (((x) < (0.)) ? (0.) : (x)));
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1136 <clamp+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1171 <clamp+0x71>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1159 <clamp+0x59>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1167 <clamp+0x67>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
xorps  %xmm2,%xmm2
maxss  %xmm0,%xmm2
movss  0xef1(%rip),%xmm3
movaps %xmm3,%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @clamp(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ogt double %4, 2.550000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
br label %17
7: ; preds = %1
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %7
br label %15
12: ; preds = %7
%13 = load float, float* %2
%14 = fpext float %13 to double
br label %15
15: ; preds = %12, %11
%16 = phi double [ 0.000000e+00, %11 ], [ %14, %12 ]
br label %17
17: ; preds = %15, %6
%18 = phi double [ 2.550000e+02, %6 ], [ %16, %15 ]
%19 = fptrunc double %18 to float
ret float %19
}

LLVM IR (-O2):
define float @clamp(float %0) {
%2 = fcmp ogt float %0, 2.550000e+02
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float 0.000000e+00, float %0
%5 = select i1 %2, float 2.550000e+02, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(short *, short const *, int);
scalar_t__ vrna_alloc(int);
short *vrna_ptable_copy(const short *pt) {
  short *table = (short *)vrna_alloc(sizeof(short) * (pt[0] + 2));
  memcpy(table, pt, sizeof(short) * (pt[0] + 2));
  return table;
}


x86 assembly (clang, -O0):
<vrna_ptable_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
add    $0x2,%eax
cltq
shl    $0x1,%rax
mov    %eax,%edi
call   1040 <vrna_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
add    $0x2,%eax
cltq
shl    $0x1,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrna_ptable_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movswl (%rdi),%eax
lea    (%rax,%rax,1),%edi
add    $0x4,%edi
call   1040 <vrna_alloc@plt>
mov    %rax,%r14
movswl (%rbx),%eax
lea    (%rax,%rax,1),%edx
add    $0x4,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i16* @vrna_ptable_copy(i16* %0) {
%2 = alloca i16*
%3 = alloca i16*
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = add nsw i32 %7, 2
%9 = sext i32 %8 to i64
%10 = mul i64 2, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @vrna_alloc(i32 %11)
%13 = inttoptr i64 %12 to i16*
store i16* %13, i16** %3
%14 = load i16*, i16** %3
%15 = load i16*, i16** %2
%16 = load i16*, i16** %2
%17 = getelementptr inbounds i16, i16* %16, i64 0
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = add nsw i32 %19, 2
%21 = sext i32 %20 to i64
%22 = mul i64 2, %21
%23 = trunc i64 %22 to i32
%24 = call i32 @memcpy(i16* %14, i16* %15, i32 %23)
%25 = load i16*, i16** %3
ret i16* %25
}

LLVM IR (-O2):
define i16* @vrna_ptable_copy(i16* %0) {
%2 = load i16, i16* %0
%3 = sext i16 %2 to i32
%4 = shl nsw i32 %3, 1
%5 = add nsw i32 %4, 4
%6 = tail call i64 @vrna_alloc(i32 %5)
%7 = inttoptr i64 %6 to i16*
%8 = load i16, i16* %0
%9 = sext i16 %8 to i32
%10 = shl nsw i32 %9, 1
%11 = add nsw i32 %10, 4
%12 = tail call i32 @memcpy(i16* %7, i16* %0, i32 %11)
ret i16* %7
}
void addpix1(image, bitpix, w, h, bzero, dirale, x, y, dpix) char *image;
int bitpix;
int w;
int h;
double bzero;
double dirale;
int x;
int y;
double dpix;
{
  addpix(image, bitpix, w, h, bzero, dirale, x - 1, y - 1, dpix);
  return;
}


x86 assembly (clang, -O0):
<addpix1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x2c(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x30(%rbp),%r9d
sub    $0x1,%r9d
movsd  -0x38(%rbp),%xmm2
mov    $0x3,%al
call   1030 <addpix@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addpix1>:
add    $0xffffffff,%r8d
add    $0xffffffff,%r9d
mov    $0x3,%al
jmp    1030 <addpix@plt>

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

LLVM IR (-O2):
define void @addpix1(i8* %0, i32 %1, i32 %2, i32 %3, double %4, double %5, i32 %6, i32 %7, double %8) {
%10 = add nsw i32 %6, -1
%11 = add nsw i32 %7, -1
%12 = tail call i32 (i8*, i32, i32, i32, double, double, i32, i32, double, ...) bitcast (i32 (...)* @addpix to i32 (i8*, i32, i32, i32, double, double, i32, i32, double, ...)*)(i8* %0, i32 %1, i32 %2, i32 %3, double %4, double %5, i32 %10, i32 %11, double %8)
ret void
}
int dOponente(int j) {
  if (j == 1) {
    return 5;
  } else {
    return 3;
  }
}


x86 assembly (clang, -O0):
<dOponente>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <dOponente+0x1d>
movl   $0x5,-0x4(%rbp)
jmp    1124 <dOponente+0x24>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dOponente>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
add    %eax,%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @dOponente(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 5, i32 3
ret i32 %3
}
void msm_free_iova_address(unsigned long iova, unsigned int iommu_domain,
                           unsigned int partition_no, unsigned long size) {
  return;
}


x86 assembly (clang, -O0):
<msm_free_iova_address>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @msm_free_iova_address(i64 %0, i32 %1, i32 %2, i64 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sync();
void UNL8157Restore(int version) { Sync(); }


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

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

LLVM IR (-O0):
define void @UNL8157Restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Sync()
ret void
}

LLVM IR (-O2):
define void @UNL8157Restore(i32 %0) {
%2 = tail call i32 (...) @Sync()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void first_init() { printf("Hello World\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define void @first_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define void @first_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail_base_backtrace(char *, char *, char const *,
                                                unsigned int, char const *);
char *strerror_r(int, char *, int);
void __assert_perror_fail_backtrace(int errnum, const char *file,
                                    unsigned int line, const char *function) {
  char errbuf[1024];
  char *e = strerror_r(errnum, errbuf, sizeof errbuf);
  __assert_fail_base_backtrace("%s: %s:%u: %s: Unexpected error: %s.\n", e,
                               file, line, function);
}


x86 assembly (clang, -O0):
<__assert_perror_fail_backtrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1040 <strerror_r@plt>
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xe93(%rip),%rdi
call   1030 <__assert_fail_base_backtrace@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__assert_perror_fail_backtrace>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0x400,%edx
call   1040 <strerror_r@plt>
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r14,%r8
call   1030 <__assert_fail_base_backtrace@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"%s: %s:%u: %s: Unexpected error: %s.\0A\00"
define void @__assert_perror_fail_backtrace(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [1024 x i8]
%10 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%13 = call i8* @strerror_r(i32 %11, i8* %12, i32 1024)
store i8* %13, i8** %10
%14 = load i8*, i8** %10
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = call i32 @__assert_fail_base_backtrace(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15, i32 %16, i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s: %s:%u: %s: Unexpected error: %s.\0A\00"
define void @__assert_perror_fail_backtrace(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = call i8* @strerror_r(i32 %0, i8* %6, i32 1024)
%8 = call i32 @__assert_fail_base_backtrace(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %1, i32 %2, i8* %3)
ret void
}
main() {
  int f(int);
  f("hello"
    "there");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"hellothere\00"
define i32 @main() {
%1 = call i32 @f(i32 ptrtoint ([11 x i8]* @.str to i32))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hellothere\00"
define i32 @main() {
%1 = tail call i32 @f(i32 ptrtoint ([11 x i8]* @.str to i32))
ret i32 0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_beacon(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x0080);
}


x86 assembly (clang, -O0):
<ieee80211_is_beacon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x80,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_beacon>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x80,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_beacon(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 128)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_beacon(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 128)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void memsetup(void) {
  unsigned long const mem_cfg_val[] = {
      0x22011110, 0x00000700, 0x00000700, 0x00000700, 0x00000700,
      0x00000700, 0x00000700, 0x00018005, 0x00018005, 0x008C07A3,
      0x000000B1, 0x00000030, 0x00000030,
  };
  int i = 0;
  volatile unsigned long *p = (volatile unsigned long *)0x48000000;
  for (; i < 13; i++)
    p[i] = mem_cfg_val[i];
}


x86 assembly (clang, -O0):
<memsetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x68,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x74(%rbp)
mov    $0x48000000,%eax
mov    %rax,-0x80(%rbp)
cmpl   $0xd,-0x74(%rbp)
jge    116d <memsetup+0x5d>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rdx
mov    -0x80(%rbp),%rax
movslq -0x74(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1140 <memsetup+0x30>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memsetup>:
movq   $0x22011110,0x48000000
48 10 11 01 22
movq   $0x700,0x48000008
movq   $0x700,0x48000010
movq   $0x700,0x48000018
movq   $0x700,0x48000020
movq   $0x700,0x48000028
movq   $0x700,0x48000030
movq   $0x18005,0x48000038
movq   $0x18005,0x48000040
movq   $0x8c07a3,0x48000048
movq   $0xb1,0x48000050
movq   $0x30,0x48000058
movq   $0x30,0x48000060
ret

LLVM IR (-O0):
@__const.memsetup.mem_cfg_val = [13 x i64] [i64 570495248, i64 1792, i64 1792, i64 1792, i64 1792, i64 1792, i64 1792, i64 98309, i64 98309, i64 9176995, i64 177, i64 48, i64 48]
define void @memsetup() {
%1 = alloca [13 x i64]
%2 = alloca i32
%3 = alloca i64*
%4 = bitcast [13 x i64]* %1 to i8*
store i32 0, i32* %2
store i64* inttoptr (i64 1207959552 to i64*), i64** %3
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 13
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [13 x i64], [13 x i64]* %1, i64 0, i64 %10
%12 = load i64, i64* %11
%13 = load i64*, i64** %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %13, i64 %15
store volatile i64 %12, i64* %16
br label %17
17: ; preds = %8
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @memsetup() {
store volatile i64 570495248, i64* inttoptr (i64 1207959552 to i64*)
store volatile i64 1792, i64* inttoptr (i64 1207959560 to i64*)
store volatile i64 1792, i64* inttoptr (i64 1207959568 to i64*)
store volatile i64 1792, i64* inttoptr (i64 1207959576 to i64*)
store volatile i64 1792, i64* inttoptr (i64 1207959584 to i64*)
store volatile i64 1792, i64* inttoptr (i64 1207959592 to i64*)
store volatile i64 1792, i64* inttoptr (i64 1207959600 to i64*)
store volatile i64 98309, i64* inttoptr (i64 1207959608 to i64*)
store volatile i64 98309, i64* inttoptr (i64 1207959616 to i64*)
store volatile i64 9176995, i64* inttoptr (i64 1207959624 to i64*)
store volatile i64 177, i64* inttoptr (i64 1207959632 to i64*)
store volatile i64 48, i64* inttoptr (i64 1207959640 to i64*)
store volatile i64 48, i64* inttoptr (i64 1207959648 to i64*)
ret void
}
int test_imm_C6uint8_mem(unsigned char *val) {
  return ((*val) & (-0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff3a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C6uint8_mem>:
testb  $0x3a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 58
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void swap(int *a, int *b) {
  int m = *a;
  *a = *b;
  *b = m;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long GetTickCount() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<GetTickCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTickCount>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @GetTickCount() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @GetTickCount() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}