xunge/DecIR huggingface dataset:
unsigned xrop3_1_1_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;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_1_1_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
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_1_1_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 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_1_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %4
%8 = xor i32 %7, -256
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %4, %10
%12 = or i32 %11, %6
%13 = xor i32 %12, -1
%14 = and i32 %8, %13
%15 = or i32 %14, %10
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int print_str(char *s) {
  printf("s = %p\n", s);
  if (s) {
    printf("%s\n", s);
    return 0;
  } else {
    printf("Invalid pointer!\n");
    return -1;
  }
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1157 <print_str+0x47>
mov    -0x10(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <print_str+0x5c>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
je     1148 <print_str+0x28>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1159 <print_str+0x39>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"s = %p\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [18 x i8] c"Invalid pointer!\0A\00"
define i32 @print_str(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 0, i32* %2
br label %13
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"s = %p\0A\00"
@str = [17 x i8] c"Invalid pointer!\00"
define i32 @print_str(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ -1, %6 ]
ret i32 %9
}
/* Variables and functions */
float lua_check_number(int, char *);
int /*<<< orphan*/ lua_pushnumber(float);
void math_deg(void) {
  float d = lua_check_number(1, "deg");
  lua_pushnumber(d * 180. / 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<math_deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xedc(%rip),%rsi
call   1030 <lua_check_number@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_deg>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lua_check_number@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xec2(%rip),%xmm0
divsd  0xec2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"deg\00"
define void @math_deg() {
%1 = alloca float
%2 = call float @lua_check_number(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store float %2, float* %1
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
%8 = call i32 @lua_pushnumber(float %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"deg\00"
define void @math_deg() {
%1 = tail call float @lua_check_number(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = fpext float %1 to double
%3 = fmul double %2, 1.800000e+02
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
%6 = tail call i32 @lua_pushnumber(float %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void invalid() {
  printf("Invalid command, please enter a valid command or enter 'help' for "
         "help!\n");
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"Invalid command, please enter a valid command or enter 'help' for help!\0A\00"
define void @invalid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [72 x i8] c"Invalid command, please enter a valid command or enter 'help' for help!\00"
define void @invalid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct gpio_bicolor_led {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int led_gpio_bicolor_register(struct gpio_bicolor_led *led) { return -ENOSYS; }


x86 assembly (clang, -O0):
<led_gpio_bicolor_register>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_gpio_bicolor_register>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.gpio_bicolor_led = type { i32 }
@ENOSYS = global i32 0
define i32 @led_gpio_bicolor_register(%struct.gpio_bicolor_led* %0) {
%2 = alloca %struct.gpio_bicolor_led*
store %struct.gpio_bicolor_led* %0, %struct.gpio_bicolor_led** %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.gpio_bicolor_led = type { i32 }
@ENOSYS = global i32 0
define i32 @led_gpio_bicolor_register(%struct.gpio_bicolor_led* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
int PCGetFileDirType(char *directory) {}


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

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

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

LLVM IR (-O2):
define i32 @PCGetFileDirType(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ McDevIf_AddPacket(unsigned long, unsigned char const);
void McDevIf_AddPacketRepeat(unsigned long dDesc, const unsigned char *pbData,
                             unsigned long dDataCount) {
  unsigned long dCount;
  for (dCount = 0; dCount < dDataCount; dCount++) {
    McDevIf_AddPacket(dDesc, pbData[dCount]);
  }
}


x86 assembly (clang, -O0):
<McDevIf_AddPacketRepeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1160 <McDevIf_AddPacketRepeat+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
call   1030 <McDevIf_AddPacket@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <McDevIf_AddPacketRepeat+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McDevIf_AddPacketRepeat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1146 <McDevIf_AddPacketRepeat+0x36>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <McDevIf_AddPacket@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <McDevIf_AddPacketRepeat+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @McDevIf_AddPacketRepeat(i64 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @McDevIf_AddPacket(i64 %0, i8 zeroext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int, int, int, int);
int main() {
  if (foo(1, 2, 3, -1) != 1)
    abort();
  if (foo(1, 2, 3, 0) != 2)
    abort();
  if (foo(1, 2, 3, 1) != 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0xffffffff,%ecx
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1158 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1040 <foo@plt>
cmp    $0x2,%eax
je     117e <main+0x5e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%ecx
mov    $0x2,%esi
mov    $0x3,%edx
mov    %ecx,%edi
call   1040 <foo@plt>
cmp    $0x3,%eax
je     11a4 <main+0x84>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0xffffffff,%ecx
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    117c <main+0x5c>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1040 <foo@plt>
cmp    $0x2,%eax
jne    117c <main+0x5c>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1040 <foo@plt>
cmp    $0x3,%eax
jne    117c <main+0x5c>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i32 2, i32 3, i32 -1)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @foo(i32 1, i32 2, i32 3, i32 0)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @foo(i32 1, i32 2, i32 3, i32 1)
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 -1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 0)
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 1)
%12 = icmp eq i32 %11, 3
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}
int byte_row_big5(int byte) {
  if (byte >= 0xa1 && byte < 0xff)
    return byte - 0xa1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_row_big5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa1,-0x8(%rbp)
jl     1131 <byte_row_big5+0x31>
cmpl   $0xff,-0x8(%rbp)
jge    1131 <byte_row_big5+0x31>
mov    -0x8(%rbp),%eax
sub    $0xa1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <byte_row_big5+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_row_big5>:
lea    -0xa1(%rdi),%ecx
cmp    $0x5e,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @byte_row_big5(i32 %0) {
%2 = add i32 %0, -161
%3 = icmp ult i32 %2, 94
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
int tolower(int c) {
  if ((c >= 'A') && (c <= 'Z')) {
    c += ('a' - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ stdscr;
void setup(void) {
  initscr();
  raw();
  noecho();
  nonl();
  intrflush(stdscr, FALSE);
  keypad(stdscr, TRUE);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1050 <raw@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    $0x0,%al
call   1070 <nonl@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    0x2e40(%rip),%rax
mov    (%rax),%esi
call   1060 <intrflush@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rbx
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1050 <raw@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
xor    %eax,%eax
call   1070 <nonl@plt>
mov    0x2e64(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e43(%rip),%rax
mov    (%rax),%esi
call   1060 <intrflush@plt>
mov    (%rbx),%edi
mov    0x2e43(%rip),%rax
mov    (%rax),%esi
pop    %rbx
jmp    1030 <keypad@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @setup() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @raw()
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @nonl()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @FALSE
%7 = call i32 @intrflush(i32 %5, i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @setup() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 (...) @nonl()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @FALSE
%7 = tail call i32 @intrflush(i32 %5, i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = tail call i32 @keypad(i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init_outpin(unsigned int);
void gpio_set(unsigned int pin, unsigned int value) {
  gpio_init_outpin(pin);
  *((volatile unsigned int *)((((volatile void *)0x01E26000) + 0x10 +
                               (pin >> 5) * 0x28) +
                              8 + (!value) * 4)) = (1 << (pin & 0x1F));
}


x86 assembly (clang, -O0):
<gpio_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gpio_init_outpin@plt>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
imul   $0x28,%eax,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1e26000,%eax
add    $0x10,%rax
add    %rcx,%rax
cmpl   $0x0,-0x8(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,0x8(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_set>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <gpio_init_outpin@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
shr    $0x2,%ebx
and    $0xfffffff8,%ebx
lea    (%rbx,%rbx,4),%ecx
xor    %edx,%edx
test   %ebp,%ebp
sete   %dl
shl    $0x2,%rdx
or     %rcx,%rdx
mov    %eax,0x1e26018(%rdx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @gpio_set(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 = call i32 @gpio_init_outpin(i32 %5)
%7 = load i32, i32* %3
%8 = and i32 %7, 31
%9 = shl i32 1, %8
%10 = load i32, i32* %3
%11 = lshr i32 %10, 5
%12 = mul i32 %11, 40
%13 = zext i32 %12 to i64
%14 = getelementptr i8, i8* getelementptr (i8, i8* inttoptr (i64 31612928 to i8*), i64 16), i64 %13
%15 = getelementptr i8, i8* %14, i64 8
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = mul nsw i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr i8, i8* %15, i64 %21
%23 = bitcast i8* %22 to i32*
store volatile i32 %9, i32* %23
ret void
}

LLVM IR (-O2):
define void @gpio_set(i32 %0, i32 %1) {
%3 = tail call i32 @gpio_init_outpin(i32 %0)
%4 = and i32 %0, 31
%5 = shl nuw i32 1, %4
%6 = lshr i32 %0, 5
%7 = mul i32 %6, 40
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 31612944 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 8
%11 = icmp eq i32 %1, 0
%12 = select i1 %11, i64 4, i64 0
%13 = getelementptr i8, i8* %10, i64 %12
%14 = bitcast i8* %13 to i32*
store volatile i32 %5, i32* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
char *voltea_string(char *);
int main(void) {
  char *s2 = "Campos verdes";
  char *s;
  s = malloc(strlen(s2));
  s = s2;
  char *s_volteado;
  s_volteado = voltea_string(s2);
  printf("%s\n", s_volteado);
  free(s_volteado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <voltea_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
call   1060 <voltea_string@plt>
mov    %rax,%rbx
lea    0xeac(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %2
store i8* %8, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @voltea_string(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @voltea_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_logf();
scalar_t__ logf(float);
void test_logf(float f) {
  if (logf(f) != logf(f))
    link_failure_logf();
}


x86 assembly (clang, -O0):
<test_logf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_logf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_logf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <logf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <logf@plt>
cmp    %rax,%rbx
jne    1149 <test_logf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_logf@plt>

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

LLVM IR (-O2):
define void @test_logf(float %0) {
%2 = tail call i64 @logf(float %0)
%3 = tail call i64 @logf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_logf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char *);
char *encode_announce_msg(char buf[128], const char *hostname, in_addr_t ip) {
  struct in_addr in_addr;
  in_addr.s_addr = ip;
  snprintf(buf, 128, "A%s@%s", hostname, inet_ntoa(in_addr));
  return buf;
}


x86 assembly (clang, -O0):
<encode_announce_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    %rax,%r8
mov    $0x80,%esi
lea    0xe98(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_announce_msg>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <inet_ntoa@plt>
lea    0xec8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rcx
mov    %rax,%r8
call   1040 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [7 x i8] c"A%s@%s\00"
define i8* @encode_announce_msg(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.in_addr
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i8* @inet_ntoa(i32 %13)
%15 = call i32 @snprintf(i8* %10, i32 128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"A%s@%s\00"
define i8* @encode_announce_msg(i8* returned %0, i8* %1, i32 %2) {
%4 = tail call i8* @inet_ntoa(i32 %2)
%5 = tail call i32 @snprintf(i8* %0, i32 128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
ret i8* %0
}
char bitstream_read_byte(char **b) {
  unsigned char val = **b;
  *b += 1;
  return val;
}


x86 assembly (clang, -O0):
<bitstream_read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitstream_read_byte>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @bitstream_read_byte(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @bitstream_read_byte(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
/* Variables and functions */
int max_int(int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int V1 = max_int(1, 2);
  printf("%d\n", V1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <max_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <max_int@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @max_int(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int neg_julian_non_leap(int year) { return (3 - year) & 3; }


x86 assembly (clang, -O0):
<neg_julian_non_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3,%eax
sub    -0x4(%rbp),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_julian_non_leap>:
mov    $0x3,%eax
sub    %edi,%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @neg_julian_non_leap(i32 %0) {
%2 = sub nsw i32 3, %0
%3 = and i32 %2, 3
ret i32 %3
}
int isnan(double x) {
  int hx, lx;
  hx = (*(1 + (const int *)&x) & 0x7fffffff);
  lx = *(const int *)&x;
  hx |= (unsigned)(lx | (-lx)) >> 31;
  hx = 0x7ff00000 - hx;
  return ((unsigned)(hx)) >> 31;
}


x86 assembly (clang, -O0):
<isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
or     %ecx,%eax
shr    $0x1f,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x7ff00000,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan>:
movq   %xmm0,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
and    $0x7fffffff,%ecx
xor    %edx,%edx
test   %eax,%eax
setne  %dl
or     %ecx,%edx
xor    %eax,%eax
cmp    $0x7ff00001,%edx
setae  %al
ret

LLVM IR (-O0):
define i32 @isnan(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
%5 = bitcast double* %2 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %3
%9 = bitcast double* %2 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = or i32 %11, %13
%15 = lshr i32 %14, 31
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = sub nsw i32 2146435072, %18
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = lshr i32 %20, 31
ret i32 %21
}

LLVM IR (-O2):
define i32 @isnan(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
%6 = trunc i64 %2 to i32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = or i32 %5, %8
%10 = icmp ugt i32 %9, 2146435072
%11 = zext i1 %10 to i32
ret i32 %11
}
char *bldlen(str, dest)
char *str, *dest;
{
  int len;
  len = strlen(str);
  *dest = ((len) + 040);
  strcpy(dest + 1, str);
  return (dest + len + 1);
}


x86 assembly (clang, -O0):
<bldlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bldlen>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
add    $0x20,%eax
mov    %al,(%rbx)
lea    0x1(%rbx),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
movslq %r15d,%rax
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @bldlen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 32
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
store i8 %11, i8* %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = getelementptr inbounds i8, i8* %20, i64 1
ret i8* %21
}

LLVM IR (-O2):
define i8* @bldlen(i8* nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i8
%5 = add i8 %4, 32
store i8 %5, i8* %1
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = tail call i8* @strcpy(i8* %6, i8* dereferenceable(1) %0)
%8 = shl i64 %3, 32
%9 = ashr exact i64 %8, 32
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
ret i8* %11
}
void syracuse_27(unsigned int *array) {
  unsigned int n = 27;
  unsigned int c = 0;
  array[0] = 27;
  do {
    if (n & 1)
      n = 3 * n + 1;
    else
      n = n / 2;
    ++c;
    array[c] = n + (c == 16);
  } while (n != 1);
}


x86 assembly (clang, -O0):
<syracuse_27>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1b,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1b,(%rax)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <syracuse_27+0x3e>
imul   $0x3,-0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <syracuse_27+0x47>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edx
cmpl   $0x10,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x1,-0xc(%rbp)
jne    1120 <syracuse_27+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syracuse_27>:
movl   $0x1b,(%rdi)
mov    $0x1b,%eax
mov    $0x1,%ecx
mov    %eax,%edx
shr    %edx
test   $0x1,%al
lea    0x1(%rax,%rax,2),%eax
cmove  %edx,%eax
xor    %edx,%edx
cmp    $0x10,%ecx
sete   %dl
add    %eax,%edx
mov    %ecx,%esi
mov    %edx,(%rdi,%rsi,4)
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1110 <syracuse_27+0x10>
ret

LLVM IR (-O0):
define void @syracuse_27(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 27, i32* %3
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 27, i32* %6
br label %7
7: ; preds = %30, %1
%8 = load i32, i32* %3
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = mul i32 3, %12
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %18
15: ; preds = %7
%16 = load i32, i32* %3
%17 = udiv i32 %16, 2
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %4
%20 = add i32 %19, 1
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 16
%24 = zext i1 %23 to i32
%25 = add i32 %21, %24
%26 = load i32*, i32** %2
%27 = load i32, i32* %4
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
store i32 %25, i32* %29
br label %30
30: ; preds = %18
%31 = load i32, i32* %3
%32 = icmp ne i32 %31, 1
br i1 %32, label %7, label %33
33: ; preds = %30
ret void
}

LLVM IR (-O2):
define void @syracuse_27(i32* nocapture writeonly %0) {
store i32 27, i32* %0
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 27, %1 ], [ %10, %2 ]
%4 = phi i32 [ 0, %1 ], [ %11, %2 ]
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
%7 = mul i32 %3, 3
%8 = add i32 %7, 1
%9 = lshr i32 %3, 1
%10 = select i1 %6, i32 %9, i32 %8
%11 = add i32 %4, 1
%12 = icmp eq i32 %11, 16
%13 = zext i1 %12 to i32
%14 = add i32 %10, %13
%15 = zext i32 %11 to i64
%16 = getelementptr inbounds i32, i32* %0, i64 %15
store i32 %14, i32* %16
%17 = icmp eq i32 %10, 1
br i1 %17, label %18, label %2
18: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int *malloc(int);
void malloc_interproc_no_free_bad2() {
  int *p = malloc(sizeof(p));
  int z = 3;
  int y = 4;
  int *q = p;
}


x86 assembly (clang, -O0):
<malloc_interproc_no_free_bad2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_interproc_no_free_bad2>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @malloc_interproc_no_free_bad2() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = call i32* @malloc(i32 8)
store i32* %5, i32** %1
store i32 3, i32* %2
store i32 4, i32* %3
%6 = load i32*, i32** %1
store i32* %6, i32** %4
ret void
}

LLVM IR (-O2):
define void @malloc_interproc_no_free_bad2() {
%1 = tail call i32* @malloc(i32 8)
ret void
}
int compute_image_dots(int w, int h, unsigned char *bitmap) { return 0; }


x86 assembly (clang, -O0):
<compute_image_dots>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compute_image_dots(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SuperDelay();
void ResetLoader() {
  *(volatile unsigned int *)(0xFFFFFFE0 + 0x0C) = 32;
  SuperDelay();
}


x86 assembly (clang, -O0):
<ResetLoader>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffec,%eax
movl   $0x20,(%rax)
mov    $0x0,%al
call   1030 <SuperDelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetLoader>:
mov    $0xffffffec,%eax
movl   $0x20,(%rax)
xor    %eax,%eax
jmp    1030 <SuperDelay@plt>

LLVM IR (-O0):
define void @ResetLoader() {
store volatile i32 32, i32* inttoptr (i64 4294967276 to i32*)
%1 = call i32 (...) @SuperDelay()
ret void
}

LLVM IR (-O2):
define void @ResetLoader() {
store volatile i32 32, i32* inttoptr (i64 4294967276 to i32*)
%1 = tail call i32 (...) @SuperDelay()
ret void
}
/* Variables and functions */
int my_f();
int m1() { return my_f(); }


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

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

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

LLVM IR (-O2):
define i32 @m1() {
%1 = tail call i32 (...) @my_f()
ret i32 %1
}
double mrua(float pos_inicial, float vel_inicial, float aceleracion, float t) {
  float resultado;
  resultado = pos_inicial + vel_inicial * t + aceleracion / 2 * t * t;
  return resultado;
}


x86 assembly (clang, -O0):
<mrua>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  0xec4(%rip),%xmm2
divss  %xmm2,%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrua>:
mulss  %xmm3,%xmm1
addss  %xmm0,%xmm1
mulss  0xef0(%rip),%xmm2
mulss  %xmm3,%xmm2
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @mrua(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = load float, float* %8
%13 = call float @llvm.fmuladd.f32(float %11, float %12, float %10)
%14 = load float, float* %7
%15 = fdiv float %14, 2.000000e+00
%16 = load float, float* %8
%17 = fmul float %15, %16
%18 = load float, float* %8
%19 = call float @llvm.fmuladd.f32(float %17, float %18, float %13)
store float %19, float* %9
%20 = load float, float* %9
%21 = fpext float %20 to double
ret double %21
}

LLVM IR (-O2):
define double @mrua(float %0, float %1, float %2, float %3) {
%5 = tail call float @llvm.fmuladd.f32(float %1, float %3, float %0)
%6 = fmul float %2, 5.000000e-01
%7 = fmul float %6, %3
%8 = tail call float @llvm.fmuladd.f32(float %7, float %3, float %5)
%9 = fpext float %8 to double
ret double %9
}
long long bit54() { return 0x0040000000000000LL; }


x86 assembly (clang, -O0):
<bit54>:
push   %rbp
mov    %rsp,%rbp
movabs $0x40000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit54>:
movabs $0x40000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit54() {
ret i64 18014398509481984
}

LLVM IR (-O2):
define i64 @bit54() {
ret i64 18014398509481984
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ _write(int, int *, int);
void led_addr_set(int fd, uint8_t newaddr) {
  uint8_t buf[] = {0x08, newaddr};
  _write(fd, buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<led_addr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_addr_set>:
push   %rax
movl   $0x8,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @led_addr_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 8, i32* %6
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = call i32 @_write(i32 %9, i32* %10, i32 8)
ret void
}

LLVM IR (-O2):
define void @led_addr_set(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 8, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @_write(i32 %0, i32* %5, i32 8)
ret void
}
int comp(const void *a, const void *b) { return (int *)a - (int *)b; }


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

x86 assembly (clang, -O2):
<comp>:
mov    %rdi,%rax
sub    %rsi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = ptrtoint i32* %6 to i64
%10 = ptrtoint i32* %8 to i64
%11 = sub i64 %9, %10
%12 = sdiv exact i64 %11, 4
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @comp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = lshr exact i64 %5, 2
%7 = trunc i64 %6 to i32
ret i32 %7
}
double iterate(double x_n) { return ((3.57) * (x_n) * (1.0 - x_n)); }


x86 assembly (clang, -O0):
<iterate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterate>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @iterate(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.570000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @iterate(double %0) {
%2 = fmul double %0, 3.570000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int doubleToRawLongBits(double);
__attribute__((always_)) const int ilogb2k(double d) {
  return ((doubleToRawLongBits(d) >> 52) & 0x7ff) - 0x3ff;
}


x86 assembly (clang, -O0):
<ilogb2k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <doubleToRawLongBits@plt>
mov    $0x34,%ecx
sar    %cl,%eax
and    $0x7ff,%eax
sub    $0x3ff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilogb2k>:
jmp    1030 <doubleToRawLongBits@plt>

LLVM IR (-O0):
define i32 @ilogb2k(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @doubleToRawLongBits(double %3)
%5 = ashr i32 %4, 52
%6 = and i32 %5, 2047
%7 = sub nsw i32 %6, 1023
ret i32 %7
}

LLVM IR (-O2):
define i32 @ilogb2k(double %0) {
%2 = tail call i32 @doubleToRawLongBits(double %0)
ret i32 poison
}
long double foo(long double x) { return x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @foo(x86_fp80 returned %0) {
ret x86_fp80 %0
}