xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long _strtoul(char const *, char **, int);
unsigned long strtoul(const char *s, char **ptr, int base) {
  return _strtoul(s, ptr, base);
}


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

x86 assembly (clang, -O2):
<strtoul>:
jmp    1030 <_strtoul@plt>

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

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @_strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
void channel_remove(struct eiwic_channel *chan) { return; }


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

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

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

LLVM IR (-O2):
%struct.eiwic_channel = type opaque
define void @channel_remove(%struct.eiwic_channel* nocapture %0) {
ret void
}
putchar(c) { write(2, &c, 1); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x2,%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 2, i32* %3, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 2, i32* %2, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void movsx_reg32_8preg64preg64(int reg1, int reg2, int reg3) {
  put8(0x0F);
  put8(0xBE);
  put8((reg1 << 3) | 0x04);
  put8((reg2 << 3) | reg3);
}


x86 assembly (clang, -O0):
<movsx_reg32_8preg64preg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbe,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x4,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     -0xc(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_8preg64preg64>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbe,%edi
call   1030 <put8@plt>
lea    0x4(,%rbx,8),%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %r14d,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @movsx_reg32_8preg64preg64(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 = call i32 @put8(i32 15)
%8 = call i32 @put8(i32 190)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = or i32 %10, 4
%12 = call i32 @put8(i32 %11)
%13 = load i32, i32* %5
%14 = shl i32 %13, 3
%15 = load i32, i32* %6
%16 = or i32 %14, %15
%17 = call i32 @put8(i32 %16)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_8preg64preg64(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 15)
%5 = tail call i32 @put8(i32 190)
%6 = shl i32 %0, 3
%7 = or i32 %6, 4
%8 = tail call i32 @put8(i32 %7)
%9 = shl i32 %1, 3
%10 = or i32 %9, %2
%11 = tail call i32 @put8(i32 %10)
ret void
}
void RTMsgErrorRcV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMsgErrorRcV() {
ret void
}
/* Variables and functions */
double GetScrCapsY63();
double getscrcapsy() { return GetScrCapsY63(); }


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

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

LLVM IR (-O0):
define double @getscrcapsy() {
%1 = call double (...) @GetScrCapsY63()
ret double %1
}

LLVM IR (-O2):
define double @getscrcapsy() {
%1 = tail call double (...) @GetScrCapsY63()
ret double %1
}
void _Jv_argc(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_argc() {
ret void
}
/* Type definitions */
struct m_config {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bstr(char const *);
int m_config_check_option(struct m_config *, int /*<<< orphan*/,
                          int /*<<< orphan*/, int);
int m_config_check_option0(struct m_config *config, const char *name,
                           const char *param, bool ambiguous) {
  return m_config_check_option(config, bstr(name), bstr(param), ambiguous);
}


x86 assembly (clang, -O0):
<m_config_check_option0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <bstr@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bstr@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    %eax,%edx
mov    -0x1c(%rbp),%ecx
call   1030 <m_config_check_option@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_config_check_option0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <bstr@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <bstr@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <m_config_check_option@plt>

LLVM IR (-O0):
%struct.m_config = type { i32 }
define i32 @m_config_check_option0(%struct.m_config* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.m_config*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.m_config* %0, %struct.m_config** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.m_config*, %struct.m_config** %5
%10 = load i8*, i8** %6
%11 = call i32 @bstr(i8* %10)
%12 = load i8*, i8** %7
%13 = call i32 @bstr(i8* %12)
%14 = load i32, i32* %8
%15 = call i32 @m_config_check_option(%struct.m_config* %9, i32 %11, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.m_config = type { i32 }
define i32 @m_config_check_option0(%struct.m_config* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @bstr(i8* %1)
%6 = tail call i32 @bstr(i8* %2)
%7 = tail call i32 @m_config_check_option(%struct.m_config* %0, i32 %5, i32 %6, i32 %3)
ret i32 %7
}
void enterMultiProtocolRtlsSysPatch(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long, ...);
int main(void) {
  unsigned int ui;
  long l;
  printf("ui %zu l %zu\n", sizeof(ui), sizeof(l));
  l = 0;
  ui = 1;
  l += -ui;
  printf("l %ld (%lx)  s? %d %d\n", l, l,
         ((1 ? (-1) : ((-ui))) < (1 ? (1) : ((-ui)))),
         ((1 ? (-1) : ((l))) < (1 ? (1) : ((l)))));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rdi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x0,%al
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    $0x4,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"ui %zu l %zu\0A\00"
@.str.1 = [23 x i8] c"l %ld (%lx) s? %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 4, i64 8)
store i64 0, i64* %3
store i32 1, i32* %2
%5 = load i32, i32* %2
%6 = sub i32 0, %5
%7 = zext i32 %6 to i64
%8 = load i64, i64* %3
%9 = add nsw i64 %8, %7
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %3
%12 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %10, i64 %11, i32 0, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"ui %zu l %zu\0A\00"
@.str.1 = [23 x i8] c"l %ld (%lx) s? %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 4, i64 8)
%2 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 4294967295, i64 4294967295, i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_operation_cancel() {
  printf("NOT IMPLEMENTED:"
         "pa_operation_cancel"
         "\n");
}


x86 assembly (clang, -O0):
<pa_operation_cancel>:
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):
<pa_operation_cancel>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_operation_cancel\00"
define i32 @pa_operation_cancel() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ morseCodeGenerator();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("This program translates a line into Morse code.\n");
  morseCodeGenerator();
  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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <morseCodeGenerator@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"This program translates a line into Morse code.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @morseCodeGenerator()
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"This program translates a line into Morse code.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @morseCodeGenerator()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 3, count = 0;
  while (n > 0) {
    if ((n & 1) == 1) {
      count++;
    }
    n = n >> 1;
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115d <main+0x4d>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    114f <main+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe99(%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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
double fmod(int /*<<< orphan*/, double);
int /*<<< orphan*/ pow(double, int);
double generateBlumBlumShub(void) {
  double n = 512504565321;
  static double xn = 496880664266;
  double value = xn;
  xn = fmod(pow(xn, 2), n);
  return value;
}


x86 assembly (clang, -O0):
<generateBlumBlumShub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0x2ef3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0x2ee6(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <fmod@plt>
movsd  %xmm0,0x2ec8(%rip)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateBlumBlumShub>:
push   %rax
movsd  0x2f07(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xec0(%rip),%xmm0
mov    %eax,%edi
call   1030 <fmod@plt>
movsd  %xmm0,0x2ee1(%rip)
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@generateBlumBlumShub.xn = internal global double 0x425CEC194FB28000
define double @generateBlumBlumShub() {
%1 = alloca double
%2 = alloca double
store double 0x425DD4E9C3924000, double* %1
%3 = load double, double* @generateBlumBlumShub.xn
store double %3, double* %2
%4 = load double, double* @generateBlumBlumShub.xn
%5 = call i32 @pow(double %4, i32 2)
%6 = load double, double* %1
%7 = call double @fmod(i32 %5, double %6)
store double %7, double* @generateBlumBlumShub.xn
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
@generateBlumBlumShub.xn = internal unnamed_addr global double 0x425CEC194FB28000
define double @generateBlumBlumShub() {
%1 = load double, double* @generateBlumBlumShub.xn
%2 = tail call i32 @pow(double %1, i32 2)
%3 = tail call double @fmod(i32 %2, double 0x425DD4E9C3924000)
store double %3, double* @generateBlumBlumShub.xn
ret double %1
}
int _read(int fd, char *buf, int nbytes) {
  (void)fd;
  (void)buf;
  (void)nbytes;
  return 0;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int close(int);
int myclose(int fd) {
  int ret = close(fd);
  return ret;
}


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

x86 assembly (clang, -O2):
<myclose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @myclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
void strchr(void) {}


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

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

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

LLVM IR (-O2):
define void @strchr() {
ret void
}
char *getlogin(void) { return "root"; }


x86 assembly (clang, -O0):
<getlogin>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"root\00"
define i8* @getlogin() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"root\00"
define i8* @getlogin() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void minimizeString(char *input) {
  for (; *input; input++) {
    if (*input >= 'A' && *input <= 'Z')
      *input += 'a' - 'A';
  }
}


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

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

LLVM IR (-O0):
define void @minimizeString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %24, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %27
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
br label %24
24: ; preds = %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %2
br label %3
27: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @minimizeString(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 = %4, %9
%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
}
/* Variables and functions */
int /*<<< orphan*/ bmmap_print();
int /*<<< orphan*/ halt();
int /*<<< orphan*/ init();
int /*<<< orphan*/ pmmap_print();
int /*<<< orphan*/ vty_puts(char *);
void main() {
  init();
  vty_puts("Hello, world...\n");
  bmmap_print();
  pmmap_print();
  halt();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init@plt>
lea    0xe9e(%rip),%rdi
call   1070 <vty_puts@plt>
mov    $0x0,%al
call   1040 <bmmap_print@plt>
mov    $0x0,%al
call   1030 <pmmap_print@plt>
mov    $0x0,%al
call   1060 <halt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
lea    0xea1(%rip),%rdi
call   1070 <vty_puts@plt>
xor    %eax,%eax
call   1040 <bmmap_print@plt>
xor    %eax,%eax
call   1030 <pmmap_print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <halt@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Hello, world...\0A\00"
define void @main() {
%1 = call i32 (...) @init()
%2 = call i32 @vty_puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @bmmap_print()
%4 = call i32 (...) @pmmap_print()
%5 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Hello, world...\0A\00"
define void @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 @vty_puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @bmmap_print()
%4 = tail call i32 (...) @pmmap_print()
%5 = tail call i32 (...) @halt()
ret void
}
void TimerOC1PolarityConfigure(unsigned long ulBase, unsigned long ulPolarity) {
  unsigned long ulTempccer = 0;

  ;

  ;
  ulTempccer = (*((volatile unsigned long *)(ulBase + 0x00000020)));
  ulTempccer &= ~0x00000002;
  ulTempccer |= ulPolarity;
  (*((volatile unsigned long *)(ulBase + 0x00000020))) = ulTempccer;
}


x86 assembly (clang, -O0):
<TimerOC1PolarityConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xfffffffffffffffd,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC1PolarityConfigure>:
mov    0x20(%rdi),%rax
and    $0xfffffffffffffffd,%rax
or     %rsi,%rax
mov    %rax,0x20(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC1PolarityConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -3
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = or i64 %13, %12
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %3
%17 = add i64 %16, 32
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @TimerOC1PolarityConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 32
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -3
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
int abs(int i) {
  if (i < 0) {
    return -i;
  }
  return i;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ p18_adc();
int /*<<< orphan*/ p18_eeprom();
int /*<<< orphan*/ p18_int_pin();
int /*<<< orphan*/ p18_int_portb();
int /*<<< orphan*/ p18_mssp();
int /*<<< orphan*/ p18_tmr0();
int /*<<< orphan*/ p18_tmr1();
int /*<<< orphan*/ p18_tmr2();
int /*<<< orphan*/ p18_tmr3();
int /*<<< orphan*/ p18_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC18F4520_periferic(void) {
  p18_mssp();
  p18_adc();
  p18_int_pin();
  p18_int_portb();
  p18_tmr0();
  p18_wdt();
  p18_eeprom();
  p18_tmr1();
  p18_tmr2();
  p18_tmr3();
  serial(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F4520_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10c0 <p18_mssp@plt>
mov    $0x0,%al
call   1030 <p18_adc@plt>
mov    $0x0,%al
call   1070 <p18_int_pin@plt>
mov    $0x0,%al
call   1080 <p18_int_portb@plt>
mov    $0x0,%al
call   1050 <p18_tmr0@plt>
mov    $0x0,%al
call   1090 <p18_wdt@plt>
mov    $0x0,%al
call   10d0 <p18_eeprom@plt>
mov    $0x0,%al
call   10a0 <p18_tmr1@plt>
mov    $0x0,%al
call   1040 <p18_tmr2@plt>
mov    $0x0,%al
call   10b0 <p18_tmr3@plt>
xor    %edi,%edi
call   1060 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F4520_periferic>:
push   %rax
xor    %eax,%eax
call   10c0 <p18_mssp@plt>
xor    %eax,%eax
call   1030 <p18_adc@plt>
xor    %eax,%eax
call   1070 <p18_int_pin@plt>
xor    %eax,%eax
call   1080 <p18_int_portb@plt>
xor    %eax,%eax
call   1050 <p18_tmr0@plt>
xor    %eax,%eax
call   1090 <p18_wdt@plt>
xor    %eax,%eax
call   10d0 <p18_eeprom@plt>
xor    %eax,%eax
call   10a0 <p18_tmr1@plt>
xor    %eax,%eax
call   1040 <p18_tmr2@plt>
xor    %eax,%eax
call   10b0 <p18_tmr3@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <serial@plt>

LLVM IR (-O0):
define void @PIC18F4520_periferic() {
%1 = call i32 (...) @p18_mssp()
%2 = call i32 (...) @p18_adc()
%3 = call i32 (...) @p18_int_pin()
%4 = call i32 (...) @p18_int_portb()
%5 = call i32 (...) @p18_tmr0()
%6 = call i32 (...) @p18_wdt()
%7 = call i32 (...) @p18_eeprom()
%8 = call i32 (...) @p18_tmr1()
%9 = call i32 (...) @p18_tmr2()
%10 = call i32 (...) @p18_tmr3()
%11 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F4520_periferic() {
%1 = tail call i32 (...) @p18_mssp()
%2 = tail call i32 (...) @p18_adc()
%3 = tail call i32 (...) @p18_int_pin()
%4 = tail call i32 (...) @p18_int_portb()
%5 = tail call i32 (...) @p18_tmr0()
%6 = tail call i32 (...) @p18_wdt()
%7 = tail call i32 (...) @p18_eeprom()
%8 = tail call i32 (...) @p18_tmr1()
%9 = tail call i32 (...) @p18_tmr2()
%10 = tail call i32 (...) @p18_tmr3()
%11 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nmm_get_cpu(int *, int *);
void NMM_GET_CPU(int *c, int *i) { nmm_get_cpu(c, i); }


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

x86 assembly (clang, -O2):
<NMM_GET_CPU>:
jmp    1030 <nmm_get_cpu@plt>

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

LLVM IR (-O2):
define void @NMM_GET_CPU(i32* %0, i32* %1) {
%3 = tail call i32 @nmm_get_cpu(i32* %0, i32* %1)
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
void flockfile(int /*<<< orphan*/);
void my_flockfile(struct aFILE *fp) { return flockfile(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_flockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <flockfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_flockfile>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <flockfile@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define void @my_flockfile(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
ret void
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define void @my_flockfile(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
tail call void @flockfile(i32 %2)
ret void
}
/* Variables and functions */
double __ocml_y0_f64(double);
double y0(double x) { return __ocml_y0_f64(x); }


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

x86 assembly (clang, -O2):
<y0>:
jmp    1030 <__ocml_y0_f64@plt>

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

LLVM IR (-O2):
define double @y0(double %0) {
%2 = tail call double @__ocml_y0_f64(double %0)
ret double %2
}
void *test_anti_range_87(signed char n) {
  extern void *alloc_anti_range_87(signed char) __attribute__((alloc_size(1)));
  if (0x7f - 2 <= n && n <= 0x7f - 1)
    n = 0x7f - 2 - 1;
  return alloc_anti_range_87(n);
}


x86 assembly (clang, -O0):
<test_anti_range_87>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x7d,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_87+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
jg     1140 <test_anti_range_87+0x30>
movb   $0x7c,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_87@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_87>:
lea    -0x7d(%rdi),%eax
cmp    $0x2,%al
mov    $0x7c,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_87@plt>

LLVM IR (-O0):
define i8* @test_anti_range_87(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 125, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 126
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 124, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_87(i8 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_87(i8 signext %0) {
%2 = add i8 %0, -125
%3 = icmp ult i8 %2, 2
%4 = select i1 %3, i8 124, i8 %0
%5 = tail call i8* @alloc_anti_range_87(i8 signext %4)
ret i8* %5
}
/* Variables and functions */
scalar_t__ isnan(double);
double current_or_last_math(double input, double last) {
  if (isnan(input))
    return last;
  else
    return input;
}


x86 assembly (clang, -O0):
<current_or_last_math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1145 <current_or_last_math+0x35>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114f <current_or_last_math+0x3f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_or_last_math>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <isnan@plt>
movsd  0x10(%rsp),%xmm0
test   %rax,%rax
je     1136 <current_or_last_math+0x26>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @current_or_last_math(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call i64 @isnan(double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @current_or_last_math(double %0, double %1) {
%3 = tail call i64 @isnan(double %0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, double %0, double %1
ret double %5
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void RFCCpeIntClear(uint32_t ui32Mask) {
  (*((volatile unsigned long *)(0x40041000 + 0x00000010))) = ~ui32Mask;
}


x86 assembly (clang, -O0):
<RFCCpeIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    $0x40041010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFCCpeIntClear>:
not    %rdi
mov    %rdi,0x40041010
40
ret

LLVM IR (-O0):
define void @RFCCpeIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
store volatile i64 %4, i64* inttoptr (i64 1074008080 to i64*)
ret void
}

LLVM IR (-O2):
define void @RFCCpeIntClear(i64 %0) {
%2 = xor i64 %0, -1
store volatile i64 %2, i64* inttoptr (i64 1074008080 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 10, i;
  for (i = num; i > 1; i--) {
    num = num * (i - 1);
  }
  printf("%d", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1153 <main+0x43>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <main+0x1c>
mov    -0x8(%rbp),%esi
lea    0xea3(%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    $0x375f00,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
void foo704(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo704(i32 %0) {
ret void
}
unsigned xrop3_86_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_86_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_86_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %ecx,%edx
or     %eax,%edx
xor    $0xff,%edx
xor    %eax,%edi
not    %ecx
and    %edx,%ecx
not    %eax
and    %esi,%eax
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_86_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_86_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, 255
%9 = xor i32 %4, %3
%10 = xor i32 %6, -1
%11 = and i32 %8, %10
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %13, %9
%15 = or i32 %14, %11
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main(void) {
  int x = 263;
  int y = 161;
  printf("Antes del intercambio:   x=%d, y=%d\n", x, y);
  swap(&x, &y);
  printf("Despues del intercambio: x=%d, y=%d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x107,-0x8(%rbp)
movl   $0xa1,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x107,0x4(%rsp)
movl   $0xa1,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x107,%esi
mov    $0xa1,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Antes del intercambio: x=%d, y=%d\0A\00"
@.str.1 = [37 x i8] c"Despues del intercambio: x=%d, y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 263, i32* %2
store i32 161, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Antes del intercambio: x=%d, y=%d\0A\00"
@.str.1 = [37 x i8] c"Despues del intercambio: x=%d, y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 263, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 161, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 263, i32 161)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
int *foo2(int *a, int *b) { return b; }


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

x86 assembly (clang, -O2):
<foo2>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i32* @foo2(i32* nocapture readnone %0, i32* readnone returned %1) {
ret i32* %1
}
char to_lower(char c) { return (char)(c + 32); }


x86 assembly (clang, -O0):
<to_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @to_lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @to_lower(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
/* Variables and functions */
int foo();
int call_me(void) { return foo() - 42; }


x86 assembly (clang, -O0):
<call_me>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
sub    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call_me() {
%1 = call i32 (...) @foo()
%2 = sub nsw i32 %1, 42
ret i32 %2
}

LLVM IR (-O2):
define i32 @call_me() {
%1 = tail call i32 (...) @foo()
%2 = add nsw i32 %1, -42
ret i32 %2
}
void RTSha256DigestFromFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha256DigestFromFile() {
ret void
}
/* Type definitions */
typedef int const uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t movmask_unsafe(const uint32_t input) {
  assert((input & 0x7f7f7f7f) == 0);
  const uint32_t mult = 0x02040810;
  const uint64_t result = (uint64_t)input * mult;
  return (result >> 32) & 0x0f;
}


x86 assembly (clang, -O0):
<movmask_unsafe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f7f7f7f,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x2040810,-0x8(%rbp)
imul   $0x2040810,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0xf,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movmask_unsafe>:
xor    %eax,%eax
test   $0x7f7f7f7f,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define i32 @movmask_unsafe(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 2139062143
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
store i32 33818640, i32* %3
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 33818640
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = ashr i32 %12, 32
%14 = and i32 %13, 15
ret i32 %14
}

LLVM IR (-O2):
define i32 @movmask_unsafe(i32 %0) {
%2 = and i32 %0, 2139062143
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ liste();
int main(int N, char *P[]) {
  double v;
  liste();
  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)
mov    $0x0,%al
call   1030 <liste@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @liste()
ret i32 0
}
/* Variables and functions */
int d36(int);
int d37(int a) { return d36(d36(a)); }


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

x86 assembly (clang, -O2):
<d37>:
push   %rax
call   1030 <d36@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d36@plt>

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

LLVM IR (-O2):
define i32 @d37(i32 %0) {
%2 = tail call i32 @d36(i32 %0)
%3 = tail call i32 @d36(i32 %2)
ret i32 %3
}