xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int cdstr(int ch) {
  int chmod;
  chmod = ch % 10;
  if (ch >= 10) {
    cdstr(ch / 10);
  }
  printf("%c", chmod + 48);
}


x86 assembly (clang, -O0):
<cdstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1155 <cdstr+0x35>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <cdstr@plt>
mov    -0xc(%rbp),%esi
add    $0x30,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdstr>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jl     113c <cdstr+0x1c>
mov    %ebx,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
call   1040 <cdstr@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%esi
add    $0x30,%esi
lea    0xe99(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @cdstr(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = udiv i32 %0, 10
%5 = tail call i32 @cdstr(i32 %4)
br label %6
6: ; preds = %3, %1
%7 = srem i32 %0, 10
%8 = add nsw i32 %7, 48
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ count(unsigned int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int n = 0;
  scanf("%u", &n);
  printf("%llu\n", count(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <count@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @count(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void fetch_and_add(int *variable, int value) {
  __asm__ volatile("lock; addl %0, %1"
                   : "+r"(value), "+m"(*variable)
                   :
                   : "memory");
}


x86 assembly (clang, -O0):
<fetch_and_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
lock add %eax,(%rcx)
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_and_add>:
lock add %esi,(%rdi)
ret

LLVM IR (-O0):
define void @fetch_and_add(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 asm sideeffect "lock; addl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %6, i32 %5, i32* elementtype(i32) %6)
store i32 %7, i32* %4
ret void
}

LLVM IR (-O2):
define void @fetch_and_add(i32* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "lock; addl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1, i32* elementtype(i32) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const uint8_t *skip_fixed32(const uint8_t *buffer, const uint8_t *buffer_end) {
  buffer += 4;
  if (buffer_end >= buffer)
    return buffer;
  return NULL;
}


x86 assembly (clang, -O0):
<skip_fixed32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1133 <skip_fixed32+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113b <skip_fixed32+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_fixed32>:
lea    0x10(%rdi),%rcx
xor    %eax,%eax
cmp    %rsi,%rcx
cmovbe %rcx,%rax
ret

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

LLVM IR (-O2):
define i32* @skip_fixed32(i32* readnone %0, i32* readnone %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = icmp ugt i32* %3, %1
%5 = select i1 %4, i32* null, i32* %3
ret i32* %5
}
char **getNames() {}


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

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

LLVM IR (-O0):
define i8** @getNames() {
%1 = alloca i8**
%2 = load i8**, i8*** %1
ret i8** %2
}

LLVM IR (-O2):
define noalias i8** @getNames() {
ret i8** undef
}
/* Type definitions */
struct mq_attr {
  int mq_maxmsg;
  int mq_msgsize;
  scalar_t__ mq_flags;
};
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ mq_open(char *, int, int, struct mq_attr *);
mqd_t setUpQueue(char *qname) {
  struct mq_attr attr;
  mqd_t q;
  attr.mq_maxmsg = 10;
  attr.mq_msgsize = 4096 + 1;
  attr.mq_flags = 0;
  return mq_open(qname, O_RDWR | O_CREAT, 0664, &attr);
}


x86 assembly (clang, -O0):
<setUpQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x1001,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
or     (%rax),%esi
mov    $0x1b4,%edx
lea    -0x18(%rbp),%rcx
call   1030 <mq_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setUpQueue>:
sub    $0x18,%rsp
movabs $0x10010000000a,%rax
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ead(%rip),%rax
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0x8(%rsp),%rcx
mov    $0x1b4,%edx
call   1030 <mq_open@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.mq_attr = type { i32, i32, i64 }
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @setUpQueue(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.mq_attr
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %3, i32 0, i32 0
store i32 10, i32* %5
%6 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %3, i32 0, i32 1
store i32 4097, i32* %6
%7 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %3, i32 0, i32 2
store i64 0, i64* %7
%8 = load i8*, i8** %2
%9 = load i32, i32* @O_RDWR
%10 = load i32, i32* @O_CREAT
%11 = or i32 %9, %10
%12 = call i32 @mq_open(i8* %8, i32 %11, i32 436, %struct.mq_attr* %3)
ret i32 %12
}

LLVM IR (-O2):
%struct.mq_attr = type { i32, i32, i64 }
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @setUpQueue(i8* %0) {
%2 = alloca %struct.mq_attr
%3 = bitcast %struct.mq_attr* %2 to i8*
%4 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i64 0, i32 0
store i32 10, i32* %4
%5 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i64 0, i32 1
store i32 4097, i32* %5
%6 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i64 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* @O_RDWR
%8 = load i32, i32* @O_CREAT
%9 = or i32 %8, %7
%10 = call i32 @mq_open(i8* %0, i32 %9, i32 436, %struct.mq_attr* %2)
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xexpose_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xexpose.window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xexpose_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void isr_int_double_fault(long error_code) {}


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

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

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

LLVM IR (-O2):
define void @isr_int_double_fault(i64 %0) {
ret void
}
/* Variables and functions */
int versioned();
int main(void) { return versioned(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @versioned()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
scalar_t__ KeyPress;
const char *event2str(XEvent ev) {
  return ev.type == KeyPress ? "KeyPress" : "KeyRelease";
}


x86 assembly (clang, -O0):
<event2str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    0x2ed5(%rip),%rax
mov    (%rax),%rsi
lea    0xeec(%rip),%rax
lea    0xedc(%rip),%rcx
cmp    %rsi,%rdx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<event2str>:
mov    0x2ee1(%rip),%rax
cmp    %rdi,(%rax)
lea    0xeef(%rip),%rcx
lea    0xef1(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@KeyPress = global i64 0
@.str = [9 x i8] c"KeyPress\00"
@.str.1 = [11 x i8] c"KeyRelease\00"
define i8* @event2str(i64 %0) {
%2 = alloca %struct.TYPE_3__
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
store i64 %0, i64* %3
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @KeyPress
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
ret i8* %9
}

LLVM IR (-O2):
@KeyPress = global i64 0
@.str = [9 x i8] c"KeyPress\00"
@.str.1 = [11 x i8] c"KeyRelease\00"
define i8* @event2str(i64 %0) {
%2 = load i64, i64* @KeyPress
%3 = icmp eq i64 %2, %0
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ waddstr(int /*<<< orphan*/, char *);
void display_write_str(char *str) { waddstr(stdscr, str); }


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

x86 assembly (clang, -O2):
<display_write_str>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <waddstr@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @display_write_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdscr
%4 = load i8*, i8** %2
%5 = call i32 @waddstr(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @display_write_str(i8* %0) {
%2 = load i32, i32* @stdscr
%3 = tail call i32 @waddstr(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
char const *dlerror();
const char *module_error(void) { return dlerror(); }


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

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

LLVM IR (-O0):
define i8* @module_error() {
%1 = call i8* (...) @dlerror()
ret i8* %1
}

LLVM IR (-O2):
define i8* @module_error() {
%1 = tail call i8* (...) @dlerror()
ret i8* %1
}
int stbi__sse2_available() { return 1; }


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

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

LLVM IR (-O0):
define i32 @stbi__sse2_available() {
ret i32 1
}

LLVM IR (-O2):
define i32 @stbi__sse2_available() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ expr_prime();
int /*<<< orphan*/ term();
expression() {
  term();
  expr_prime();
}


x86 assembly (clang, -O0):
<expression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <term@plt>
mov    $0x0,%al
call   1040 <expr_prime@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expression>:
push   %rax
xor    %eax,%eax
call   1030 <term@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <expr_prime@plt>

LLVM IR (-O0):
define i32 @expression() {
%1 = alloca i32
%2 = call i32 (...) @term()
%3 = call i32 (...) @expr_prime()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @expression() {
%1 = tail call i32 (...) @term()
%2 = tail call i32 (...) @expr_prime()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tlv_empty(int /*<<< orphan*/ *);
void ecmg_init(uint8_t *p_tlv) { tlv_empty(p_tlv); }


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

x86 assembly (clang, -O2):
<ecmg_init>:
jmp    1030 <tlv_empty@plt>

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

LLVM IR (-O2):
define void @ecmg_init(i32* %0) {
%2 = tail call i32 @tlv_empty(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *ckfopen(char *file, char *mode) {
  FILE *fp;
  if ((fp = fopen(file, mode)) == NULL) {
    fprintf(stderr, "Can't open %s\n", file);
    exit(2);
  }
  return fp;
}


x86 assembly (clang, -O0):
<ckfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117e <ckfopen+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckfopen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <ckfopen+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Can't open %s\0A\00"
define i32* @ckfopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 2)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Can't open %s\0A\00"
define noalias i32* @ckfopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_link();
int /*<<< orphan*/ mixer_cleanup();
void cleanup(int ret) {
  cleanup_link();
  mixer_cleanup();
}


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

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %eax,%eax
call   1040 <cleanup_link@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mixer_cleanup@plt>

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

LLVM IR (-O2):
define void @cleanup(i32 %0) {
%2 = tail call i32 (...) @cleanup_link()
%3 = tail call i32 (...) @mixer_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stuff(int);
void hooray() { stuff(1); }


x86 assembly (clang, -O0):
<hooray>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <stuff@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hooray>:
mov    $0x1,%edi
jmp    1030 <stuff@plt>

LLVM IR (-O0):
define void @hooray() {
%1 = call i32 @stuff(i32 1)
ret void
}

LLVM IR (-O2):
define void @hooray() {
%1 = tail call i32 @stuff(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f2() { puts("function f2"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"function f2\00"
define void @f2() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"function f2\00"
define void @f2() {
%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*/ print(char const *);
int print_num(unsigned long);
int print_k_value(const char *s, unsigned long num, unsigned long units) {
  unsigned long long temp;
  int ccode;
  print(s);
  temp = num;
  temp = (temp * units) / 1024;
  num = temp;
  ccode = print_num(num);
  print("\n");
  return ccode;
}


x86 assembly (clang, -O0):
<print_k_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp),%rax
shr    $0xa,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <print_num@plt>
mov    %eax,-0x24(%rbp)
lea    0xe8f(%rip),%rdi
call   1030 <print@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_k_value>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <print@plt>
imul   %r14,%rbx
shr    $0xa,%rbx
mov    %rbx,%rdi
call   1040 <print_num@plt>
mov    %eax,%ebx
lea    0xeb8(%rip),%rdi
call   1030 <print@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @print_k_value(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
%10 = call i32 @print(i8* %9)
%11 = load i64, i64* %5
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = mul i64 %12, %13
%15 = udiv i64 %14, 1024
store i64 %15, i64* %7
%16 = load i64, i64* %7
store i64 %16, i64* %5
%17 = load i64, i64* %5
%18 = call i32 @print_num(i64 %17)
store i32 %18, i32* %8
%19 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* %8
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @print_k_value(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @print(i8* %0)
%5 = mul i64 %2, %1
%6 = lshr i64 %5, 10
%7 = tail call i32 @print_num(i64 %6)
%8 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int start(void) {
  bar();
  return 0;
}


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

x86 assembly (clang, -O2):
<start>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @start() {
%1 = call i32 (...) @bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @start() {
%1 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%d", &a);
  b = a * a;
  c = a * a * a;
  printf("\n %d", b);
  printf("\n %d", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ isCurNum(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  for (int i = 3; i <= 9999999; i++) {
    if (isCurNum(i)) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x98967f,-0x14(%rbp)
jg     117e <main+0x5e>
mov    -0x14(%rbp),%edi
call   1040 <isCurNum@plt>
cmp    $0x0,%rax
je     116b <main+0x4b>
mov    -0x14(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x3,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x989680,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1040 <isCurNum@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %10
ret i32 0
4: ; preds = %2, %10
%5 = phi i32 [ 3, %2 ], [ %11, %10 ]
%6 = tail call i64 @isCurNum(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %4, %8
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 10000000
br i1 %12, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ another_hour(int);
int /*<<< orphan*/ weather_change();
void weather_and_time(int mode) {
  another_hour(mode);
  if (mode)
    weather_change();
}


x86 assembly (clang, -O0):
<weather_and_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <another_hour@plt>
cmpl   $0x0,-0x4(%rbp)
je     1144 <weather_and_time+0x24>
mov    $0x0,%al
call   1030 <weather_change@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weather_and_time>:
push   %rbx
mov    %edi,%ebx
call   1040 <another_hour@plt>
test   %ebx,%ebx
je     1134 <weather_and_time+0x14>
xor    %eax,%eax
pop    %rbx
jmp    1030 <weather_change@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @weather_and_time(i32 %0) {
%2 = tail call i32 @another_hour(i32 %0)
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @weather_change()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_keyboard(unsigned char, int, int, int);
void my_keyboard_release(unsigned char key, int x, int y) {
  my_keyboard(key, x, y, 1);
}


x86 assembly (clang, -O0):
<my_keyboard_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
movzbl %al,%edi
call   1030 <my_keyboard@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_keyboard_release>:
mov    $0x1,%ecx
jmp    1030 <my_keyboard@plt>

LLVM IR (-O0):
define void @my_keyboard_release(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @my_keyboard(i8 zeroext %7, i32 %8, i32 %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @my_keyboard_release(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @my_keyboard(i8 zeroext %0, i32 %1, i32 %2, i32 1)
ret void
}
int fun223() { return 223; }


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

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

LLVM IR (-O0):
define i32 @fun223() {
ret i32 223
}

LLVM IR (-O2):
define i32 @fun223() {
ret i32 223
}
/* Variables and functions */
int /*<<< orphan*/ putchr(int /*<<< orphan*/);
void putstr(const char *s) {
  while (*s)
    putchr(*s++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchr@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchr(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void f182(void) {
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
  goto a;
}


x86 assembly (clang, -O0):
<f182>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    1104 <f182+0x4>

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

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

LLVM IR (-O2):
define void @f182() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
void memcpy12() {
  char a[4] = {0};
  memcpy(0, a, 0);
  memcpy(a, 0, 0);
}


x86 assembly (clang, -O0):
<memcpy12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
xor    %edx,%edx
mov    %edx,%edi
call   1040 <memcpy@plt>
lea    -0x4(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy12>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @memcpy12() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @memcpy(i8* null, i8* %3, i32 0)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @memcpy12() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @memcpy(i8* null, i8* %2, i32 0)
%4 = call i32 @memcpy(i8* %2, i8* null, i32 0)
ret void
}
int fi(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<fi>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fi(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int __isnan(double x) { return __builtin_isnan(x); }


x86 assembly (clang, -O0):
<__isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isnan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @__isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp uno double %3, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @__isnan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned long fls(unsigned long);
unsigned long __attribute__((__const__)) roundup_pow_of_two(unsigned long x) {
  return (1UL << fls(x - 1));
}


x86 assembly (clang, -O0):
<roundup_pow_of_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fls@plt>
mov    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_pow_of_two>:
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <fls@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%rdx
mov    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @roundup_pow_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = call i64 @fls(i64 %4)
%6 = shl i64 1, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @roundup_pow_of_two(i64 %0) {
%2 = add i64 %0, -1
%3 = tail call i64 @fls(i64 %2)
%4 = shl nuw i64 1, %3
ret i64 %4
}
/* Variables and functions */
void *calloc(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, char *, int);
void *SafeCalloc(unsigned int n, unsigned int size, char *file, int line) {
  void *rptr = calloc(n, size);
  if (!rptr)
    printf("Warning Calloc() returning NULL (%s:%3d)\n", file, line);
  return (rptr);
}


x86 assembly (clang, -O0):
<SafeCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1162 <SafeCalloc+0x42>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeCalloc>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
call   1040 <calloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1149 <SafeCalloc+0x29>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <printf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [42 x i8] c"Warning Calloc() returning NULL (%s:%3d)\0A\00"
define noalias i8* @SafeCalloc(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @calloc(i32 %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
void __attribute__((no)) bar1() {
  volatile int tmp = 42;
  (void)tmp;
  foo1();
}


x86 assembly (clang, -O0):
<bar1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x0,%al
call   1030 <foo1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar1>:
movl   $0x2a,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,%eax
jmp    1030 <foo1@plt>

LLVM IR (-O0):
define void @bar1() {
%1 = alloca i32
store volatile i32 42, i32* %1
%2 = load volatile i32, i32* %1
%3 = call i32 (...) @foo1()
ret void
}

LLVM IR (-O2):
define void @bar1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 42, i32* %1
%3 = load volatile i32, i32* %1
%4 = tail call i32 (...) @foo1()
ret void
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ drawBox();
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  drawBox();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1050 <drawBox@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1050 <drawBox@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 (...) @drawBox()
%6 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @drawBox()
%6 = tail call i32 (...) @glutSwapBuffers()
ret void
}
int is_end_of_tag(char ch) {
  if ((ch >= 'a') && (ch <= 'z')) {
    return 0;
  }
  if ((ch >= 'A') && (ch <= 'Z')) {
    return 0;
  }
  if ((ch >= '0') && (ch <= '9')) {
    return 0;
  }
  if (ch == '_') {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_end_of_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_end_of_tag+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_end_of_tag+0x30>
movl   $0x0,-0x4(%rbp)
jmp    119c <is_end_of_tag+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_end_of_tag+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <is_end_of_tag+0x56>
movl   $0x0,-0x4(%rbp)
jmp    119c <is_end_of_tag+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117c <is_end_of_tag+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117c <is_end_of_tag+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    119c <is_end_of_tag+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    1195 <is_end_of_tag+0x95>
movl   $0x0,-0x4(%rbp)
jmp    119c <is_end_of_tag+0x9c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end_of_tag>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xa5,%al
cmp    $0xe6,%al
setb   %al
lea    -0x3a(%rdi),%ecx
cmp    $0xf6,%cl
setb   %cl
cmp    $0x5f,%dil
setne  %dl
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_end_of_tag(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %36
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %2
br label %36
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 48
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 0, i32* %2
br label %36
30: ; preds = %25, %21
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 95
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 0, i32* %2
br label %36
35: ; preds = %30
store i32 1, i32* %2
br label %36
36: ; preds = %35, %34, %29, %20, %11
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @is_end_of_tag(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -91
%4 = icmp ult i8 %3, -26
%5 = add i8 %0, -58
%6 = icmp ult i8 %5, -10
%7 = icmp ne i8 %0, 95
%8 = and i1 %6, %4
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double, double);
void printAppxRow(int i, double appx1, double appx2) {
  printf("%4d\t%12.6e\t\t%12.6e\n", i, appx1, appx2);
}


x86 assembly (clang, -O0):
<printAppxRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x4(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAppxRow>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%4d\09%12.6e\09\09%12.6e\0A\00"
define void @printAppxRow(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, double %8, double %9)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%4d\09%12.6e\09\09%12.6e\0A\00"
define void @printAppxRow(i32 %0, double %1, double %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, double %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("PROD = %d\n", (a * b));
  return 0;
}


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

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

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

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