xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ renameat(int /*<<< orphan*/, char *, int /*<<< orphan*/, char *);
int main(void) {
  if (0 > renameat(AT_FDCWD, "see.emily.play/gnome", AT_FDCWD, "lucifer.sam"))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rsi
lea    0xed6(%rip),%rcx
call   1030 <renameat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1163 <main+0x53>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <main+0x5f>
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
lea    0xeed(%rip),%rcx
mov    %edi,%edx
call   1030 <renameat@plt>
test   %rax,%rax
jns    113d <main+0x2d>
mov    0x2ea5(%rip),%rax
jmp    1144 <main+0x34>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [21 x i8] c"see.emily.play/gnome\00"
@.str.1 = [12 x i8] c"lucifer.sam\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_FDCWD
%3 = load i32, i32* @AT_FDCWD
%4 = call i64 @renameat(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp sgt i64 0, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
store i32 %7, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* @EXIT_SUCCESS
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [21 x i8] c"see.emily.play/gnome\00"
@.str.1 = [12 x i8] c"lucifer.sam\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = tail call i64 @renameat(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
%4 = load i32, i32* @EXIT_FAILURE
%5 = load i32, i32* @EXIT_SUCCESS
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ contents;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *realloc(void *, int);
void *salloc(void *a, int b) {
  void *contents = malloc(sizeof(a));
  memcpy(a, contents, sizeof(contents));
  return realloc(a, b);
}


x86 assembly (clang, -O0):
<salloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<salloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <realloc@plt>

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

LLVM IR (-O2):
define i8* @salloc(i8* %0, i32 %1) {
%3 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%4 = tail call i32 @memcpy(i8* %0, i8* %3, i32 8)
%5 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int strtol(char *, char **, int);
int32_t get_hival(char *pc, char **ppc) {
  int32_t base;
  while (*pc == ' ')
    pc++;
  if (*pc == '$') {
    pc++;
    base = 16;
  } else
    base = 10;
  return strtol(pc, ppc, base);
}


x86 assembly (clang, -O0):
<get_hival>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1141 <get_hival+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <get_hival+0x10>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
jne    1169 <get_hival+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movl   $0x10,-0x14(%rbp)
jmp    1170 <get_hival+0x60>
movl   $0xa,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hival>:
movzbl (%rdi),%eax
cmp    $0x20,%al
jne    111d <get_hival+0xd>
add    $0x1,%rdi
jmp    1110 <get_hival>
cmp    $0x24,%al
jne    112f <get_hival+0x1f>
add    $0x1,%rdi
mov    $0x10,%edx
jmp    1030 <strtol@plt>
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @get_hival(i8* %0, i8** nocapture %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %0, %2 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %10 [
i8 32, label %6
i8 36, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
br label %10
10: ; preds = %3, %8
%11 = phi i8* [ %9, %8 ], [ %4, %3 ]
%12 = phi i32 [ 16, %8 ], [ 10, %3 ]
%13 = tail call i32 @strtol(i8* %11, i8** %1, i32 %12)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
__attribute__((noreturn)) void failed(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<failed>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @failed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @failed(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
scalar_t__ ctime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *dateTime() {
  time_t t;
  char *s;
  time(&t);
  s = (char *)ctime((const time_t *)&t);
  s[24] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<dateTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x18(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dateTime>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
movb   $0x0,0x18(%rax)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @dateTime() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @time(i32* %1)
%4 = call i64 @ctime(i32* %1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 24
store i8 0, i8* %7
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @dateTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i64 @ctime(i32* %1)
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 24
store i8 0, i8* %6
ret i8* %5
}
/* Variables and functions */
float fmaxf(float, float);
float fmax32(float x, float y) { return fmaxf(x, y); }


x86 assembly (clang, -O0):
<fmax32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax32>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fmax32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.maxnum.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fmax32(float %0, float %1) {
%3 = tail call float @llvm.maxnum.f32(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int ui32Gen;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenFaultClear(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Group,
                      uint32_t ui32FaultTriggers) {
  ;
  ;

  ;

  ;

  ;
  if (ui32Group == 0) {
    (*((volatile uint32_t *)(((ui32Base) + 0x00000800 +
                              ((ui32Gen)-0x00000040) * 2) +
                             0x00000004))) = ui32FaultTriggers;
  } else {
    (*((volatile uint32_t *)(((ui32Base) + 0x00000800 +
                              ((ui32Gen)-0x00000040) * 2) +
                             0x00000008))) = ui32FaultTriggers;
  }
}


x86 assembly (clang, -O0):
<PWMGenFaultClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1145 <PWMGenFaultClear+0x45>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x4(%rax)
jmp    1166 <PWMGenFaultClear+0x66>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultClear>:
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
lea    (%rdi,%rax,4),%rax
mov    %rcx,0x784(%rax,%rsi,2)
ret

LLVM IR (-O0):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i64, i64* %8
%13 = load i64, i64* %5
%14 = add nsw i64 %13, 2048
%15 = load i64, i64* %6
%16 = sub nsw i64 %15, 64
%17 = mul nsw i64 %16, 2
%18 = add nsw i64 %14, %17
%19 = add nsw i64 %18, 4
%20 = inttoptr i64 %19 to i64*
store volatile i64 %12, i64* %20
br label %31
21: ; preds = %4
%22 = load i64, i64* %8
%23 = load i64, i64* %5
%24 = add nsw i64 %23, 2048
%25 = load i64, i64* %6
%26 = sub nsw i64 %25, 64
%27 = mul nsw i64 %26, 2
%28 = add nsw i64 %24, %27
%29 = add nsw i64 %28, 8
%30 = inttoptr i64 %29 to i64*
store volatile i64 %22, i64* %30
br label %31
31: ; preds = %21, %11
ret void
}

LLVM IR (-O2):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
%6 = shl i64 %1, 1
%7 = select i1 %5, i64 1924, i64 1928
%8 = add i64 %7, %0
%9 = add i64 %8, %6
%10 = inttoptr i64 %9 to i64*
store volatile i64 %3, i64* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
clock_t tp_utils_sectoclock(double seconds) {
  double count = seconds * CLOCKS_PER_SEC;
  if (count <= 0) {
    return 0;
  }
  return (clock_t)count;
}


x86 assembly (clang, -O0):
<tp_utils_sectoclock>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1138 <tp_utils_sectoclock+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1140 <tp_utils_sectoclock+0x40>
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_utils_sectoclock>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andnpd %xmm0,%xmm2
cvttsd2si %xmm2,%eax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @tp_utils_sectoclock(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* @CLOCKS_PER_SEC
%7 = fmul double %5, %6
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp ole double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %14
11: ; preds = %1
%12 = load double, double* %4
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @tp_utils_sectoclock(double %0) {
%2 = load double, double* @CLOCKS_PER_SEC
%3 = fmul double %2, %0
%4 = fcmp ole double %3, 0.000000e+00
%5 = select i1 %4, double 0.000000e+00, double %3
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
double sys_timer_CLOCK() {
  clock_t tmp;
  tmp = clock();
  return (double)tmp / (1000000);
}


x86 assembly (clang, -O0):
<sys_timer_CLOCK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_timer_CLOCK>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sys_timer_CLOCK() {
%1 = alloca i64
%2 = call i64 (...) @clock()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 1.000000e+06
ret double %5
}

LLVM IR (-O2):
define double @sys_timer_CLOCK() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+06
ret double %3
}
void swap(int a[], int left, int right) {
  int temp;
  temp = a[left];
  a[left] = a[right];
  a[right] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int divide(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", divide(-2147483648, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80000000,%edi
mov    $0x5,%esi
call   1030 <divide@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000000,%edi
mov    $0x5,%esi
call   1030 <divide@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @divide(i32 -2147483648, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STD_opts_help();
void print_help(void (*user_help)(void)) {
  STD_opts_help();
  if (user_help)
    user_help();
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <STD_opts_help@plt>
cmpq   $0x0,-0x8(%rbp)
je     1131 <print_help+0x21>
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <STD_opts_help@plt>
test   %rbx,%rbx
je     1126 <print_help+0x16>
mov    %rbx,%rax
pop    %rbx
jmp    *%rax
pop    %rbx
ret

LLVM IR (-O0):
define void @print_help(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = call i32 (...) @STD_opts_help()
%4 = load void ()*, void ()** %2
%5 = icmp ne void ()* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load void ()*, void ()** %2
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @print_help(void ()* %0) {
%2 = tail call i32 (...) @STD_opts_help()
%3 = icmp eq void ()* %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void %0()
br label %5
5: ; preds = %4, %1
ret void
}
const char *dns_version(void) { return "0.4"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"0.4\00"
define i8* @dns_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int to_unicode(short const *, int);
unsigned short int rtf_to_unicode(int code, const short int *current_charset) {
  int cc = code;
  if (code < 0 || (cc = to_unicode(current_charset, code)) < 0)
    return 0xFEFF;
  return cc;
}


x86 assembly (clang, -O0):
<rtf_to_unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1147 <rtf_to_unicode+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <to_unicode@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1152 <rtf_to_unicode+0x42>
movw   $0xfeff,-0x2(%rbp)
jmp    1159 <rtf_to_unicode+0x49>
mov    -0x14(%rbp),%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtf_to_unicode>:
test   %edi,%edi
js     1132 <rtf_to_unicode+0x22>
push   %rax
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <to_unicode@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xfeff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
ret
mov    $0xfeff,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @rtf_to_unicode(i32 %0, i16* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @to_unicode(i16* %1, i32 %0)
%6 = icmp slt i32 %5, 0
%7 = trunc i32 %5 to i16
%8 = select i1 %6, i16 -257, i16 %7
br label %9
9: ; preds = %4, %2
%10 = phi i16 [ -257, %2 ], [ %8, %4 ]
ret i16 %10
}
int mod(int a, int b) {
  int ret = a % b;
  if (ret < 0)
    ret += b;
  return ret;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1127 <mod+0x27>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void and_reg32_imm8(int reg32, unsigned char imm8) {
  put8(0x83);
  put8(0xE0 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<and_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x83,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x83,%edi
call   1030 <put8@plt>
add    $0xe0,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @and_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -125)
%6 = load i32, i32* %3
%7 = add nsw i32 224, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @and_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -125)
%4 = trunc i32 %0 to i8
%5 = add i8 %4, -32
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ omp_get_cancellation();
int main() {
#pragma omp parallel num_threads(32)
  {
#pragma omp cancel parallel
    if (omp_get_cancellation())
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <omp_get_cancellation@plt>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <omp_get_cancellation@plt>
test   %rax,%rax
jne    1131 <main+0x11>
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 i64 (...) @omp_get_cancellation()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @omp_get_cancellation()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_castsi256_si128(int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm256_extractf128_si256(int /*<<< orphan*/ const, int);
int /*<<< orphan*/ _mm_storel_epi64(int /*<<< orphan*/ *const,
                                    int /*<<< orphan*/);
void mm256_storeu2_epi64(__m128i *const dst_ptr_1, __m128i *const dst_ptr_2,
                         const __m256i *const src) {
  _mm_storel_epi64(dst_ptr_1, _mm256_castsi256_si128(*src));
  _mm_storel_epi64(dst_ptr_2, _mm256_extractf128_si256(*src, 1));
}


x86 assembly (clang, -O0):
<mm256_storeu2_epi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1050 <_mm256_castsi256_si128@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <_mm_storel_epi64@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <_mm256_extractf128_si256@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <_mm_storel_epi64@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm256_storeu2_epi64>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdx),%edi
call   1050 <_mm256_castsi256_si128@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <_mm_storel_epi64@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1030 <_mm256_extractf128_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <_mm_storel_epi64@plt>

LLVM IR (-O0):
define void @mm256_storeu2_epi64(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** %6
%9 = load i32, i32* %8
%10 = call i32 @_mm256_castsi256_si128(i32 %9)
%11 = call i32 @_mm_storel_epi64(i32* %7, i32 %10)
%12 = load i32*, i32** %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = call i32 @_mm256_extractf128_si256(i32 %14, i32 1)
%16 = call i32 @_mm_storel_epi64(i32* %12, i32 %15)
ret void
}

LLVM IR (-O2):
define void @mm256_storeu2_epi64(i32* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @_mm256_castsi256_si128(i32 %4)
%6 = tail call i32 @_mm_storel_epi64(i32* %0, i32 %5)
%7 = load i32, i32* %2
%8 = tail call i32 @_mm256_extractf128_si256(i32 %7, i32 1)
%9 = tail call i32 @_mm_storel_epi64(i32* %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Beep(int, int);
int /*<<< orphan*/ vTaskDelay(int);
void GPS_LockStart(void) {
  Beep(20000, 128);
  vTaskDelay(100);
  Beep(20000, 0);
  vTaskDelay(50);
  Beep(18000, 128);
  vTaskDelay(100);
  Beep(18000, 0);
}


x86 assembly (clang, -O0):
<GPS_LockStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e20,%edi
mov    $0x80,%esi
call   1030 <Beep@plt>
mov    $0x64,%edi
call   1040 <vTaskDelay@plt>
mov    $0x4e20,%edi
xor    %esi,%esi
call   1030 <Beep@plt>
mov    $0x32,%edi
call   1040 <vTaskDelay@plt>
mov    $0x4650,%edi
mov    $0x80,%esi
call   1030 <Beep@plt>
mov    $0x64,%edi
call   1040 <vTaskDelay@plt>
mov    $0x4650,%edi
xor    %esi,%esi
call   1030 <Beep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_LockStart>:
push   %rax
mov    $0x4e20,%edi
mov    $0x80,%esi
call   1030 <Beep@plt>
mov    $0x64,%edi
call   1040 <vTaskDelay@plt>
mov    $0x4e20,%edi
xor    %esi,%esi
call   1030 <Beep@plt>
mov    $0x32,%edi
call   1040 <vTaskDelay@plt>
mov    $0x4650,%edi
mov    $0x80,%esi
call   1030 <Beep@plt>
mov    $0x64,%edi
call   1040 <vTaskDelay@plt>
mov    $0x4650,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <Beep@plt>

LLVM IR (-O0):
define void @GPS_LockStart() {
%1 = call i32 @Beep(i32 20000, i32 128)
%2 = call i32 @vTaskDelay(i32 100)
%3 = call i32 @Beep(i32 20000, i32 0)
%4 = call i32 @vTaskDelay(i32 50)
%5 = call i32 @Beep(i32 18000, i32 128)
%6 = call i32 @vTaskDelay(i32 100)
%7 = call i32 @Beep(i32 18000, i32 0)
ret void
}

LLVM IR (-O2):
define void @GPS_LockStart() {
%1 = tail call i32 @Beep(i32 20000, i32 128)
%2 = tail call i32 @vTaskDelay(i32 100)
%3 = tail call i32 @Beep(i32 20000, i32 0)
%4 = tail call i32 @vTaskDelay(i32 50)
%5 = tail call i32 @Beep(i32 18000, i32 128)
%6 = tail call i32 @vTaskDelay(i32 100)
%7 = tail call i32 @Beep(i32 18000, i32 0)
ret void
}
int sum_mmx(void) {
  int ret;
  asm volatile("movq %%mm6, %%mm0		\n\t"
               "psrlq $32, %%mm6		\n\t"
               "paddw %%mm0, %%mm6		\n\t"
               "movq %%mm6, %%mm0		\n\t"
               "psrlq $16, %%mm6		\n\t"
               "paddw %%mm0, %%mm6		\n\t"
               "movd %%mm6, %0			\n\t"
               : "=r"(ret));
  return ret & 0xFFFF;
}


x86 assembly (clang, -O0):
<sum_mmx>:
push   %rbp
mov    %rsp,%rbp
movq   %mm6,%mm0
psrlq  $0x20,%mm6
paddw  %mm0,%mm6
movq   %mm6,%mm0
psrlq  $0x10,%mm6
paddw  %mm0,%mm6
movd   %mm6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_mmx>:
movq   %mm6,%mm0
psrlq  $0x20,%mm6
paddw  %mm0,%mm6
movq   %mm6,%mm0
psrlq  $0x10,%mm6
paddw  %mm0,%mm6
movd   %mm6,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @sum_mmx() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movq %mm6, %mm0\09\09\0A\09psrlq $$32, %mm6\09\09\0A\09paddw %mm0, %mm6\09\09\0A\09movq %mm6, %mm0\09\09\0A\09psrlq $$16, %mm6\09\09\0A\09paddw %mm0, %mm6\09\09\0A\09movd %mm6, $0\09\09\09\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 65535
ret i32 %4
}

LLVM IR (-O2):
define i32 @sum_mmx() {
%1 = tail call i32 asm sideeffect "movq %mm6, %mm0\09\09\0A\09psrlq $$32, %mm6\09\09\0A\09paddw %mm0, %mm6\09\09\0A\09movq %mm6, %mm0\09\09\0A\09psrlq $$16, %mm6\09\09\0A\09paddw %mm0, %mm6\09\09\0A\09movd %mm6, $0\09\09\09\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = and i32 %1, 65535
ret i32 %2
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
size_t getMaxSize() {
  struct rlimit limit;
  getrlimit(RLIMIT_STACK, &limit);
  return (size_t)limit.rlim_max;
}


x86 assembly (clang, -O0):
<getMaxSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxSize>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
movslq (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i64 @getMaxSize() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_STACK
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i64 @getMaxSize() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_STACK
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
ret i64 %7
}
void genslt() {}


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

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

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

LLVM IR (-O2):
define void @genslt() {
ret void
}
/* Variables and functions */
int Pidentifier();
PformalNameRef() {
  int b = -1;
  ;
  b = Pidentifier();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PformalNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @Pidentifier()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PformalNameRef() {
%1 = tail call i32 (...) @Pidentifier()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
void tempob() { delay_ms(300); }


x86 assembly (clang, -O0):
<tempob>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempob>:
mov    $0x12c,%edi
jmp    1030 <delay_ms@plt>

LLVM IR (-O0):
define void @tempob() {
%1 = call i32 @delay_ms(i32 300)
ret void
}

LLVM IR (-O2):
define void @tempob() {
%1 = tail call i32 @delay_ms(i32 300)
ret void
}
void f() {
  while (1)
    if (2)
      3;
    else
      4;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getdtablesize(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getdtablesize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getdtablesize>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__getdtablesize() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__getdtablesize() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int doubleToRawLongBits(double);
double longBitsToDouble(int);
double fabsk(double x) {
  return longBitsToDouble(0x7fffffffffffffffLL & doubleToRawLongBits(x));
}


x86 assembly (clang, -O0):
<fabsk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
cltq
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %eax,%edi
call   1030 <longBitsToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fabsk(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @doubleToRawLongBits(double %3)
%5 = sext i32 %4 to i64
%6 = and i64 9223372036854775807, %5
%7 = trunc i64 %6 to i32
%8 = call double @longBitsToDouble(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @fabsk(double %0) {
%2 = tail call i32 @doubleToRawLongBits(double %0)
%3 = tail call double @longBitsToDouble(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printBase62(unsigned long long);
unsigned long long strtoull(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  unsigned long long n = strtoull(argv[1], NULL, 0);
  printBase62(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoull@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <printBase62@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoull@plt>
mov    %rax,%rdi
call   1030 <printBase62@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @strtoull(i8* %8, i32* null, i32 0)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i32 @printBase62(i64 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtoull(i8* nocapture %4, i32* null, i32 0)
%6 = tail call i32 @printBase62(i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114b <keyboard+0x2b>
jmp    1144 <keyboard+0x24>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     112d <keyboard+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
%12 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void jit_exit() { exit(-1); }


x86 assembly (clang, -O0):
<jit_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<jit_exit>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @jit_exit() {
%1 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @jit_exit() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
void zfree(void *x, void *addr, unsigned nb) {}


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

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

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

LLVM IR (-O2):
define void @zfree(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
unsigned int sdbm(unsigned char *str) {
  unsigned int hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     114b <sdbm+0x4b>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sdbm+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <sdbm+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sdbm(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 65599
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_add(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4i *
psvec4i_add(struct vec4i *result, struct vec4i *a, struct vec4i *b) {
  vec4i_add((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4i_add>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_add@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_add(%struct.vec4i* %0, %struct.vec4i* %1, %struct.vec4i* %2) {
%4 = alloca %struct.vec4i*
%5 = alloca %struct.vec4i*
%6 = alloca %struct.vec4i*
store %struct.vec4i* %0, %struct.vec4i** %4
store %struct.vec4i* %1, %struct.vec4i** %5
store %struct.vec4i* %2, %struct.vec4i** %6
%7 = load %struct.vec4i*, %struct.vec4i** %4
%8 = bitcast %struct.vec4i* %7 to i32*
%9 = load %struct.vec4i*, %struct.vec4i** %5
%10 = bitcast %struct.vec4i* %9 to i32*
%11 = load %struct.vec4i*, %struct.vec4i** %6
%12 = bitcast %struct.vec4i* %11 to i32*
%13 = call i32 @vec4i_add(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec4i*, %struct.vec4i** %4
ret %struct.vec4i* %14
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_add(%struct.vec4i* returned %0, %struct.vec4i* %1, %struct.vec4i* %2) {
%4 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec4i, %struct.vec4i* %2, i64 0, i32 0
%7 = tail call i32 @vec4i_add(i32* %4, i32* %5, i32* %6)
ret %struct.vec4i* %0
}
/* Variables and functions */
float sqrt(int);
float etr_area_perimeter(float perimeter) {
  float square_root_3 = sqrt(3);
  float area = (perimeter / 3) * (perimeter / 3) * square_root_3 / 4;
  return area;
}


x86 assembly (clang, -O0):
<etr_area_perimeter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xecb(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xeba(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xea1(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etr_area_perimeter>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm1
divss  0xed1(%rip),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm1,%xmm0
mulss  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @etr_area_perimeter(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float @sqrt(i32 3)
store float %5, float* %3
%6 = load float, float* %2
%7 = fdiv float %6, 3.000000e+00
%8 = load float, float* %2
%9 = fdiv float %8, 3.000000e+00
%10 = fmul float %7, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = fdiv float %12, 4.000000e+00
store float %13, float* %4
%14 = load float, float* %4
ret float %14
}

LLVM IR (-O2):
define float @etr_area_perimeter(float %0) {
%2 = tail call float @sqrt(i32 3)
%3 = fdiv float %0, 3.000000e+00
%4 = fmul float %3, %3
%5 = fmul float %4, %2
%6 = fmul float %5, 2.500000e-01
ret float %6
}
void stack_list_destroy(struct Stack *s) {}


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

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

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

LLVM IR (-O2):
%struct.Stack = type opaque
define void @stack_list_destroy(%struct.Stack* nocapture %0) {
ret void
}