xunge/DecIR huggingface dataset:
/* Variables and functions */
void breakpoint(void) {
  static int x;
  x++;
}


x86 assembly (clang, -O0):
<breakpoint>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<breakpoint>:
addl   $0x1,0x2f1d(%rip)
ret

LLVM IR (-O0):
@breakpoint.x = internal global i32 0
define void @breakpoint() {
%1 = load i32, i32* @breakpoint.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @breakpoint.x
ret void
}

LLVM IR (-O2):
@breakpoint.x = internal unnamed_addr global i32 0
define void @breakpoint() {
%1 = load i32, i32* @breakpoint.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @breakpoint.x
ret void
}
double min(double first, double second) {
  if (first < second) {
    return first;
  } else {
    return second;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <min+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(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 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
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 @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ HwFlyingF4Handle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwFlyingF4RequestUpdate() { UAVObjRequestUpdate(HwFlyingF4Handle()); }


x86 assembly (clang, -O0):
<HwFlyingF4RequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwFlyingF4Handle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwFlyingF4RequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <HwFlyingF4Handle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @HwFlyingF4RequestUpdate() {
%1 = call i32 (...) @HwFlyingF4Handle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwFlyingF4RequestUpdate() {
%1 = tail call i32 (...) @HwFlyingF4Handle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void destroy(void) { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @destroy() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
void quick_sort(int list[], int len) { qsort(list, 0, len - 1); }


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qsort@plt>

LLVM IR (-O0):
define void @quick_sort(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 = sub nsw i32 %6, 1
%8 = call i32 @qsort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @qsort(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printSomething();
int main() {
  printSomething();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @printSomething()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printSomething()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BootComCheckActivationRequest();
int /*<<< orphan*/ BootComInit();
int /*<<< orphan*/ Init();
int /*<<< orphan*/ LedToggle();
int /*<<< orphan*/ NetInit();
int /*<<< orphan*/ NetTask();
void main(void) {
  Init();
  NetInit();
  BootComInit();
  while (1) {
    LedToggle();
    NetTask();
    BootComCheckActivationRequest();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <Init@plt>
mov    $0x0,%al
call   1070 <NetInit@plt>
mov    $0x0,%al
call   1040 <BootComInit@plt>
mov    $0x0,%al
call   1030 <LedToggle@plt>
mov    $0x0,%al
call   1050 <NetTask@plt>
mov    $0x0,%al
call   1080 <BootComCheckActivationRequest@plt>
jmp    1179 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <Init@plt>
xor    %eax,%eax
call   1070 <NetInit@plt>
xor    %eax,%eax
call   1040 <BootComInit@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <LedToggle@plt>
xor    %eax,%eax
call   1050 <NetTask@plt>
xor    %eax,%eax
call   1080 <BootComCheckActivationRequest@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @Init()
%2 = call i32 (...) @NetInit()
%3 = call i32 (...) @BootComInit()
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @LedToggle()
%6 = call i32 (...) @NetTask()
%7 = call i32 (...) @BootComCheckActivationRequest()
br label %4
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 (...) @NetInit()
%3 = tail call i32 (...) @BootComInit()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @LedToggle()
%6 = tail call i32 (...) @NetTask()
%7 = tail call i32 (...) @BootComCheckActivationRequest()
br label %4
}
/* Variables and functions */
int inb(int);
int serial_received() { return inb(0x3f8 + 5) & 1; }


x86 assembly (clang, -O0):
<serial_received>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_received>:
push   %rax
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_received() {
%1 = call i32 @inb(i32 1021)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @serial_received() {
%1 = tail call i32 @inb(i32 1021)
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
void *wf(size_t size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @wf(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @wf(i64 %0) {
ret i8* null
}
/* Variables and functions */
scalar_t__ REAL_internal_gamemode_request_start();
scalar_t__ internal_load_libgamemode();
__attribute__((always_)) int gamemode_request_start(void) {
  if (internal_load_libgamemode() < 0) {
    return -1;
  }
  if (REAL_internal_gamemode_request_start() < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<gamemode_request_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <internal_load_libgamemode@plt>
cmp    $0x0,%rax
jge    1145 <gamemode_request_start+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <gamemode_request_start+0x49>
mov    $0x0,%al
call   1030 <REAL_internal_gamemode_request_start@plt>
cmp    $0x0,%rax
jge    1162 <gamemode_request_start+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <gamemode_request_start+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamemode_request_start>:
push   %rax
xor    %eax,%eax
call   1040 <internal_load_libgamemode@plt>
test   %rax,%rax
js     113a <gamemode_request_start+0x1a>
xor    %eax,%eax
call   1030 <REAL_internal_gamemode_request_start@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gamemode_request_start() {
%1 = alloca i32
%2 = call i64 (...) @internal_load_libgamemode()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %10
5: ; preds = %0
%6 = call i64 (...) @REAL_internal_gamemode_request_start()
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @gamemode_request_start() {
%1 = tail call i64 (...) @internal_load_libgamemode()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @REAL_internal_gamemode_request_start()
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ append_user_flags(char *, unsigned short);
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
void irc_user_unset(char *user, unsigned short int flags) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s -", "MODE", user);
  append_user_flags(msg, flags);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_user_unset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x1fd,%esi
lea    0xea3(%rip),%rdx
lea    0xea4(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
movzwl -0xa(%rbp),%esi
call   1050 <append_user_flags@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_user_unset>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %esi,%ebp
mov    %rdi,%r8
lea    0xebb(%rip),%rdx
lea    0xebc(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <append_user_flags@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s %s -\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_user_unset(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%10 = load i16, i16* %4
%11 = call i32 @append_user_flags(i8* %9, i16 zeroext %10)
%12 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%13 = call i32 @net_send(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s %s -\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_user_unset(i8* %0, i16 zeroext %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = call i32 @append_user_flags(i8* %4, i16 zeroext %1)
%7 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
count1() {
  long nc;
  nc = 0;
  while (getchar() != EOF) {
    ++nc;
  }
  printf("%ld\n", nc);
}


x86 assembly (clang, -O0):
<count1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <count1+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <count1+0x10>
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count1>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <count1+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @count1() {
%1 = alloca i32
%2 = alloca i64
store i64 0, i64* %2
br label %3
3: ; preds = %7, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i64, i64* %2
%9 = add nsw i64 %8, 1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
%11 = load i64, i64* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @count1() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ FixXY(int /*<<< orphan*/, int);
void LFx(void) { FixXY(0, -16); }


x86 assembly (clang, -O0):
<LFx>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xfffffff0,%esi
call   1030 <FixXY@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LFx>:
xor    %edi,%edi
mov    $0xfffffff0,%esi
jmp    1030 <FixXY@plt>

LLVM IR (-O0):
define void @LFx() {
%1 = call i32 @FixXY(i32 0, i32 -16)
ret void
}

LLVM IR (-O2):
define void @LFx() {
%1 = tail call i32 @FixXY(i32 0, i32 -16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
void __attribute__((no)) rimouski(int a, float b) {
  printf("*%d , %f\n", a, b);
  return;
}


x86 assembly (clang, -O0):
<rimouski>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%esi
movss  -0x8(%rbp),%xmm0
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rimouski>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"*%d , %f\0A\00"
define void @rimouski(i32 %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, float %1)
ret void
}
int KMAPI_GetAPIVersion_MAJOR() { return 4; }


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

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

LLVM IR (-O0):
define i32 @KMAPI_GetAPIVersion_MAJOR() {
ret i32 4
}

LLVM IR (-O2):
define i32 @KMAPI_GetAPIVersion_MAJOR() {
ret i32 4
}
int clamp(int val, int min, int max) {
  return val < min ? min : (val > max ? max : val);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
bool is_whitespace(char c) {
  return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
ja     1120 <is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <is_whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
unsigned sizeof_size(void) { return (unsigned)sizeof(size_t); }


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

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

LLVM IR (-O0):
define i32 @sizeof_size() {
ret i32 8
}

LLVM IR (-O2):
define i32 @sizeof_size() {
ret i32 8
}
/* Variables and functions */
int strcmp(char *, char *);
int revsort(const void *_a, const void *_b) {
  char *a = *(char **)_a;
  char *b = *(char **)_b;
  return strcmp(b, a);
}


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

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

LLVM IR (-O0):
define i32 @revsort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %5
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @revsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(1) %4)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(FILE *stream) {}


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

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

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

LLVM IR (-O2):
define i32 @fflush(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int strcmp(char const *, char const *);
int comparestrings(const char *arg1, const char *arg2) {
  return (strcmp(arg1, arg2));
}


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

x86 assembly (clang, -O2):
<comparestrings>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @comparestrings(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
float cel(float F) {
  float newDegC = ((F - 32) * (5.00 / 9.00));
  printf("%.2f in degrees Fahrenheit is %.2f in degrees Celsius.\n", F,
         newDegC);
}


x86 assembly (clang, -O0):
<cel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xede(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cel>:
movss  0xee8(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xee0(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"%.2f in degrees Fahrenheit is %.2f in degrees Celsius.\0A\00"
define float @cel(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fsub float %5, 3.200000e+01
%7 = fpext float %6 to double
%8 = fmul double %7, 0x3FE1C71C71C71C72
%9 = fptrunc double %8 to float
store float %9, float* %4
%10 = load float, float* %3
%11 = load float, float* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), float %10, float %11)
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
@.str = [56 x i8] c"%.2f in degrees Fahrenheit is %.2f in degrees Celsius.\0A\00"
define float @cel(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), float %0, float %5)
ret float undef
}
/* Variables and functions */
scalar_t__ strlen(char *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
void my_logpnt(char *tbuf) { write(1, tbuf, strlen(tbuf) + 1); }


x86 assembly (clang, -O0):
<my_logpnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_logpnt>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    $0x1,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @my_logpnt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i32 @write(i32 1, i8* %3, i64 %6)
ret void
}

LLVM IR (-O2):
define void @my_logpnt(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @write(i32 1, i8* %0, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_RECURSIVE_NP;
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
int pt_mutex_init(pthread_mutex_t *mutex) {
  pthread_mutexattr_t a;
  pthread_mutexattr_init(&a);
  pthread_mutexattr_settype(&a, PTHREAD_MUTEX_RECURSIVE_NP);
  return pthread_mutex_init(mutex, &a);
}


x86 assembly (clang, -O0):
<pt_mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_mutex_init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <pthread_mutex_init@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE_NP = global i32 0
define i32 @pt_mutex_init(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @pthread_mutexattr_init(i32* %3)
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE_NP
%6 = call i32 @pthread_mutexattr_settype(i32* %3, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @pthread_mutex_init(i32* %7, i32* %3)
ret i32 %8
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE_NP = global i32 0
define i32 @pt_mutex_init(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_mutexattr_init(i32* %2)
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE_NP
%6 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %5)
%7 = call i32 @pthread_mutex_init(i32* %0, i32* %2)
ret i32 %7
}
int d16_to_int(int x) { return (x + 32768) >> 16; }


x86 assembly (clang, -O0):
<d16_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d16_to_int>:
lea    0x8000(%rdi),%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @d16_to_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 32768
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @d16_to_int(i32 %0) {
%2 = add nsw i32 %0, 32768
%3 = ashr i32 %2, 16
ret i32 %3
}
/* Variables and functions */
char *mandoc_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *mandoc_strndup(const char *ptr, size_t sz) {
  char *p;
  p = mandoc_malloc(sz + 1);
  memcpy(p, ptr, sz);
  p[(int)sz] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<mandoc_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <mandoc_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mandoc_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <mandoc_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @mandoc_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @mandoc_malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = shl i64 %1, 32
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
/* Variables and functions */
int bar();
int __attribute__((always_)) foo() { return bar(); }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
long OpsFromSuper(long size, long nz) {
  long ops = 0;
  ops += size * (size + 1) * (2 * size + 1) / 6;
  ops += size * size * (nz - size);
  ops += 2 * size * (nz - size) * (nz - size + 1) / 2;
  return (ops);
}


x86 assembly (clang, -O0):
<OpsFromSuper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x1,%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
imul   %rcx,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpsFromSuper>:
lea    0x1(%rdi),%rcx
imul   %rdi,%rcx
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
imul   %rcx,%rax
movabs $0x2aaaaaaaaaaaaaab,%rcx
aa aa 2a
imul   %rcx
lea    (%rdi,%rdi,1),%r8
mov    %rdx,%rcx
shr    $0x3f,%rcx
add    %rdx,%rcx
sub    %rdi,%rsi
imul   %rdi,%rdi
imul   %rsi,%rdi
add    %rdi,%rcx
imul   %rsi,%r8
lea    0x1(%rsi),%rax
imul   %r8,%rax
sar    %rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @OpsFromSuper(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 = load i64, i64* %3
%8 = add nsw i64 %7, 1
%9 = mul nsw i64 %6, %8
%10 = load i64, i64* %3
%11 = mul nsw i64 2, %10
%12 = add nsw i64 %11, 1
%13 = mul nsw i64 %9, %12
%14 = sdiv i64 %13, 6
%15 = load i64, i64* %5
%16 = add nsw i64 %15, %14
store i64 %16, i64* %5
%17 = load i64, i64* %3
%18 = load i64, i64* %3
%19 = mul nsw i64 %17, %18
%20 = load i64, i64* %4
%21 = load i64, i64* %3
%22 = sub nsw i64 %20, %21
%23 = mul nsw i64 %19, %22
%24 = load i64, i64* %5
%25 = add nsw i64 %24, %23
store i64 %25, i64* %5
%26 = load i64, i64* %3
%27 = mul nsw i64 2, %26
%28 = load i64, i64* %4
%29 = load i64, i64* %3
%30 = sub nsw i64 %28, %29
%31 = mul nsw i64 %27, %30
%32 = load i64, i64* %4
%33 = load i64, i64* %3
%34 = sub nsw i64 %32, %33
%35 = add nsw i64 %34, 1
%36 = mul nsw i64 %31, %35
%37 = sdiv i64 %36, 2
%38 = load i64, i64* %5
%39 = add nsw i64 %38, %37
store i64 %39, i64* %5
%40 = load i64, i64* %5
ret i64 %40
}

LLVM IR (-O2):
define i64 @OpsFromSuper(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 1
%4 = mul nsw i64 %3, %0
%5 = shl nsw i64 %0, 1
%6 = or i64 %5, 1
%7 = mul nsw i64 %4, %6
%8 = sdiv i64 %7, 6
%9 = mul nsw i64 %0, %0
%10 = sub nsw i64 %1, %0
%11 = mul nsw i64 %9, %10
%12 = add nsw i64 %8, %11
%13 = mul nsw i64 %10, %5
%14 = add nsw i64 %10, 1
%15 = mul nsw i64 %13, %14
%16 = sdiv i64 %15, 2
%17 = add nsw i64 %12, %16
ret i64 %17
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ perror(char *);
int tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/, struct termios *);
int mgetkey_attr_set(struct termios *ptty_attr) {
  if (tcsetattr(STDIN_FILENO, TCSANOW, ptty_attr) == -1) {
    perror("mgetkey: Cannot set tty attributes");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<mgetkey_attr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <tcsetattr@plt>
cmp    $0xffffffff,%eax
jne    1168 <mgetkey_attr_set+0x48>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <mgetkey_attr_set+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgetkey_attr_set>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <tcsetattr@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1149 <mgetkey_attr_set+0x29>
pop    %rcx
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
@.str = [35 x i8] c"mgetkey: Cannot set tty attributes\00"
define i32 @mgetkey_attr_set(%struct.termios* %0) {
%2 = alloca i32
%3 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %3
%4 = load i32, i32* @STDIN_FILENO
%5 = load i32, i32* @TCSANOW
%6 = load %struct.termios*, %struct.termios** %3
%7 = call i32 @tcsetattr(i32 %4, i32 %5, %struct.termios* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
@.str = [35 x i8] c"mgetkey: Cannot set tty attributes\00"
define i32 @mgetkey_attr_set(%struct.termios* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @TCSANOW
%4 = tail call i32 @tcsetattr(i32 %2, i32 %3, %struct.termios* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %9
}
void foo552(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo552(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i >= 5000; i++) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1388,-0x8(%rbp)
jl     1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char);
int main() {
  char a = 'L';
  char b = 'A';
  char c = 'S';
  char d = 'T';
  printf(" %c %c %c %c\n", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x4c,-0x5(%rbp)
movb   $0x41,-0x6(%rbp)
movb   $0x53,-0x7(%rbp)
movb   $0x54,-0x8(%rbp)
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%cl
mov    -0x7(%rbp),%al
lea    0xec1(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x8(%rbp),%r8d
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    $0x4c,%esi
mov    $0x41,%edx
mov    $0x53,%ecx
mov    $0x54,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c" %c %c %c %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8 76, i8* %2
store i8 65, i8* %3
store i8 83, i8* %4
store i8 84, i8* %5
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = load i8, i8* %4
%9 = load i8, i8* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %7, i8 signext %8, i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c" %c %c %c %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext 76, i8 signext 65, i8 signext 83, i8 signext 84)
ret i32 0
}
void *lrt_trans_lmem(void) { return (void *)(0xFFD00000); }


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

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

LLVM IR (-O0):
define i8* @lrt_trans_lmem() {
ret i8* inttoptr (i64 4291821568 to i8*)
}

LLVM IR (-O2):
define i8* @lrt_trans_lmem() {
ret i8* inttoptr (i64 4291821568 to i8*)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int crc16_add(int, int /*<<< orphan*/ const);
uint16_t crc16_signature(uint16_t initial, size_t length,
                         const uint8_t *bytes) {
  size_t i;
  for (i = 0u; i < length; i++) {
    initial = crc16_add(initial, bytes[i]);
  }
  return initial ^ 0x0000u;
}


x86 assembly (clang, -O0):
<crc16_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <crc16_signature+0x50>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <crc16_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <crc16_signature+0x1b>
mov    -0x4(%rbp),%eax
xor    $0x0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16_signature>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%eax
test   %rsi,%rsi
je     1144 <crc16_signature+0x34>
mov    %rdx,%r14
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,4),%esi
mov    %eax,%edi
call   1030 <crc16_add@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <crc16_signature+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @crc16_signature(i32 %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32*, i32** %6
%15 = load i64, i64* %7
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @crc16_add(i32 %13, i32 %17)
store i32 %18, i32* %4
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
%23 = load i32, i32* %4
%24 = xor i32 %23, 0
ret i32 %24
}

LLVM IR (-O2):
define i32 @crc16_signature(i32 %0, i64 %1, i32* nocapture %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %0, %3 ]
%8 = getelementptr inbounds i32, i32* %2, i64 %6
%9 = load i32, i32* %8
%10 = tail call i32 @crc16_add(i32 %7, i32 %9)
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %3
%14 = phi i32 [ %0, %3 ], [ %10, %5 ]
ret i32 %14
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t time_ms() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return (int64_t)now.tv_sec * 1000 + (int64_t)now.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @time_ms() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @time_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %11, %7
ret i32 %12
}
int uwsgi_str3_num(char *str) {
  int num = 0;
  num = 100 * (str[0] - 48);
  num += 10 * (str[1] - 48);
  num += str[2] - 48;
  return num;
}


x86 assembly (clang, -O0):
<uwsgi_str3_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0x64,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_str3_num>:
movsbl (%rdi),%eax
imul   $0x64,%eax,%eax
movsbl 0x1(%rdi),%ecx
lea    (%rcx,%rcx,4),%ecx
movsbl 0x2(%rdi),%edx
lea    (%rax,%rcx,2),%eax
add    %edx,%eax
add    $0xffffeb30,%eax
ret

LLVM IR (-O0):
define i32 @uwsgi_str3_num(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
%9 = mul nsw i32 100, %8
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = mul nsw i32 10, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
%23 = load i32, i32* %3
%24 = add nsw i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @uwsgi_str3_num(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 100
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = mul nsw i32 %7, 10
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %4, -5328
%13 = add nsw i32 %12, %8
%14 = add nsw i32 %13, %11
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void rdtscp() {
  db(0x0F);
  db(0x01);
  db(0xF9);
}


x86 assembly (clang, -O0):
<rdtscp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x1,%edi
call   1030 <db@plt>
mov    $0xf9,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscp>:
push   %rax
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x1,%edi
call   1030 <db@plt>
mov    $0xf9,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @rdtscp() {
%1 = call i32 @db(i32 15)
%2 = call i32 @db(i32 1)
%3 = call i32 @db(i32 249)
ret void
}

LLVM IR (-O2):
define void @rdtscp() {
%1 = tail call i32 @db(i32 15)
%2 = tail call i32 @db(i32 1)
%3 = tail call i32 @db(i32 249)
ret void
}
void Ctypes_hook_rd_sgn_u16(void) {}


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

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

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

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