xunge/DecIR huggingface dataset:
long long bar_long_long(void) { return __real__(foo_long_long(2LL - 3LLi)); }


x86 assembly (clang, -O0):
<bar_long_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x2,-0x10(%rbp)
movq   $0xfffffffffffffffd,-0x8(%rbp)
ff
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <foo_long_long@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_long_long>:
push   %rax
mov    $0x2,%edi
mov    $0xfffffffffffffffd,%rsi
xor    %eax,%eax
call   1030 <foo_long_long@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @bar_long_long() {
%1 = alloca { i64, i64 }
%2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 1
store i64 2, i64* %2
store i64 -3, i64* %3
%4 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = call i32 (i64, i64, ...) bitcast (i32 (...)* @foo_long_long to i32 (i64, i64, ...)*)(i64 %5, i64 %7)
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @bar_long_long() {
%1 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @foo_long_long to i32 (i64, i64, ...)*)(i64 2, i64 -3)
%2 = sext i32 %1 to i64
ret i64 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t naive_popcount32(uint32_t x) {
  uint32_t c;
  c = 0;
  while (x != 0) {
    x &= (x - 1);
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<naive_popcount32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <naive_popcount32+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <naive_popcount32+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_popcount32>:
xor    %eax,%eax
test   %edi,%edi
je     111c <naive_popcount32+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <naive_popcount32+0x10>
ret

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

LLVM IR (-O2):
define i32 @naive_popcount32(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int mod(int a, int b) { return a % b; }


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

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct snd_kcontrol {
  int dummy;
};

/* Variables and functions */
int _snd_ctl_add_slave(struct snd_kcontrol *, struct snd_kcontrol *, int);
int snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
                               struct snd_kcontrol *slave) {
  return _snd_ctl_add_slave(master, slave, (1 << 0));
}


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

x86 assembly (clang, -O2):
<snd_ctl_add_slave_uncached>:
mov    $0x1,%edx
jmp    1030 <_snd_ctl_add_slave@plt>

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

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
define i32 @snd_ctl_add_slave_uncached(%struct.snd_kcontrol* %0, %struct.snd_kcontrol* %1) {
%3 = tail call i32 @_snd_ctl_add_slave(%struct.snd_kcontrol* %0, %struct.snd_kcontrol* %1, i32 1)
ret i32 %3
}
void dsd_555_vco1_reset(struct node_description *node) {}


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

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

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

LLVM IR (-O2):
%struct.node_description = type opaque
define void @dsd_555_vco1_reset(%struct.node_description* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glVertex2fv(int /*<<< orphan*/ *);
void Vertex2fv(GLfloat v[2]) { glVertex2fv(v); }


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

x86 assembly (clang, -O2):
<Vertex2fv>:
jmp    1030 <glVertex2fv@plt>

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

LLVM IR (-O2):
define void @Vertex2fv(i32* %0) {
%2 = tail call i32 @glVertex2fv(i32* %0)
ret void
}
/* Variables and functions */
int volatile *__errno();
volatile int *__errno_portable() { return __errno(); }


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

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

LLVM IR (-O0):
define i32* @__errno_portable() {
%1 = call i32* (...) @__errno()
ret i32* %1
}

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

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_MARK;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, unsigned int *,
               int *);
int /*<<< orphan*/ perror(char *);
unsigned int get_somark(int sd) {
  unsigned int mark = 0;
  socklen_t optlen = sizeof(mark);
  int rc;
  rc = getsockopt(sd, SOL_SOCKET, SO_MARK, &mark, &optlen);
  if (rc < 0)
    perror("getsockopt(SO_MARK)");
  return mark;
}


x86 assembly (clang, -O0):
<get_somark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1174 <get_somark+0x54>
lea    0xe91(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_somark>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
test   %eax,%eax
js     1158 <get_somark+0x38>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
jmp    1153 <get_somark+0x33>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_MARK = global i32 0
@.str = [20 x i8] c"getsockopt(SO_MARK)\00"
define i32 @get_somark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_MARK
%9 = call i32 @getsockopt(i32 %6, i32 %7, i32 %8, i32* %3, i32* %4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_MARK = global i32 0
@.str = [20 x i8] c"getsockopt(SO_MARK)\00"
define i32 @get_somark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_MARK
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %2
ret i32 %13
}
/* Variables and functions */
int strcasecmp(char *, char *);
int pic_cmp(const void *p1, const void *p2) {
  char *s1 = *(char **)p1, *s2 = *(char **)p2;
  return strcasecmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<pic_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @pic_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void put_unix(FILE *f, char *buf, int len) {
  buf[len] = 0x0a;
  fwrite(buf, len + 1, 1, f);
}


x86 assembly (clang, -O0):
<put_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unix>:
mov    %rsi,%rax
mov    %rdi,%rcx
movslq %edx,%rsi
movb   $0xa,(%rax,%rsi,1)
add    $0x1,%esi
mov    %rax,%rdi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @put_unix(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 10, i8* %10
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = load i32*, i32** %4
%15 = call i32 @fwrite(i8* %11, i32 %13, i32 1, i32* %14)
ret void
}

LLVM IR (-O2):
define void @put_unix(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 10, i8* %5
%6 = add nsw i32 %2, 1
%7 = tail call i32 @fwrite(i8* %1, i32 %6, i32 1, i32* %0)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("pid = %d\n", getpid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pid = %d\0A\00"
define i32 @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"pid = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void __attribute__((noreturn)) __stack_chk_fail(void) {
  panic("__stack_chk_fail()");
}


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

x86 assembly (clang, -O2):
<__stack_chk_fail>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <panic@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"__stack_chk_fail()\00"
define void @__stack_chk_fail() {
%1 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"__stack_chk_fail()\00"
define void @__stack_chk_fail() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int gca_cmp2_uint16(const void *aa, const void *bb, void *p) {
  (void)p;
  const uint16_t a = *(const uint16_t *)aa;
  const uint16_t b = *(const uint16_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp2_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp2_uint16>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp2_uint16(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
store i64 %15, i64* %8
%16 = load i64, i64* %7
%17 = load i64, i64* %8
%18 = icmp sgt i64 %16, %17
%19 = zext i1 %18 to i32
%20 = load i64, i64* %8
%21 = load i64, i64* %7
%22 = icmp sgt i64 %20, %21
%23 = zext i1 %22 to i32
%24 = sub nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @gca_cmp2_uint16(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
%6 = bitcast i8* %1 to i64*
%7 = load i64, i64* %6
%8 = icmp sgt i64 %5, %7
%9 = zext i1 %8 to i32
%10 = icmp sgt i64 %7, %5
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int *cerrar_1_svc(int, struct svc_req *);
int *_cerrar_1(int *argp, struct svc_req *rqstp) {
  return (cerrar_1_svc(*argp, rqstp));
}


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

x86 assembly (clang, -O2):
<_cerrar_1>:
mov    (%rdi),%edi
jmp    1030 <cerrar_1_svc@plt>

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

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32* @_cerrar_1(i32* nocapture %0, %struct.svc_req* %1) {
%3 = load i32, i32* %0
%4 = tail call i32* @cerrar_1_svc(i32 %3, %struct.svc_req* %1)
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned int *, int, int, int /*<<< orphan*/ *);
int a3dsReadInt(FILE *f, unsigned int *l) { return fread(l, 4, 1, f) == 1; }


x86 assembly (clang, -O0):
<a3dsReadInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a3dsReadInt>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @a3dsReadInt(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 = load i32*, i32** %3
%7 = call i32 @fread(i32* %5, i32 4, i32 1, i32* %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @a3dsReadInt(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i32* %1, i32 4, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigpipe_handle(int signal) { exit(4); }


x86 assembly (clang, -O0):
<sigpipe_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigpipe_handle>:
push   %rax
mov    $0x4,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigpipe_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
define void @sigpipe_handle(i32 %0) {
%2 = tail call i32 @exit(i32 4)
unreachable
}
void b_resetDigits(unsigned *xs, int size) {
  for (int i = 0; i < size; i++)
    xs[i] = 0;
}


x86 assembly (clang, -O0):
<b_resetDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <b_resetDigits+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <b_resetDigits+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_resetDigits>:
test   %esi,%esi
jle    1126 <b_resetDigits+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @b_resetDigits(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @b_resetDigits(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int signbit(long double);
int main(void) {
  return signbit(1.0f) | signbit(1.0) | signbit(1.0l);
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
fld1
fstpt  (%rax)
call   1030 <signbit@plt>
mov    %eax,-0xc(%rbp)
mov    %rsp,%rax
fld1
fstpt  (%rax)
call   1030 <signbit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    %rsp,%rax
fld1
fstpt  (%rax)
call   1030 <signbit@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
fld1
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <signbit@plt>
mov    %eax,%ebx
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1030 <signbit@plt>
mov    %eax,%ebp
or     %ebx,%ebp
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1030 <signbit@plt>
or     %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @signbit(x86_fp80 0xK3FFF8000000000000000)
%3 = call i32 @signbit(x86_fp80 0xK3FFF8000000000000000)
%4 = or i32 %2, %3
%5 = call i32 @signbit(x86_fp80 0xK3FFF8000000000000000)
%6 = or i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @signbit(x86_fp80 0xK3FFF8000000000000000)
%2 = tail call i32 @signbit(x86_fp80 0xK3FFF8000000000000000)
%3 = or i32 %2, %1
%4 = tail call i32 @signbit(x86_fp80 0xK3FFF8000000000000000)
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ setPixel_24064(int, int);
void setPixel(int x, int y) { setPixel_24064(x, y); }


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

x86 assembly (clang, -O2):
<setPixel>:
jmp    1030 <setPixel_24064@plt>

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

LLVM IR (-O2):
define void @setPixel(i32 %0, i32 %1) {
%3 = tail call i32 @setPixel_24064(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ turtle_add_action(char *);
void turtle_left() { turtle_add_action("l()\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"l()\0A\00"
define void @turtle_left() {
%1 = call i32 @turtle_add_action(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"l()\0A\00"
define void @turtle_left() {
%1 = tail call i32 @turtle_add_action(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long double strtold(char const *, char **);
long double string_to_ld(const char *nptr, char **endptr) {
  return strtold(nptr, endptr);
}


x86 assembly (clang, -O0):
<string_to_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtold@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_ld>:
jmp    1030 <strtold@plt>

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

LLVM IR (-O2):
define x86_fp80 @string_to_ld(i8* %0, i8** nocapture %1) {
%3 = tail call x86_fp80 @strtold(i8* %0, i8** %1)
ret x86_fp80 %3
}
int b(int i) { return i + 2; }


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

x86 assembly (clang, -O2):
<b>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
char *Tcl_Alloc(size)
unsigned int size;
{
  char *result;
  result = TclpAlloc(size);
  if (result == 0)
    panic("unable to alloc %d bytes", size);
  return result;
}


x86 assembly (clang, -O0):
<Tcl_Alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <TclpAlloc@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <Tcl_Alloc+0x37>
mov    -0x4(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <panic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tcl_Alloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <TclpAlloc@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1142 <Tcl_Alloc+0x22>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <panic@plt>
movslq %ebp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"unable to alloc %d bytes\00"
define i8* @Tcl_Alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @TclpAlloc to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @panic to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"unable to alloc %d bytes\00"
define i8* @Tcl_Alloc(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @TclpAlloc to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @panic to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = sext i32 %2 to i64
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
int test_imm_61int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x61 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_61int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 97
%7 = icmp ne i64 %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_61int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6356992
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t cl_rhash_table_hash_str(const void *key) {
  const uint8_t *str = key;
  uint32_t hash = 5381;
  int c;
  while ((c = *str)) {
    hash = ((hash << 5) + hash) + c;
    str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<cl_rhash_table_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1149 <cl_rhash_table_hash_str+0x49>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <cl_rhash_table_hash_str+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_rhash_table_hash_str>:
mov    (%rdi),%ecx
test   %ecx,%ecx
je     1134 <cl_rhash_table_hash_str+0x34>
add    $0x4,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
mov    (%rdi),%ecx
add    $0x4,%rdi
mov    %eax,%edx
test   %ecx,%ecx
jne    1120 <cl_rhash_table_hash_str+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @cl_rhash_table_hash_str(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ %3, %1 ]
%7 = phi i32* [ %11, %5 ], [ %2, %1 ]
%8 = phi i32 [ %10, %5 ], [ 5381, %1 ]
%9 = mul i32 %8, 33
%10 = add nsw i32 %6, %9
%11 = getelementptr inbounds i32, i32* %7, i64 1
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %5 ]
ret i32 %15
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ is_little_endian();
uint32_t swap_if_big32(uint32_t val) {
  if (is_little_endian())
    return val;
  else
    return (val >> 24) | ((val >> 8) & 0xFF00) | ((val << 8) & 0xFF0000) |
           (val << 24);
}


x86 assembly (clang, -O0):
<swap_if_big32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_little_endian@plt>
cmp    $0x0,%rax
je     1137 <swap_if_big32+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <swap_if_big32+0x54>
mov    -0x8(%rbp),%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_if_big32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_little_endian@plt>
test   %rax,%rax
jne    1143 <swap_if_big32+0x33>
mov    %ebx,%eax
sar    $0x18,%eax
mov    %ebx,%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
mov    %ebx,%edx
shl    $0x8,%edx
and    $0xff0000,%edx
shl    $0x18,%ebx
or     %eax,%ebx
or     %ecx,%ebx
or     %edx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @swap_if_big32(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = ashr i32 %0, 24
%6 = lshr i32 %0, 8
%7 = and i32 %6, 65280
%8 = shl i32 %0, 8
%9 = and i32 %8, 16711680
%10 = shl i32 %0, 24
%11 = or i32 %10, %5
%12 = or i32 %11, %7
%13 = or i32 %12, %9
br label %14
14: ; preds = %1, %4
%15 = phi i32 [ %13, %4 ], [ %0, %1 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int EVP_DigestInit_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) {
  return EVP_DigestInit_ex(ctx, type, NULL);
}


x86 assembly (clang, -O0):
<PEM_SignInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <EVP_DigestInit_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_SignInit>:
xor    %edx,%edx
jmp    1030 <EVP_DigestInit_ex@plt>

LLVM IR (-O0):
define i32 @PEM_SignInit(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 @EVP_DigestInit_ex(i32* %5, i32* %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @PEM_SignInit(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_DigestInit_ex(i32* %0, i32* %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func_stats_add(void const *, int /*<<< orphan*/, size_t);
void *malloc(size_t);
int /*<<< orphan*/ my_hooks();
int /*<<< orphan*/ old_hooks();
void *my_malloc(size_t size, const void *caller) {
  void *ret;
  old_hooks();
  func_stats_add(caller, 0, size);
  ret = malloc(size);
  my_hooks();
  return ret;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <old_hooks@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1050 <func_stats_add@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <my_hooks@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <old_hooks@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <func_stats_add@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <my_hooks@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_malloc(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = call i32 (...) @old_hooks()
%7 = load i8*, i8** %4
%8 = load i64, i64* %3
%9 = call i32 @func_stats_add(i8* %7, i32 0, i64 %8)
%10 = load i64, i64* %3
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %5
%12 = call i32 (...) @my_hooks()
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @my_malloc(i64 %0, i8* %1) {
%3 = tail call i32 (...) @old_hooks()
%4 = tail call i32 @func_stats_add(i8* %1, i32 0, i64 %0)
%5 = tail call i8* @malloc(i64 %0)
%6 = tail call i32 (...) @my_hooks()
ret i8* %5
}
int kread(char *data, int count) {
  log_debug(7, "in %s", __FUNCTION__);
  return count;
}


x86 assembly (clang, -O0):
<kread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x7,%edi
lea    0xed5(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x0,%al
call   1030 <log_debug@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kread>:
push   %rbx
mov    %esi,%ebx
lea    0xee6(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    $0x7,%edi
xor    %eax,%eax
call   1030 <log_debug@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"in %s\00"
@__FUNCTION__.kread = [6 x i8] c"kread\00"
define i32 @kread(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @log_debug to i32 (i32, i8*, i8*, ...)*)(i32 7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.kread, i64 0, i64 0))
%6 = load i32, i32* %4
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"in %s\00"
@__FUNCTION__.kread = [6 x i8] c"kread\00"
define i32 @kread(i8* nocapture readnone %0, i32 returned %1) {
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @log_debug to i32 (i32, i8*, i8*, ...)*)(i32 7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.kread, i64 0, i64 0))
ret i32 %1
}
char *strcpy(char *dst, const char *src) {
  char *s = dst;
  while ((*dst++ = *src++)) {
  }
  return s;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float C, F;
  printf("Insira a temperatura (C°)\n");
  scanf("%f", &C);
  F = ((9 * C) / 5) + 32;
  printf("A temperatura em F° é: %.2f\n", F);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeb3(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xea2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe92(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xea4(%rip),%xmm0
divss  0xea0(%rip),%xmm0
addss  0xe9c(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Insira a temperatura (C\C2\B0)\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [31 x i8] c"A temperatura em F\C2\B0 \C3\A9: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fmul float 9.000000e+00, %6
%8 = fdiv float %7, 5.000000e+00
%9 = fadd float %8, 3.200000e+01
store float %9, float* %3
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [31 x i8] c"A temperatura em F\C2\B0 \C3\A9: %.2f\0A\00"
@str = [27 x i8] c"Insira a temperatura (C\C2\B0)\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 9.000000e+00
%7 = fdiv float %6, 5.000000e+00
%8 = fadd float %7, 3.200000e+01
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int prodbg_main(int, char const **);
int main(int argc, const char *argv[]) { return prodbg_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <prodbg_main@plt>

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
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @prodbg_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @prodbg_main(i32 %0, i8** %1)
ret i32 %3
}
int cairo_code_draw_white_get_height() { return 119; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_white_get_height() {
ret i32 119
}

LLVM IR (-O2):
define i32 @cairo_code_draw_white_get_height() {
ret i32 119
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void EMACRxDMAPollDemand(uint32_t ui32Base) {
  (*((volatile uint32_t *)(ui32Base + 0x00000C08))) = 0;
}


x86 assembly (clang, -O0):
<EMACRxDMAPollDemand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0xc08(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACRxDMAPollDemand>:
movq   $0x0,0xc08(%rdi)
ret

LLVM IR (-O0):
define void @EMACRxDMAPollDemand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 3080
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @EMACRxDMAPollDemand(i64 %0) {
%2 = add nsw i64 %0, 3080
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
void set_winsize(int tty __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @set_winsize(i32 %0) {
ret void
}
int get_subdir_size(int fd, unsigned long *sizep) { return -1; }


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

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

LLVM IR (-O0):
define i32 @get_subdir_size(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @get_subdir_size(i32 %0, i64* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
unsigned long gfx_ind(int);
int /*<<< orphan*/ gfx_outd(int, unsigned long);
unsigned long gfx_pci_config_read(unsigned long address) {
  unsigned long value = 0xFFFFFFFF;
  gfx_outd(0x0CF8, address);
  value = gfx_ind(0x0CFC);
  return (value);
}


x86 assembly (clang, -O0):
<gfx_pci_config_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xcf8,%edi
call   1030 <gfx_outd@plt>
mov    $0xcfc,%edi
call   1040 <gfx_ind@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_pci_config_read>:
push   %rax
mov    %rdi,%rsi
mov    $0xcf8,%edi
call   1030 <gfx_outd@plt>
mov    $0xcfc,%edi
pop    %rax
jmp    1040 <gfx_ind@plt>

LLVM IR (-O0):
define i64 @gfx_pci_config_read(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 4294967295, i64* %3
%4 = load i64, i64* %2
%5 = call i32 @gfx_outd(i32 3320, i64 %4)
%6 = call i64 @gfx_ind(i32 3324)
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @gfx_pci_config_read(i64 %0) {
%2 = tail call i32 @gfx_outd(i32 3320, i64 %0)
%3 = tail call i64 @gfx_ind(i32 3324)
ret i64 %3
}
void page_table_uninit(struct page_table *pt) { return; }


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

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

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

LLVM IR (-O2):
%struct.page_table = type opaque
define void @page_table_uninit(%struct.page_table* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_power(void) {
  printf("The power library is not included in this build\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"The power library is not included in this build\0A\00"
define i32 @test_power() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"The power library is not included in this build\00"
define i32 @test_power() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 0
}