xunge/DecIR huggingface dataset:
int test_imm_ADint8_reg(signed char val) {
  return ((val) & (-0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff53,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_ADint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -173
%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_ADint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -173
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double get_MAP() { return 101.325; }


x86 assembly (clang, -O0):
<get_MAP>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_MAP>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_MAP() {
ret double 1.013250e+02
}

LLVM IR (-O2):
define double @get_MAP() {
ret double 1.013250e+02
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "touch"
        " [-acm][-r ref_file|-t time] file...\n  -a	Change the access "
        "time\n  -c	Do not create file if it doesn't exist\n  -m	Change "
        "the modification time\n  -r	Use the time of the given file\n  "
        "-t	Use the specified time as [[CC]YY]MMDDhhmm[.SS]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [245 x i8] c"Usage: touch [-acm][-r ref_file|-t time] file...\0A -a\09Change the access time\0A -c\09Do not create file if it doesn't exist\0A -m\09Change the modification time\0A -r\09Use the time of the given file\0A -t\09Use the specified time as [[CC]YY]MMDDhhmm[.SS]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([245 x i8], [245 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [245 x i8] c"Usage: touch [-acm][-r ref_file|-t time] file...\0A -a\09Change the access time\0A -c\09Do not create file if it doesn't exist\0A -m\09Change the modification time\0A -r\09Use the time of the given file\0A -t\09Use the specified time as [[CC]YY]MMDDhhmm[.SS]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([245 x i8], [245 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
void swapi(int *a, int *b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swapi(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XwcTextEscapement() {
  printf("XwcTextEscapement called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"XwcTextEscapement called\00"
define i32 @XwcTextEscapement() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct FormatType {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ dirfile_read_channel(char, struct FormatType const *, char const *,
                                int *);
int32_t *dirfile_read_int32_channel(const struct FormatType *F,
                                    const char *channelname, int *nsamples) {
  return (int32_t *)dirfile_read_channel('S', F, channelname, nsamples);
}


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

x86 assembly (clang, -O2):
<dirfile_read_int32_channel>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x53,%edi
jmp    1030 <dirfile_read_channel@plt>

LLVM IR (-O0):
%struct.FormatType = type { i32 }
define i32* @dirfile_read_int32_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = alloca %struct.FormatType*
%5 = alloca i8*
%6 = alloca i32*
store %struct.FormatType* %0, %struct.FormatType** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load %struct.FormatType*, %struct.FormatType** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i64 @dirfile_read_channel(i8 signext 83, %struct.FormatType* %7, i8* %8, i32* %9)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
%struct.FormatType = type { i32 }
define i32* @dirfile_read_int32_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = tail call i64 @dirfile_read_channel(i8 signext 83, %struct.FormatType* %0, i8* %1, i32* %2)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int execute_getpagesize() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getpagesize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1, 0))) void hp1(void) { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void printChar(char c) {
  asm(".intel_syntax noprefix \n\t"
      "mov ah, 0x0e \n\t"
      "int 0x10 \n\t"
      :
      : "a"(c)
      :);
}


x86 assembly (clang, -O0):
<printChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    $0xe,%ah
int    $0x10
pop    %rbp
ret

x86 assembly (clang, -O2):
<printChar>:
mov    %edi,%eax
mov    $0xe,%ah
int    $0x10
ret

LLVM IR (-O0):
define void @printChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @printChar(i8 signext %0) {
tail call void asm sideeffect ".intel_syntax noprefix \0A\09mov ah, 0x0e \0A\09int 0x10 \0A\09", "{ax},~{dirflag},~{fpsr},~{flags}"(i8 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ ns_put32(int /*<<< orphan*/, int /*<<< orphan*/ *);
void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }


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

x86 assembly (clang, -O2):
<__putlong>:
jmp    1030 <ns_put32@plt>

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

LLVM IR (-O2):
define void @__putlong(i32 %0, i32* %1) {
%3 = tail call i32 @ns_put32(i32 %0, i32* %1)
ret void
}
unsigned short unsignedshortFindMaxHex(unsigned short i) {
  unsigned short b;
  for (b = 16; i > 1; i--)
    b *= b;
  return b;
}


x86 assembly (clang, -O0):
<unsignedshortFindMaxHex>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x10,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x1,%eax
jle    113e <unsignedshortFindMaxHex+0x3e>
movzwl -0x4(%rbp),%ecx
movzwl -0x4(%rbp),%eax
imul   %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
jmp    1111 <unsignedshortFindMaxHex+0x11>
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshortFindMaxHex>:
mov    $0x10,%ax
cmp    $0x2,%di
jb     1169 <unsignedshortFindMaxHex+0x69>
lea    -0x1(%rdi),%edx
add    $0xfffffffe,%edi
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%di
jae    1121 <unsignedshortFindMaxHex+0x21>
mov    $0x10,%ax
jmp    114e <unsignedshortFindMaxHex+0x4e>
and    $0xfff8,%edx
mov    $0x10,%ax
nopl   0x0(%rax,%rax,1)
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
add    $0xfff8,%dx
jne    1130 <unsignedshortFindMaxHex+0x30>
test   %cx,%cx
je     1169 <unsignedshortFindMaxHex+0x69>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
imul   %eax,%eax
add    $0xffff,%cx
jne    1160 <unsignedshortFindMaxHex+0x60>
ret

LLVM IR (-O0):
define zeroext i16 @unsignedshortFindMaxHex(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 16, i16* %3
br label %4
4: ; preds = %15, %1
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %12, %10
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
br label %15
15: ; preds = %8
%16 = load i16, i16* %2
%17 = add i16 %16, -1
store i16 %17, i16* %2
br label %4
18: ; preds = %4
%19 = load i16, i16* %3
ret i16 %19
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortFindMaxHex(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 1
br i1 %2, label %3, label %33
3: ; preds = %1
%4 = add i16 %0, -1
%5 = add i16 %0, -2
%6 = and i16 %4, 7
%7 = icmp ult i16 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %3
%9 = and i16 %4, -8
br label %10
10: ; preds = %10, %8
%11 = phi i16 [ 16, %8 ], [ %20, %10 ]
%12 = phi i16 [ 0, %8 ], [ %21, %10 ]
%13 = mul i16 %11, %11
%14 = mul i16 %13, %13
%15 = mul i16 %14, %14
%16 = mul i16 %15, %15
%17 = mul i16 %16, %16
%18 = mul i16 %17, %17
%19 = mul i16 %18, %18
%20 = mul i16 %19, %19
%21 = add i16 %12, 8
%22 = icmp eq i16 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %3
%24 = phi i16 [ undef, %3 ], [ %20, %10 ]
%25 = phi i16 [ 16, %3 ], [ %20, %10 ]
%26 = icmp eq i16 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i16 [ %30, %27 ], [ %25, %23 ]
%29 = phi i16 [ %31, %27 ], [ 0, %23 ]
%30 = mul i16 %28, %28
%31 = add i16 %29, 1
%32 = icmp eq i16 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %1
%34 = phi i16 [ 16, %1 ], [ %24, %23 ], [ %30, %27 ]
ret i16 %34
}
/* Variables and functions */
int /*<<< orphan*/ buf_add_bytes(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void buf_escape(const char *str) { buf_add_bytes(str, strlen(str)); }


x86 assembly (clang, -O0):
<buf_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <buf_add_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_escape>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <buf_add_bytes@plt>

LLVM IR (-O0):
define void @buf_escape(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @buf_add_bytes(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @buf_escape(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @buf_add_bytes(i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ block_copy(int /*<<< orphan*/ *const,
                              int /*<<< orphan*/ *const, int const);
int /*<<< orphan*/ block_zero(int /*<<< orphan*/ *const);
int /*<<< orphan*/ mmxext_idct(int /*<<< orphan*/ *const);
void mpeg2_idct_copy_mmxext(int16_t *const block, uint8_t *const dest,
                            const int stride) {
  mmxext_idct(block);
  block_copy(block, dest, stride);
  block_zero(block);
}


x86 assembly (clang, -O0):
<mpeg2_idct_copy_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mmxext_idct@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <block_copy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <block_zero@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpeg2_idct_copy_mmxext>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <mmxext_idct@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <block_copy@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <block_zero@plt>

LLVM IR (-O0):
define void @mpeg2_idct_copy_mmxext(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @mmxext_idct(i32* %7)
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i32 @block_copy(i32* %9, i32* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @block_zero(i32* %13)
ret void
}

LLVM IR (-O2):
define void @mpeg2_idct_copy_mmxext(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @mmxext_idct(i32* %0)
%5 = tail call i32 @block_copy(i32* %0, i32* %1, i32 %2)
%6 = tail call i32 @block_zero(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, int);
void ch_cntl(int ch, int data) { to_gps(ch << 3, data); }


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

x86 assembly (clang, -O2):
<ch_cntl>:
shl    $0x3,%edi
jmp    1030 <to_gps@plt>

LLVM IR (-O0):
define void @ch_cntl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 3
%7 = load i32, i32* %4
%8 = call i32 @to_gps(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @ch_cntl(i32 %0, i32 %1) {
%3 = shl i32 %0, 3
%4 = tail call i32 @to_gps(i32 %3, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __complete(int);
uint32_t complete32(int slot) { return (uint32_t)__complete(slot); }


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

x86 assembly (clang, -O2):
<complete32>:
jmp    1030 <__complete@plt>

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

LLVM IR (-O2):
define i32 @complete32(i32 %0) {
%2 = tail call i32 @__complete(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
#pragma omp for collapse(1)
  for (int i = 1; i <= 151; i += 31)
    foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x97,-0x8(%rbp)
jg     1148 <main+0x38>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1f,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 151
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @foo()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 31
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ recv(int, char *, int, int /*<<< orphan*/);
void skip_all_lines(int s) {
  char buf[1024];
  while (0 < recv(s, buf, sizeof(buf), 0))
    ;
}


x86 assembly (clang, -O0):
<skip_all_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jge    1147 <skip_all_lines+0x37>
jmp    111e <skip_all_lines+0xe>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_all_lines>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jg     1120 <skip_all_lines+0x10>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @skip_all_lines(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
store i32 %0, i32* %2
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %2
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i64 @recv(i32 %5, i8* %6, i32 1024, i32 0)
%8 = icmp slt i64 0, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @skip_all_lines(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i64 @recv(i32 %0, i8* %3, i32 1024, i32 0)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *strerror(int);
int main(int argc, char *argv[]) {
  int i = 0;
  for (i = 0; i < 256; i++) {
    printf("%d\t=%s\n", i, strerror(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   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    117f <main+0x5f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%esi
mov    %rax,%rdx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <strerror@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d\09=%s\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 0, i32* %6
store i32 0, i32* %6
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = call i8* @strerror(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %7
18: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d\09=%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 256
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
int main(int argc, char **argv) {
  while (++argv, --argc)
    hex(*argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1157 <main+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <hex@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
je     1144 <main+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <hex@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
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
br label %6
6: ; preds = %12, %2
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @hex to i32 (i8*, ...)*)(i8* %14)
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @hex to i32 (i8*, ...)*)(i8* %9)
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_dcl_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("dcl", " !comment"),
                            "comment", "!comment");
}


x86 assembly (clang, -O0):
<test_dcl_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec6(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dcl_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dcl\00"
@.str.1 = [10 x i8] c" !comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"!comment\00"
define void @test_dcl_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dcl\00"
@.str.1 = [10 x i8] c" !comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"!comment\00"
define void @test_dcl_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cm_print_error(char *, unsigned long const,
                                  unsigned long const);
int values_not_equal_display_error(const unsigned long int left,
                                   const unsigned long int right) {
  const int not_equal = left != right;
  if (!not_equal) {
    cm_print_error("%#lx"
                   " == "
                   "%#lx"
                   "\n",
                   left, right);
  }
  return not_equal;
}


x86 assembly (clang, -O0):
<values_not_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1151 <values_not_equal_display_error+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <cm_print_error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<values_not_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    %rsi,%rdi
jne    1131 <values_not_equal_display_error+0x21>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <cm_print_error@plt>
xor    %eax,%eax
cmp    %r14,%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%#lx == %#lx\0A\00"
define i32 @values_not_equal_display_error(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp ne i64 %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = call i32 @cm_print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %13, i64 %14)
br label %16
16: ; preds = %12, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"%#lx == %#lx\0A\00"
define i32 @values_not_equal_display_error(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @cm_print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %0)
br label %6
6: ; preds = %4, %2
%7 = zext i1 %3 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void setreg32(unsigned long int addr, unsigned long int value) {
  *((volatile unsigned long int *)addr) = value;
  printf("Wrote full word at 0x%08lx = 0x%08lx.\n", addr, value);
}


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

x86 assembly (clang, -O2):
<setreg32>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rdx,(%rdi)
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Wrote full word at 0x%08lx = 0x%08lx.\0A\00"
define void @setreg32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Wrote full word at 0x%08lx = 0x%08lx.\0A\00"
define void @setreg32(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret void
}
void ccrypt_setmode(int fd, int mode) { return; }


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

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

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

LLVM IR (-O2):
define void @ccrypt_setmode(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("clear");
  system("ls");
  system("shutdown");
  system("sudo -i");
  system("date");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [9 x i8] c"shutdown\00"
@.str.3 = [8 x i8] c"sudo -i\00"
@.str.4 = [5 x i8] c"date\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [9 x i8] c"shutdown\00"
@.str.3 = [8 x i8] c"sudo -i\00"
@.str.4 = [5 x i8] c"date\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
void Wheels_2_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Wheels_2_RestoreConfig() {
ret void
}
void cdrbit(next, iwidth, iword, ibitlc, ibuf) int *iwidth, *iword, *ibitlc;
unsigned *next, ibuf[];
{ cdrpak(next, iwidth, iword, ibitlc, ibuf); }


x86 assembly (clang, -O0):
<cdrbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x0,%al
call   1030 <cdrpak@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cdrbit(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32*, i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @cdrpak to i32 (i32*, i32*, i32*, i32*, i32*, ...)*)(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @cdrbit(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 (i32*, i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @cdrpak to i32 (i32*, i32*, i32*, i32*, i32*, ...)*)(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void zeta(void) { printf("zeta()\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"zeta()\00"
define void @zeta() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double zs_to_bit(double zs, int n0, int n1) {
  double z, a_n0, a_n1;
  z = (zs - 50.0) / 10.0;
  a_n0 = (double)n0;
  a_n1 = (double)n1;
  return (1.28254983016186409554 * z + 0.57721566490153286060 +
          log(a_n0 * a_n1)) /
         0.69314718055994530942;
}


x86 assembly (clang, -O0):
<zs_to_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zs_to_bit>:
push   %rax
movapd %xmm0,%xmm2
addsd  0xee3(%rip),%xmm2
divsd  0xee3(%rip),%xmm2
cvtsi2sd %edi,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xed4(%rip),%xmm2
addsd  0xed4(%rip),%xmm2
movsd  %xmm2,(%rsp)
call   1030 <log@plt>
addsd  (%rsp),%xmm0
divsd  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @zs_to_bit(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load double, double* %4
%11 = fsub double %10, 5.000000e+01
%12 = fdiv double %11, 1.000000e+01
store double %12, double* %7
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
store double %14, double* %8
%15 = load i32, i32* %6
%16 = sitofp i32 %15 to double
store double %16, double* %9
%17 = load double, double* %7
%18 = call double @llvm.fmuladd.f64(double 0x3FF48552F88091A8, double %17, double 0x3FE2788CFC6FB619)
%19 = load double, double* %8
%20 = load double, double* %9
%21 = fmul double %19, %20
%22 = call double @log(double %21)
%23 = fadd double %18, %22
%24 = fdiv double %23, 0x3FE62E42FEFA39EF
ret double %24
}

LLVM IR (-O2):
define double @zs_to_bit(double %0, i32 %1, i32 %2) {
%4 = fadd double %0, -5.000000e+01
%5 = fdiv double %4, 1.000000e+01
%6 = sitofp i32 %1 to double
%7 = sitofp i32 %2 to double
%8 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FF48552F88091A8, double 0x3FE2788CFC6FB619)
%9 = fmul double %6, %7
%10 = tail call double @log(double %9)
%11 = fadd double %8, %10
%12 = fdiv double %11, 0x3FE62E42FEFA39EF
ret double %12
}
int foo(void) {
  int a, b, c;
  asm("# Magic instruction" : "=r"(a));
  asm("# Magic instruction" : "=r"(b));
  asm("# Magic instruction" : "=r"(c));
  return a + b + c;
}


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 asm "# Magic instruction", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %4, i32* %1
%5 = call i32 asm "# Magic instruction", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %5, i32* %2
%6 = call i32 asm "# Magic instruction", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %6, i32* %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 asm "# Magic instruction", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = mul nsw i32 %1, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char, int);
int /*<<< orphan*/ uart_tx(char);
void kprint(char *string) {
  int i;
  for (i = 0; *(string + i) != '\0'; i++) {
    putchar(*(string + i), 0x07);
    uart_tx(*(string + i));
  }
  return;
}


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     117d <kprint+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    $0x7,%esi
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <uart_tx@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <kprint+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1151 <kprint+0x31>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
mov    $0x7,%esi
call   1030 <putchar@plt>
movsbl -0x1(%rbx),%edi
call   1040 <uart_tx@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <kprint+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = tail call i32 @putchar(i8 signext %6, i32 7)
%9 = load i8, i8* %7
%10 = tail call i32 @uart_tx(i8 signext %9)
%11 = add nuw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret void
}
void WWDG_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @WWDG_IRQHandler() {
ret void
}
int bc(char x) {
  if (x == 'v' || x == '^' || x == '>') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<bc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x76,%eax
je     1131 <bc+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
je     1131 <bc+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x3e,%eax
jne    113d <bc+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <bc+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc>:
add    $0xc2,%dil
cmp    $0x38,%dil
ja     1124 <bc+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000100000001,%rdx
bt     %rcx,%rdx
jae    1124 <bc+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bc(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 eq i32 %5, 118
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 94
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 62
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @bc(i8 signext %0) {
switch i8 %0, label %2 [
i8 118, label %3
i8 94, label %3
i8 62, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t nod2(uint64_t p, uint64_t q) {
  uint64_t t;
  while (q && q != p) {
    if (q > p) {
      t = p;
      p = q;
      q = t;
    }
    p -= q;
  }
  return p;
}


x86 assembly (clang, -O0):
<nod2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     112a <nod2+0x2a>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    113a <nod2+0x3a>
jmp    1174 <nod2+0x74>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jle    1160 <nod2+0x60>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <nod2+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nod2>:
mov    %rdi,%rax
test   %rsi,%rsi
je     112b <nod2+0x2b>
nopl   0x0(%rax,%rax,1)
cmp    %rax,%rsi
je     112b <nod2+0x2b>
mov    %rsi,%rcx
cmp    %rax,%rsi
cmovg  %rax,%rsi
cmovg  %rcx,%rax
sub    %rsi,%rax
test   %rsi,%rsi
jne    1110 <nod2+0x10>
ret

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

LLVM IR (-O2):
define i64 @nod2(i64 %0, i64 %1) {
%3 = icmp ne i64 %1, 0
%4 = icmp ne i64 %1, %0
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2, %6
%7 = phi i64 [ %12, %6 ], [ %0, %2 ]
%8 = phi i64 [ %10, %6 ], [ %1, %2 ]
%9 = icmp sgt i64 %8, %7
%10 = select i1 %9, i64 %7, i64 %8
%11 = select i1 %9, i64 %8, i64 %7
%12 = sub nsw i64 %11, %10
%13 = icmp ne i64 %10, 0
%14 = icmp ne i64 %10, %12
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %6, label %16
16: ; preds = %6, %2
%17 = phi i64 [ %0, %2 ], [ %12, %6 ]
ret i64 %17
}