xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ reverse(unsigned long long);
int main() {
  unsigned long long int number;
  number = 5170984;
  reverse(number);
  number = 406567;
  reverse(number);
  number = 368750;
  reverse(number);
  number = 2369510;
  reverse(number);
  number = 2183293;
  reverse(number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x4ee728,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
movq   $0x63427,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
movq   $0x5a06e,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
movq   $0x2427e6,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
movq   $0x21507d,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4ee728,%edi
call   1030 <reverse@plt>
mov    $0x63427,%edi
call   1030 <reverse@plt>
mov    $0x5a06e,%edi
call   1030 <reverse@plt>
mov    $0x2427e6,%edi
call   1030 <reverse@plt>
mov    $0x21507d,%edi
call   1030 <reverse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i64
store i64 5170984, i64* %1
%2 = load i64, i64* %1
%3 = call i32 @reverse(i64 %2)
store i64 406567, i64* %1
%4 = load i64, i64* %1
%5 = call i32 @reverse(i64 %4)
store i64 368750, i64* %1
%6 = load i64, i64* %1
%7 = call i32 @reverse(i64 %6)
store i64 2369510, i64* %1
%8 = load i64, i64* %1
%9 = call i32 @reverse(i64 %8)
store i64 2183293, i64* %1
%10 = load i64, i64* %1
%11 = call i32 @reverse(i64 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @reverse(i64 5170984)
%2 = tail call i32 @reverse(i64 406567)
%3 = tail call i32 @reverse(i64 368750)
%4 = tail call i32 @reverse(i64 2369510)
%5 = tail call i32 @reverse(i64 2183293)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug_file_rename(char const *);
void cctools_debug_rename(const char *suffix) { debug_file_rename(suffix); }


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

x86 assembly (clang, -O2):
<cctools_debug_rename>:
jmp    1030 <debug_file_rename@plt>

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

LLVM IR (-O2):
define void @cctools_debug_rename(i8* %0) {
%2 = tail call i32 @debug_file_rename(i8* %0)
ret void
}
int IsAddop(char c) { return (c == '+') || (c == '-'); }


x86 assembly (clang, -O0):
<IsAddop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     1129 <IsAddop+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAddop>:
add    $0xd5,%dil
xor    %eax,%eax
test   $0xfd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsAddop(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsAddop(i8 signext %0) {
%2 = icmp eq i8 %0, 43
%3 = icmp eq i8 %0, 45
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long long LowestBitLL(unsigned long long x) { return x & ~(x - 1); }


x86 assembly (clang, -O0):
<LowestBitLL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowestBitLL>:
mov    %rdi,%rax
neg    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @LowestBitLL(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = sub i64 %4, 1
%6 = xor i64 %5, -1
%7 = and i64 %3, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @LowestBitLL(i64 %0) {
%2 = sub i64 0, %0
%3 = and i64 %2, %0
ret i64 %3
}
/* Variables and functions */
void __aos_udelay(int);
void aos_udelay(int usecs) { return __aos_udelay(usecs); }


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

x86 assembly (clang, -O2):
<aos_udelay>:
jmp    1030 <__aos_udelay@plt>

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

LLVM IR (-O2):
define void @aos_udelay(i32 %0) {
tail call void @__aos_udelay(i32 %0)
ret void
}
int test_imm_FAint16_reg(short val) {
  return ((val) & (0xFA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FAint16_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, 250
%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_FAint16_reg(i16 signext %0) {
%2 = and i16 %0, 250
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ put32le(struct buffer *, int);
void put64le(struct buffer *input, uint64_t val) {
  put32le(input, val);
  put32le(input, val >> 32);
}


x86 assembly (clang, -O0):
<put64le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <put32le@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <put32le@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put64le>:
push   %rbx
mov    %rdi,%rbx
call   1030 <put32le@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <put32le@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @put64le(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @put32le(%struct.buffer* %5, i32 %6)
%8 = load %struct.buffer*, %struct.buffer** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 32
%11 = call i32 @put32le(%struct.buffer* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @put64le(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @put32le(%struct.buffer* %0, i32 %1)
%4 = tail call i32 @put32le(%struct.buffer* %0, i32 poison)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getc(int /*<<< orphan*/ *);
void SkipESCSeq(FILE *in, int temp, int *shifted_in) {
  if ((temp == '$') || (temp == '('))
    getc(in);
  if ((temp == 'K') || (temp == '$'))
    *shifted_in = 1;
  else
    *shifted_in = 0;
}


x86 assembly (clang, -O0):
<SkipESCSeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x24,-0xc(%rbp)
je     1137 <SkipESCSeq+0x27>
cmpl   $0x28,-0xc(%rbp)
jne    1140 <SkipESCSeq+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
cmpl   $0x4b,-0xc(%rbp)
je     1154 <SkipESCSeq+0x44>
cmpl   $0x24,-0xc(%rbp)
jne    1163 <SkipESCSeq+0x53>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    116d <SkipESCSeq+0x5d>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipESCSeq>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
cmp    $0x24,%esi
je     1127 <SkipESCSeq+0x17>
cmp    $0x4b,%ebp
je     1136 <SkipESCSeq+0x26>
cmp    $0x28,%ebp
jne    113d <SkipESCSeq+0x2d>
call   1030 <getc@plt>
xor    %eax,%eax
cmp    $0x24,%ebp
sete   %al
jmp    113f <SkipESCSeq+0x2f>
mov    $0x1,%eax
jmp    113f <SkipESCSeq+0x2f>
xor    %eax,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @SkipESCSeq(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* %5
%8 = icmp eq i32 %7, 36
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 40
br i1 %11, label %12, label %15
12: ; preds = %9, %3
%13 = load i32*, i32** %4
%14 = call i32 @getc(i32* %13)
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 75
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 36
br i1 %20, label %21, label %23
21: ; preds = %18, %15
%22 = load i32*, i32** %6
store i32 1, i32* %22
br label %25
23: ; preds = %18
%24 = load i32*, i32** %6
store i32 0, i32* %24
br label %25
25: ; preds = %23, %21
ret void
}

LLVM IR (-O2):
define void @SkipESCSeq(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
switch i32 %1, label %8 [
i32 40, label %4
i32 36, label %4
i32 75, label %9
]
4: ; preds = %3, %3
%5 = tail call i32 @getc(i32* %0)
%6 = icmp eq i32 %1, 36
%7 = zext i1 %6 to i32
br label %9
8: ; preds = %3
br label %9
9: ; preds = %4, %3, %8
%10 = phi i32 [ 0, %8 ], [ 1, %3 ], [ %7, %4 ]
store i32 %10, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NET_REMOVE_IF;
int ioctl(int, int /*<<< orphan*/, int);
int dvbnet_remove_interface(int fd, int ifnum) {
  return ioctl(fd, NET_REMOVE_IF, ifnum);
}


x86 assembly (clang, -O0):
<dvbnet_remove_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvbnet_remove_interface>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@NET_REMOVE_IF = global i32 0
define i32 @dvbnet_remove_interface(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* @NET_REMOVE_IF
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@NET_REMOVE_IF = global i32 0
define i32 @dvbnet_remove_interface(i32 %0, i32 %1) {
%3 = load i32, i32* @NET_REMOVE_IF
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
int AMCTimingEvent_ResetTimeout(struct AMCTimingEvent *timeEvent) { return -1; }


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

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

LLVM IR (-O0):
%struct.AMCTimingEvent = type opaque
define i32 @AMCTimingEvent_ResetTimeout(%struct.AMCTimingEvent* %0) {
%2 = alloca %struct.AMCTimingEvent*
store %struct.AMCTimingEvent* %0, %struct.AMCTimingEvent** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.AMCTimingEvent = type opaque
define i32 @AMCTimingEvent_ResetTimeout(%struct.AMCTimingEvent* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void clear_mem_error(unsigned char reason) {
  outb(0x08, 0x37);
  outb(0x09, 0x37);
}


x86 assembly (clang, -O0):
<clear_mem_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x8,%edi
mov    $0x37,%esi
call   1030 <outb@plt>
mov    $0x9,%edi
mov    $0x37,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_mem_error>:
push   %rax
mov    $0x8,%edi
mov    $0x37,%esi
call   1030 <outb@plt>
mov    $0x9,%edi
mov    $0x37,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @clear_mem_error(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @outb(i32 8, i32 55)
%4 = call i32 @outb(i32 9, i32 55)
ret void
}

LLVM IR (-O2):
define void @clear_mem_error(i8 zeroext %0) {
%2 = tail call i32 @outb(i32 8, i32 55)
%3 = tail call i32 @outb(i32 9, i32 55)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _emxload_env(char *);
int /*<<< orphan*/ _response(int *, char ***);
int /*<<< orphan*/ _wildcard(int *, char ***);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void initialize_main(int *pargc, char ***pargv) {
  _response(pargc, pargv);
  _wildcard(pargc, pargv);
  _emxload_env("RCSLOAD");
  setvbuf(stdout, NULL, _IOFBF, BUFSIZ);
}


x86 assembly (clang, -O0):
<initialize_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_response@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_wildcard@plt>
lea    0xe8f(%rip),%rdi
call   1050 <_emxload_env@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    0x2e4a(%rip),%rax
mov    (%rax),%edx
mov    0x2e51(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%esi
call   1060 <setvbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_response@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_wildcard@plt>
lea    0xe9f(%rip),%rdi
call   1050 <_emxload_env@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    0x2e5a(%rip),%rax
mov    (%rax),%edx
mov    0x2e61(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <setvbuf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"RCSLOAD\00"
@stdout = global i32 0
@_IOFBF = global i32 0
@BUFSIZ = global i32 0
define void @initialize_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 @_response(i32* %5, i8*** %6)
%8 = load i32*, i32** %3
%9 = load i8***, i8**** %4
%10 = call i32 @_wildcard(i32* %8, i8*** %9)
%11 = call i32 @_emxload_env(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = load i32, i32* @_IOFBF
%14 = load i32, i32* @BUFSIZ
%15 = call i32 @setvbuf(i32 %12, i32* null, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"RCSLOAD\00"
@stdout = global i32 0
@_IOFBF = global i32 0
@BUFSIZ = global i32 0
define void @initialize_main(i32* %0, i8*** %1) {
%3 = tail call i32 @_response(i32* %0, i8*** %1)
%4 = tail call i32 @_wildcard(i32* %0, i8*** %1)
%5 = tail call i32 @_emxload_env(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = load i32, i32* @_IOFBF
%8 = load i32, i32* @BUFSIZ
%9 = tail call i32 @setvbuf(i32 %6, i32* null, i32 %7, i32 %8)
ret void
}
void CopyRow_16_C() {}


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

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

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

LLVM IR (-O2):
define void @CopyRow_16_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getns(char *);
int /*<<< orphan*/ printf(char *);
pideNombreArchivo(char *nombreArchivo) {
  printf("Introduce el nombre del archivo: ");
  getns(nombreArchivo);
}


x86 assembly (clang, -O0):
<pideNombreArchivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <getns@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pideNombreArchivo>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <getns@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Introduce el nombre del archivo: \00"
define i32 @pideNombreArchivo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 @getns(i8* %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [34 x i8] c"Introduce el nombre del archivo: \00"
define i32 @pideNombreArchivo(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @getns(i8* %0)
ret i32 undef
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ kill();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  kill();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     1165 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
mov    $0x0,%al
call   1050 <kill@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1162 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
call   1050 <kill@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
%11 = call i32 (...) @kill()
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = tail call i32 (...) @kill()
ret i32 0
}
void strlwr(char *p) {
  while (*p) {
    if (*p >= 'A' && *p <= 'Z')
      *p += ' ';
    ++p;
  }
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <strlwr+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1141 <strlwr+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1141 <strlwr+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strlwr+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
mov    (%rdi),%al
test   %al,%al
je     112a <strlwr+0x2a>
add    $0x1,%rdi
jmp    111b <strlwr+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <strlwr+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <strlwr+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <strlwr+0x10>
ret

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

LLVM IR (-O2):
define void @strlwr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, unsigned char const *, int);
uint16_t unpackValueUint16(unsigned char const **data) {
  uint16_t value;
  memcpy(&value, *data, sizeof(value));
  assert(sizeof(value) == 2);
  *data += sizeof(value);
  return value;
}


x86 assembly (clang, -O0):
<unpackValueUint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackValueUint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
call   1030 <assert@plt>
addq   $0x4,(%rbx)
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @unpackValueUint16(i8** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i8*, i8** %0
%5 = call i32 @memcpy(i32* %2, i8* %4, i32 4)
%6 = call i32 @assert(i32 0)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8* %8, i8** %0
%9 = load i32, i32* %2
ret i32 %9
}
void *pcvp(const void *v1, const void *v2, unsigned int n, unsigned int t) {}


x86 assembly (clang, -O0):
<pcvp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @pcvp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
br() { printf("Brazylia, Rosja"); }


x86 assembly (clang, -O0):
<br>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Brazylia, Rosja\00"
define i32 @br() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"Brazylia, Rosja\00"
define i32 @br() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long time(int /*<<< orphan*/);
void SYSLOG_Init(void) {
  unsigned long t = time(0);
  printf("\r\n\r\nStarting Syslog at %lu\r\n", t);
}


x86 assembly (clang, -O0):
<SYSLOG_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYSLOG_Init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0D\0A\0D\0AStarting Syslog at %lu\0D\0A\00"
define void @SYSLOG_Init() {
%1 = alloca i64
%2 = call i64 @time(i32 0)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0D\0A\0D\0AStarting Syslog at %lu\0D\0A\00"
define void @SYSLOG_Init() {
%1 = tail call i64 @time(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
void ccmram_set(unsigned int address, unsigned char b) {
  ((unsigned char *)0x10000000)[address] = b;
}


x86 assembly (clang, -O0):
<ccmram_set>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x10000000,%eax
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccmram_set>:
mov    %edi,%eax
mov    %sil,0x10000000(%rax)
ret

LLVM IR (-O0):
define void @ccmram_set(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 268435456 to i8*), i64 %7
store i8 %5, i8* %8
ret void
}

LLVM IR (-O2):
define void @ccmram_set(i32 %0, i8 zeroext %1) {
%3 = zext i32 %0 to i64
%4 = getelementptr inbounds i8, i8* inttoptr (i64 268435456 to i8*), i64 %3
store i8 %1, i8* %4
ret void
}
/* Variables and functions */
float __nv_j1f(float);
float j1f(float __a) { return __nv_j1f(__a); }


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

x86 assembly (clang, -O2):
<j1f>:
jmp    1030 <__nv_j1f@plt>

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

LLVM IR (-O2):
define float @j1f(float %0) {
%2 = tail call float @__nv_j1f(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void memset_good4() {
  int arr[10];
  memset(arr, 0, sizeof(arr));
}


x86 assembly (clang, -O0):
<memset_good4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_good4>:
sub    $0x28,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @memset_good4() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @memset(i32* %2, i32 0, i32 40)
ret void
}

LLVM IR (-O2):
define void @memset_good4() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 40)
ret void
}
unsigned short int cast_int_ushort_fast(int x) { return (unsigned short int)x; }


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

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

LLVM IR (-O0):
define zeroext i16 @cast_int_ushort_fast(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @cast_int_ushort_fast(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void msp_copy(void *src, void *dest, size_t bytes) { memcpy(dest, src, bytes); }


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

x86 assembly (clang, -O2):
<msp_copy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @msp_copy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db_pos(double);
double psd_estimate(double re, double im) {
  double power;
  double psd;
  power = re * re + im * im;
  psd = 0 + db_pos(power / 64);
  return psd;
}


x86 assembly (clang, -O0):
<psd_estimate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <db_pos@plt>
add    $0x0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psd_estimate>:
push   %rax
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xedb(%rip),%xmm0
call   1030 <db_pos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @psd_estimate(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
store double %12, double* %5
%13 = load double, double* %5
%14 = fdiv double %13, 6.400000e+01
%15 = call i32 @db_pos(double %14)
%16 = add nsw i32 0, %15
%17 = sitofp i32 %16 to double
store double %17, double* %6
%18 = load double, double* %6
ret double %18
}

LLVM IR (-O2):
define double @psd_estimate(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = fmul double %4, 1.562500e-02
%6 = tail call i32 @db_pos(double %5)
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void c__exit(int status) { _exit(status); }


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

x86 assembly (clang, -O2):
<c__exit>:
push   %rax
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @c__exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
void free_table(struct hash_table **table) {}


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

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

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

LLVM IR (-O2):
%struct.hash_table = type opaque
define void @free_table(%struct.hash_table** nocapture %0) {
ret void
}
double test5(double a) { return 1 / a; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @test5(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @test5(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Type definitions */
typedef size_t uint8_t;
typedef size_t uint32_t;

/* Variables and functions */
int xattr_namecheck(uint8_t anleng, const uint8_t *attrname) {
  uint32_t i;
  for (i = 0; i < anleng; i++) {
    if (attrname[i] == '\0') {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<xattr_namecheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <xattr_namecheck+0x57>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    1141 <xattr_namecheck+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <xattr_namecheck+0x5e>
jmp    1146 <xattr_namecheck+0x46>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <xattr_namecheck+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xattr_namecheck>:
test   %rdi,%rdi
je     1120 <xattr_namecheck+0x20>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,(%rsi,%rax,8)
je     1123 <xattr_namecheck+0x23>
add    $0x1,%rax
cmp    %rax,%rdi
jne    1110 <xattr_namecheck+0x10>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @xattr_namecheck(i64 %0, i64* nocapture %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %12, label %6
4: ; preds = %6
%5 = icmp eq i64 %11, %0
br i1 %5, label %12, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %11, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
%11 = add nuw i64 %7, 1
br i1 %10, label %12, label %4
12: ; preds = %6, %4, %2
%13 = phi i32 [ 0, %2 ], [ 0, %4 ], [ -1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printDecimalAsBinary(int);
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int i;
  for (i = 0; i <= 256; i++) {
    printf("%-9d", i);
    printDecimalAsBinary(i);
    printf("%9o%9X\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     117e <main+0x5e>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <printDecimalAsBinary@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xed5(%rip),%r14
lea    0xed3(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <printDecimalAsBinary@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x101,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%-9d\00"
@.str.1 = [8 x i8] c"%9o%9X\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @printDecimalAsBinary(i32 %2)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %2)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 257
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
int aes_self_test(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @aes_self_test() {
ret i32 0
}
void main() {
  int *pc;
  char a = "C language";
  pc = &a;
  printf("%d\n", pc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %al,-0x9(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"C language\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i8
store i8 ptrtoint ([11 x i8]* @.str to i8), i8* %2
%3 = bitcast i8* %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"C language\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i8
store i8 ptrtoint ([11 x i8]* @.str to i8), i8* %1
%2 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int intval = 0x12345678;
  unsigned char *charptr = (unsigned char *)&intval;
  printf("%2.2X ", *charptr);
  *charptr = 0;
  printf("%8.8X\n", intval);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x78,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x12345600,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%2.2X \00"
@.str.1 = [7 x i8] c"%8.8X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 305419896, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
store i8 0, i8* %9
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%2.2X \00"
@.str.1 = [7 x i8] c"%8.8X\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 120)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 305419776)
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
int write(int, char const *, int);
int puts(const char *str) {
  int ret = write(1, str, strlen(str));
  write(1, "\n", 1);
  return ret;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edx
lea    0xea4(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 1, i8* %4, i32 %6)
store i32 %7, i32* %3
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %3
}
int test_imm_FEint64_lowword_mem(long long *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FEint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 254
%6 = icmp ne i64 %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_FEint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 254
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int mode_bits(const int version) {
  if (version < 100) {
    return 4;
  }
  if (version < 200) {
    return 3;
  }
  return version - 200;
}


x86 assembly (clang, -O0):
<mode_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    111d <mode_bits+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    1141 <mode_bits+0x41>
cmpl   $0xc8,-0x8(%rbp)
jge    1136 <mode_bits+0x36>
movl   $0x3,-0x4(%rbp)
jmp    1141 <mode_bits+0x41>
mov    -0x8(%rbp),%eax
sub    $0xc8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_bits>:
lea    -0xc8(%rdi),%eax
cmp    $0xc8,%edi
mov    $0x3,%ecx
cmovge %eax,%ecx
cmp    $0x64,%edi
mov    $0x4,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mode_bits(i32 %0) {
%2 = icmp slt i32 %0, 100
%3 = icmp slt i32 %0, 200
%4 = add nsw i32 %0, -200
%5 = select i1 %3, i32 3, i32 %4
%6 = select i1 %2, i32 4, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ random_rand();
float random_float_range(const float min, const float max) {
  return ((max - min) *
              (((float)random_rand()) / (float)(unsigned int)0xFFFFFFFF) +
          min);
}


x86 assembly (clang, -O0):
<random_float_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <random_rand@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ss %rax,%xmm2
movss  0xeb6(%rip),%xmm1
divss  %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float_range>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <random_rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mulss  0xec9(%rip),%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_float_range(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = call i64 (...) @random_rand()
%9 = sitofp i64 %8 to float
%10 = fdiv float %9, 0x41F0000000000000
%11 = load float, float* %3
%12 = call float @llvm.fmuladd.f32(float %7, float %10, float %11)
ret float %12
}

LLVM IR (-O2):
define float @random_float_range(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call i64 (...) @random_rand()
%5 = sitofp i64 %4 to float
%6 = fmul float %5, 0x3DF0000000000000
%7 = tail call float @llvm.fmuladd.f32(float %3, float %6, float %0)
ret float %7
}
/* Variables and functions */
int main_ui_release();
int device_main_ui_release() { return main_ui_release(); }


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

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

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

LLVM IR (-O2):
define i32 @device_main_ui_release() {
%1 = tail call i32 (...) @main_ui_release()
ret i32 %1
}