xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ create_file(char *, char *, int);
int /*<<< orphan*/ mkdir(char *, int);
void setup() {
  create_file("test-file", "abcdef", 0777);
  mkdir("test-folder", 0777);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x1ff,%edx
call   1040 <create_file@plt>
lea    0xece(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x1ff,%edx
call   1040 <create_file@plt>
lea    0xed1(%rip),%rdi
mov    $0x1ff,%esi
pop    %rax
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"test-file\00"
@.str.1 = [7 x i8] c"abcdef\00"
@.str.2 = [12 x i8] c"test-folder\00"
define void @setup() {
%1 = call i32 @create_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 511)
%2 = call i32 @mkdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 511)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"test-file\00"
@.str.1 = [7 x i8] c"abcdef\00"
@.str.2 = [12 x i8] c"test-folder\00"
define void @setup() {
%1 = tail call i32 @create_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 511)
%2 = tail call i32 @mkdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 511)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doThatArgThing(int, char **);
int main(int argc, char *argv[]) { doThatArgThing(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @doThatArgThing(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy8() {
  int a[4] = {0};
  memcpy(a + 1, a + 2, 8);
}


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

x86 assembly (clang, -O2):
<memcpy8>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @memcpy8() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 8)
ret void
}
/* Variables and functions */
size_t __strxspn(char const *, char const *, int /*<<< orphan*/);
size_t strspn(const char *s, const char *accept) {
  return __strxspn(s, accept, 0);
}


x86 assembly (clang, -O0):
<strspn>:
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    %edx,%edx
call   1030 <__strxspn@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @strspn(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 i64 @__strxspn(i8* %5, i8* %6, i32 0)
ret i64 %7
}

LLVM IR (-O2):
define i64 @strspn(i8* %0, i8* %1) {
%3 = tail call i64 @__strxspn(i8* %0, i8* %1, i32 0)
ret i64 %3
}
void XCreateBitmapFromData() {}


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

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

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

LLVM IR (-O2):
define void @XCreateBitmapFromData() {
ret void
}
void platform_setup() {}


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

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

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

LLVM IR (-O2):
define void @platform_setup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void uninitvar_rewind(void) {
  FILE *f;
  (void)rewind(f);
}


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

x86 assembly (clang, -O2):
<uninitvar_rewind>:
jmp    1030 <rewind@plt>

LLVM IR (-O0):
define void @uninitvar_rewind() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @rewind(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_rewind() {
%1 = tail call i32 @rewind(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA2_Channel2_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA2_Channel2_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_Channel2_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
struct ptspair {
  int dummy;
};
struct pts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLLIN;
int /*<<< orphan*/ EPOLL_CTL_MOD;
int pts_epoll_ctl(struct ptspair const *, struct pts *, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int unregister_pts_write(const struct ptspair *ptspair, struct pts *pts) {
  return pts_epoll_ctl(ptspair, pts, EPOLL_CTL_MOD, EPOLLIN);
}


x86 assembly (clang, -O0):
<unregister_pts_write>:
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    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
call   1030 <pts_epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unregister_pts_write>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <pts_epoll_ctl@plt>

LLVM IR (-O0):
%struct.ptspair = type { i32 }
%struct.pts = type { i32 }
@EPOLL_CTL_MOD = global i32 0
@EPOLLIN = global i32 0
define i32 @unregister_pts_write(%struct.ptspair* %0, %struct.pts* %1) {
%3 = alloca %struct.ptspair*
%4 = alloca %struct.pts*
store %struct.ptspair* %0, %struct.ptspair** %3
store %struct.pts* %1, %struct.pts** %4
%5 = load %struct.ptspair*, %struct.ptspair** %3
%6 = load %struct.pts*, %struct.pts** %4
%7 = load i32, i32* @EPOLL_CTL_MOD
%8 = load i32, i32* @EPOLLIN
%9 = call i32 @pts_epoll_ctl(%struct.ptspair* %5, %struct.pts* %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.ptspair = type { i32 }
%struct.pts = type { i32 }
@EPOLL_CTL_MOD = global i32 0
@EPOLLIN = global i32 0
define i32 @unregister_pts_write(%struct.ptspair* %0, %struct.pts* %1) {
%3 = load i32, i32* @EPOLL_CTL_MOD
%4 = load i32, i32* @EPOLLIN
%5 = tail call i32 @pts_epoll_ctl(%struct.ptspair* %0, %struct.pts* %1, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void join_type(int type) {
  if (type < 0 || type > 2)
    type = 0;
  printf("%d setlinejoin\n", type);
}


x86 assembly (clang, -O0):
<join_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112f <join_type+0x1f>
cmpl   $0x2,-0x4(%rbp)
jle    1136 <join_type+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_type>:
xor    %esi,%esi
cmp    $0x3,%edi
cmovb  %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"%d setlinejoin\0A\00"
define void @join_type(i32 %0) {
%2 = icmp ugt i32 %0, 2
%3 = select i1 %2, i32 0, i32 %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int athTxStart(char *);
int athTxFrameStart() { return athTxStart("frame"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"frame\00"
define i32 @athTxFrameStart() {
%1 = call i32 @athTxStart(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"frame\00"
define i32 @athTxFrameStart() {
%1 = tail call i32 @athTxStart(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void ff_hevc_put_hevc_uni_w_epel_v24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v24_8_sse4() {
ret void
}
void g_signal_connect_closure_by_id() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_connect_closure_by_id() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_atoi(char *);
int /*<<< orphan*/ ft_do_op(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc == 4)
    ft_do_op(ft_atoi(argv[1]), argv[2], ft_atoi(argv[3]));
  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)
cmpl   $0x4,-0x8(%rbp)
jne    1177 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <ft_atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <ft_atoi@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <ft_do_op@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x4,%edi
jne    1154 <main+0x34>
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <ft_atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%r14
mov    0x18(%rbx),%rdi
call   1040 <ft_atoi@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <ft_do_op@plt>
pop    %rbx
pop    %r14
pop    %rbp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @ft_atoi(i8* %11)
%13 = tail call i32 @ft_do_op(i32 %7, i8* %9, i32 %12)
br label %14
14: ; preds = %4, %2
ret i32 0
}
int set_floor(element)
int element;
{
  if (element <= 4)
    return (1);
  else
    return (0);
}


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

x86 assembly (clang, -O2):
<set_floor>:
xor    %eax,%eax
cmp    $0x5,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @set_floor(i32 %0) {
%2 = icmp slt i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", "Hello, world!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int main() {
  int a = 0;
  int x = 5;
  int y = 4;
  while (x > 0) {
    if (x - y == 0) {
      a++;
      y = y - 2;
    }
    a++;
    x--;
  }
  if (a != 7) {
  ERROR:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1162 <main+0x62>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
jne    114b <main+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1120 <main+0x20>
cmpl   $0x7,-0x8(%rbp)
je     117d <main+0x7d>
jmp    1171 <main+0x71>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <main+0x84>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 5, i32* %3
store i32 4, i32* %4
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 2
store i32 %17, i32* %4
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %5
23: ; preds = %5
%24 = load i32, i32* %2
%25 = icmp ne i32 %24, 7
br i1 %25, label %26, label %28
26: ; preds = %23
br label %27
27: ; preds = %26
store i32 -1, i32* %1
br label %29
28: ; preds = %23
store i32 0, i32* %1
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main(void) {
  int a;
  int b[10];
  a = b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = ptrtoint i32* %3 to i32
store i32 %4, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ halt_isr();
__attribute__((weak)) void SysTick_Handler() { halt_isr(); }


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

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

LLVM IR (-O0):
define weak void @SysTick_Handler() {
%1 = call i32 (...) @halt_isr()
ret void
}

LLVM IR (-O2):
define weak void @SysTick_Handler() {
%1 = tail call i32 (...) @halt_isr()
ret void
}
/* Variables and functions */
long double cosl(long double);
long double powl(long double, long double);
long double sinl(long double);
long double g_derivative(long double x) {
  return powl(x - 3.0L, 3.0L) * (4.0L * sinl(x) + (x - 3.0L) * cosl(x));
}


x86 assembly (clang, -O0):
<g_derivative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeb9(%rip)
fld    %st(0)
fstpt  -0x40(%rbp)
fsubr  %st,%st(1)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <powl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fldt   -0x40(%rbp)
fxch   %st(1)
fstpt  -0x28(%rbp)
fldt   -0x10(%rbp)
fsub   %st,%st(1)
fxch   %st(1)
fstpt  -0x34(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <cosl@plt>
fldt   -0x34(%rbp)
fldt   -0x28(%rbp)
fldt   -0x1c(%rbp)
fxch   %st(2)
fmulp  %st,%st(3)
flds   0xe6a(%rip)
fmulp  %st,%st(1)
faddp  %st,%st(2)
fmulp  %st,%st(1)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_derivative>:
sub    $0x58,%rsp
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fadds  0xebc(%rip)
fld    %st(0)
fstpt  0x40(%rsp)
flds   0xeb4(%rip)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1040 <powl@plt>
fstpt  0x4c(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
fstpt  0x34(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1050 <cosl@plt>
fldt   0x40(%rsp)
fmulp  %st,%st(1)
fldt   0x34(%rsp)
fmuls  0xe7c(%rip)
faddp  %st,%st(1)
fldt   0x4c(%rsp)
fmulp  %st,%st(1)
add    $0x58,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @g_derivative(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fsub x86_fp80 %3, 0xK4000C000000000000000
%5 = call x86_fp80 @powl(x86_fp80 %4, x86_fp80 0xK4000C000000000000000)
%6 = load x86_fp80, x86_fp80* %2
%7 = call x86_fp80 @sinl(x86_fp80 %6)
%8 = load x86_fp80, x86_fp80* %2
%9 = fsub x86_fp80 %8, 0xK4000C000000000000000
%10 = load x86_fp80, x86_fp80* %2
%11 = call x86_fp80 @cosl(x86_fp80 %10)
%12 = fmul x86_fp80 %9, %11
%13 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK40018000000000000000, x86_fp80 %7, x86_fp80 %12)
%14 = fmul x86_fp80 %5, %13
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @g_derivative(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xKC000C000000000000000
%3 = tail call x86_fp80 @powl(x86_fp80 %2, x86_fp80 0xK4000C000000000000000)
%4 = tail call x86_fp80 @sinl(x86_fp80 %0)
%5 = tail call x86_fp80 @cosl(x86_fp80 %0)
%6 = fmul x86_fp80 %2, %5
%7 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 0xK40018000000000000000, x86_fp80 %6)
%8 = fmul x86_fp80 %3, %7
ret x86_fp80 %8
}
void remove_carriage_return(char *str) {
  char *src, *dst;
  for (src = dst = str; *src != '\0'; src++) {
    *dst = *src;
    if (*dst != '\r')
      dst++;
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<remove_carriage_return>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <remove_carriage_return+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     114c <remove_carriage_return+0x4c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <remove_carriage_return+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <remove_carriage_return+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_carriage_return>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <remove_carriage_return+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    $0xd,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <remove_carriage_return+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_carriage_return(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
store i8 %5, i8* %6
%8 = icmp ne i8 %5, 13
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %6, i64 %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8* [ %0, %1 ], [ %10, %4 ]
store i8 0, i8* %15
ret void
}
/* Variables and functions */
bool in_circle(double x, double y) { return x * x + y * y < 1; }


x86 assembly (clang, -O0):
<in_circle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_circle>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @in_circle(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = fcmp olt double %10, 1.000000e+00
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @in_circle(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = fcmp olt double %4, 1.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}
void foo(int a, int b, int c) { ; }


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

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

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LSR16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Absolute(int);
void Op4EM0(void) { LSR16(SA1Absolute(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op4EM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <LSR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op4EM0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <LSR16@plt>

LLVM IR (-O0):
define void @Op4EM0() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @LSR16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op4EM0() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @LSR16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
scalar_t__ getc(int /*<<< orphan*/);
int /*<<< orphan*/ nguraTTYPutChar(char);
int /*<<< orphan*/ stdin;
int nguraKBDGetChar() {
  int i = 0;
  i = (int)getc(stdin);
  if (i == 10 || i == 13)
    i = 32;
  nguraTTYPutChar((char)i);
  return i;
}


x86 assembly (clang, -O0):
<nguraKBDGetChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1154 <nguraKBDGetChar+0x34>
cmpl   $0xd,-0x4(%rbp)
jne    115b <nguraKBDGetChar+0x3b>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <nguraTTYPutChar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nguraKBDGetChar>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
cmp    $0xd,%eax
mov    $0x20,%ecx
mov    %eax,%ebx
cmove  %ecx,%ebx
cmp    $0xa,%eax
cmove  %ecx,%ebx
movsbl %bl,%edi
call   1030 <nguraTTYPutChar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @nguraKBDGetChar() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i64 @getc(i32 %2)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 10
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 13
br i1 %9, label %10, label %11
10: ; preds = %7, %0
store i32 32, i32* %1
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %1
%13 = trunc i32 %12 to i8
%14 = call i32 @nguraTTYPutChar(i8 signext %13)
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @nguraKBDGetChar() {
%1 = load i32, i32* @stdin
%2 = tail call i64 @getc(i32 %1)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 10
%5 = icmp eq i32 %3, 13
%6 = or i1 %4, %5
%7 = select i1 %6, i32 32, i32 %3
%8 = trunc i32 %7 to i8
%9 = tail call i32 @nguraTTYPutChar(i8 signext %8)
ret i32 %7
}
void ff_hevc_put_hevc_epel_v6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v6_12_sse4() {
ret void
}
int small(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @small() {
ret i32 42
}

LLVM IR (-O2):
define i32 @small() {
ret i32 42
}
int test_imm_84int16_reg(short val) {
  return ((val) & (0x84 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_84int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x84,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_84int16_reg(i16 signext %0) {
%2 = and i16 %0, 132
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509V3_EXT_METHOD;
typedef int /*<<< orphan*/ X509V3_CTX;

/* Variables and functions */
void *s2i_ASN1_INTEGER(int /*<<< orphan*/ *, char *);
void *s2i_asn1_int(X509V3_EXT_METHOD *meth, X509V3_CTX *ctx, char *value) {
  return s2i_ASN1_INTEGER(meth, value);
}


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

x86 assembly (clang, -O2):
<s2i_asn1_int>:
mov    %rdx,%rsi
jmp    1030 <s2i_ASN1_INTEGER@plt>

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

LLVM IR (-O2):
define i8* @s2i_asn1_int(i32* %0, i32* nocapture readnone %1, i8* %2) {
%4 = tail call i8* @s2i_ASN1_INTEGER(i32* %0, i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ XSUM_log(char *, char const *);
int /*<<< orphan*/ exit(int);
void errorOut(const char *msg) {
  XSUM_log("%s \n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<errorOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <XSUM_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errorOut>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <XSUM_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
define void @errorOut(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @XSUM_log(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define void @errorOut(i8* %0) {
%2 = tail call i32 @XSUM_log(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *ret_value = malloc(size);
  if (ret_value == NULL)
    exit(EXIT_FAILURE);
  return ret_value;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <safe_malloc+0x32>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <safe_malloc+0xd>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(short, int /*<<< orphan*/ *);
void write_short(short val, FILE *fout) {
  fputc(val >> 8, fout);
  fputc(val, fout);
}


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    -0x10(%rbp),%rsi
movswl %ax,%edi
call   1030 <fputc@plt>
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
movswl %ax,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x8,%edi
call   1030 <fputc@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @write_short(i16 signext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %4
%10 = call i32 @fputc(i16 signext %8, i32* %9)
%11 = load i16, i16* %3
%12 = load i32*, i32** %4
%13 = call i32 @fputc(i16 signext %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @write_short(i16 signext %0, i32* nocapture %1) {
%3 = ashr i16 %0, 8
%4 = tail call i32 @fputc(i16 signext %3, i32* %1)
%5 = tail call i32 @fputc(i16 signext %0, i32* %1)
ret void
}
int fun2(int *a, int b[]) {}


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun2(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @fun2(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
char *strstr(char *, char *);
int count_min_in_max(char *max, char *min) {
  int count = 0;
  char *max_temp = max;
  while (NULL != (max_temp = strstr(max_temp, min))) {
    max_temp = max_temp + 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_min_in_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     1168 <count_min_in_max+0x58>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <count_min_in_max+0x1f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_min_in_max>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strstr@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1147 <count_min_in_max+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
add    $0x1,%ebp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1130 <count_min_in_max+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count_min_in_max(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add nuw nsw i32 %7, 1
%10 = tail call i8* @strstr(i8* dereferenceable(1) %8, i8* dereferenceable(1) %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr, "Usage: hanoi [<No Of Tiles>] [a]\n");
  fprintf(stderr,
          "The 'a' option causes the tower to be solved automatically\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: hanoi [<No Of Tiles>] [a]\0A\00"
@.str.1 = [60 x i8] c"The 'a' option causes the tower to be solved automatically\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: hanoi [<No Of Tiles>] [a]\0A\00"
@.str.1 = [60 x i8] c"The 'a' option causes the tower to be solved automatically\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __arg_constrained_twice(int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void test_multiple_constraints_on_same_arg(int x) {
  __arg_constrained_twice(x);
  clang_analyzer_eval(x < 1 || x > 2);
}


x86 assembly (clang, -O0):
<test_multiple_constraints_on_same_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__arg_constrained_twice@plt>
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     114c <test_multiple_constraints_on_same_arg+0x2c>
cmpl   $0x2,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_multiple_constraints_on_same_arg>:
push   %rbx
mov    %edi,%ebx
call   1030 <__arg_constrained_twice@plt>
add    $0xfffffffd,%ebx
xor    %edi,%edi
cmp    $0xfffffffe,%ebx
setb   %dil
pop    %rbx
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @test_multiple_constraints_on_same_arg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__arg_constrained_twice(i32 %3)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 2
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ true, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
ret void
}

LLVM IR (-O2):
define void @test_multiple_constraints_on_same_arg(i32 %0) {
%2 = tail call i32 @__arg_constrained_twice(i32 %0)
%3 = add i32 %0, -3
%4 = icmp ult i32 %3, -2
%5 = zext i1 %4 to i32
%6 = tail call i32 @clang_analyzer_eval(i32 %5)
ret void
}
int comp_ints(void *p1, void *p2) {
  int res = (*(int *)p1 - *(int *)p2);
  return (res < 0) ? -1 : (res > 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<comp_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1132 <comp_ints+0x32>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1145 <comp_ints+0x45>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comp_ints(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 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
br label %21
16: ; preds = %2
%17 = load i32, i32* %5
%18 = icmp sgt i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 0
br label %21
21: ; preds = %16, %15
%22 = phi i32 [ -1, %15 ], [ %20, %16 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @comp_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = icmp sgt i32 %7, -1
%11 = select i1 %10, i32 %9, i32 -1
ret i32 %11
}
/* Variables and functions */
float acosf(float);
float num_acos(float a) { return acosf(a); }


x86 assembly (clang, -O0):
<num_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_acos>:
jmp    1030 <acosf@plt>

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

LLVM IR (-O2):
define float @num_acos(float %0) {
%2 = tail call float @acosf(float %0)
ret float %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

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

/* Variables and functions */
void set_XEvent_xselectionclear_selection(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselectionclear.selection = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xselectionclear_selection>:
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_xselectionclear_selection>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselectionclear_selection(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_xselectionclear_selection(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}