xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned short htons(unsigned short);
int /*<<< orphan*/ printf(char *);
int send(int, unsigned char *, int, int /*<<< orphan*/);
int send_word(int sockfd, unsigned short data) {
  unsigned short temp = htons(data);
  if (send(sockfd, (unsigned char *)&temp, 2, 0) == -1) {
    printf("Error sending to client\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%edi
call   1030 <htons@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    1183 <send_word+0x53>
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <send_word+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_word>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <htons@plt>
mov    %ax,0x6(%rsp)
lea    0x6(%rsp),%rsi
xor    %ebx,%ebx
mov    %ebp,%edi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0xffffffff,%eax
jne    116c <send_word+0x3c>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Error sending to client\0A\00"
define i32 @send_word(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %4
store i16 %1, i16* %5
%7 = load i16, i16* %5
%8 = call zeroext i16 @htons(i16 zeroext %7)
store i16 %8, i16* %6
%9 = load i32, i32* %4
%10 = bitcast i16* %6 to i8*
%11 = call i32 @send(i32 %9, i8* %10, i32 2, i32 0)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [24 x i8] c"Error sending to client\00"
define i32 @send_word(i32 %0, i16 zeroext %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
%5 = tail call zeroext i16 @htons(i16 zeroext %1)
store i16 %5, i16* %3
%6 = call i32 @send(i32 %0, i8* %4, i32 2, i32 0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ -1, %8 ], [ 0, %2 ]
ret i32 %11
}
int div_cmp_2(float x, float y) { return x / 3 <= 1; }


x86 assembly (clang, -O0):
<div_cmp_2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xee9(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xed9(%rip),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_cmp_2>:
divss  0xef8(%rip),%xmm0
movss  0xef4(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @div_cmp_2(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 = fdiv float %5, 3.000000e+00
%7 = fcmp ole float %6, 1.000000e+00
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @div_cmp_2(float %0, float %1) {
%3 = fdiv float %0, 3.000000e+00
%4 = fcmp ole float %3, 1.000000e+00
%5 = zext i1 %4 to i32
ret i32 %5
}
void function_empty_notes() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_notes() {
ret void
}
int test_imm_FEint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xFE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FEint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 254
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_FEint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1090921693184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ cos(double);
float cosf(float x) { return ((float)cos((double)x)); }


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

x86 assembly (clang, -O2):
<cosf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @cos(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @cos(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int round(double x) { return (int)(x + .5); }


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

x86 assembly (clang, -O2):
<round>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mostraNum(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int num;
  printf("Entre com um numero: ");
  scanf(" %d", &num);
  mostraNum(num);
  printf("Numero digitado foi alterado: %d", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <mostraNum@plt>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <mostraNum@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Entre com um numero: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [33 x i8] c"Numero digitado foi alterado: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @mostraNum(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Entre com um numero: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [33 x i8] c"Numero digitado foi alterado: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @mostraNum(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(int);
int tolower(int c) {
  if (islower(c)) {
    return c;
  }
  return c + ('a' - 'A');
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1138 <tolower+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmovne %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ delay_us(int /*<<< orphan*/);
void atca_delay_us(uint32_t delay) { delay_us(delay); }


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

x86 assembly (clang, -O2):
<atca_delay_us>:
jmp    1030 <delay_us@plt>

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

LLVM IR (-O2):
define void @atca_delay_us(i32 %0) {
%2 = tail call i32 @delay_us(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nomain(int /*<<< orphan*/, int /*<<< orphan*/);
int kernel_main() {
  nomain(0, 0);
  return (0);
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <nomain@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <nomain@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @kernel_main() {
%1 = call i32 @nomain(i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @kernel_main() {
%1 = tail call i32 @nomain(i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int echoCommand(char **args) {
  *args++;
  while (*args) {
    printf("%s ", *args);
    *args++;
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<echoCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     115c <echoCommand+0x4c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <echoCommand+0x18>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoCommand>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rdi),%rsi
test   %rsi,%rsi
je     1156 <echoCommand+0x36>
mov    %rdi,%rbx
add    $0x10,%rbx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <echoCommand+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @echoCommand(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %10, %5 ], [ %3, %1 ]
%7 = phi i8** [ %9, %5 ], [ %2, %1 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t load32(const void *in) {
  uint32_t v;
  memcpy(&v, in, sizeof v);
  return v;
}


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

x86 assembly (clang, -O2):
<load32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
int do_912() { return 912; }


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

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

LLVM IR (-O0):
define i32 @do_912() {
ret i32 912
}

LLVM IR (-O2):
define i32 @do_912() {
ret i32 912
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Push(int arr[], int *top, int elem) {
  if (*top == 100 - 1) {
    printf("Overflow.\n");
  }
  arr[++*top] = elem;
  return;
}


x86 assembly (clang, -O0):
<Push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x63,(%rax)
jne    113c <Push+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
add    $0x1,%ecx
mov    %ecx,(%rsi)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Push>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    (%rsi),%eax
cmp    $0x63,%eax
jne    1133 <Push+0x23>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x0(%rbp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x0(%rbp)
cltq
mov    %r14d,0x4(%rbx,%rax,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [10 x i8] c"Overflow.\00"
define void @Push(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 99
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* %1
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %8, %6 ], [ %4, %3 ]
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %2, i32* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, unsigned char *);
void lowered_privilege_function(unsigned char *ptr) {
  char buffer[50];
  seteuid(0);
  strcpy(buffer, ptr);
}


x86 assembly (clang, -O0):
<lowered_privilege_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <seteuid@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowered_privilege_function>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <seteuid@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lowered_privilege_function(i8* %0) {
%2 = alloca i8*
%3 = alloca [50 x i8]
store i8* %0, i8** %2
%4 = call i32 @seteuid(i32 0)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @lowered_privilege_function(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @seteuid(i32 0)
%5 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ env_tests();
int /*<<< orphan*/ list_tests();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sb_tests();
int /*<<< orphan*/ scanner_tests();
int /*<<< orphan*/ vector_tests();
int main(void) {
  list_tests();
  vector_tests();
  scanner_tests();
  env_tests();
  sb_tests();
  printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <list_tests@plt>
mov    $0x0,%al
call   1060 <vector_tests@plt>
mov    $0x0,%al
call   1040 <scanner_tests@plt>
mov    $0x0,%al
call   1030 <env_tests@plt>
mov    $0x0,%al
call   1070 <sb_tests@plt>
lea    0xe67(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <list_tests@plt>
xor    %eax,%eax
call   1060 <vector_tests@plt>
xor    %eax,%eax
call   1050 <scanner_tests@plt>
xor    %eax,%eax
call   1030 <env_tests@plt>
xor    %eax,%eax
call   1070 <sb_tests@plt>
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @list_tests()
%3 = call i32 (...) @vector_tests()
%4 = call i32 (...) @scanner_tests()
%5 = call i32 (...) @env_tests()
%6 = call i32 (...) @sb_tests()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 (...) @list_tests()
%2 = tail call i32 (...) @vector_tests()
%3 = tail call i32 (...) @scanner_tests()
%4 = tail call i32 (...) @env_tests()
%5 = tail call i32 (...) @sb_tests()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ MyThreadYield();
int /*<<< orphan*/ printf(char *);
void t0(void *dummy) {
  printf("t0 start\n");
  MyThreadYield();
  printf("t0 again 1\n");
  MyThreadYield();
  printf("t0 again 2\n");
  printf("t0 bye\n");
  MyThreadExit();
}


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <MyThreadYield@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <MyThreadYield@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <MyThreadExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <MyThreadYield@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <MyThreadYield@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MyThreadExit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"t0 start\0A\00"
@.str.1 = [12 x i8] c"t0 again 1\0A\00"
@.str.2 = [12 x i8] c"t0 again 2\0A\00"
@.str.3 = [8 x i8] c"t0 bye\0A\00"
define void @t0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @MyThreadYield()
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @MyThreadYield()
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (...) @MyThreadExit()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"t0 start\00"
@str.4 = [11 x i8] c"t0 again 1\00"
@str.5 = [11 x i8] c"t0 again 2\00"
@str.6 = [7 x i8] c"t0 bye\00"
define void @t0(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @MyThreadYield()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 (...) @MyThreadYield()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.5, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0))
%8 = tail call i32 (...) @MyThreadExit()
ret void
}
int max(int *a, int len) {
  int x = 0;
  int y = len - 1;
  while (x != y) {
    if (a[x] <= a[y])
      x++;
    else
      y--;
  }
  return x;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     115f <max+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1151 <max+0x51>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115a <max+0x5a>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <max+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
xor    %eax,%eax
add    $0xffffffff,%esi
je     112f <max+0x2f>
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
mov    (%rdi,%rcx,4),%r8d
movslq %esi,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
cmp    (%rdi,%rsi,4),%r8d
setg   %dl
setle  %cl
add    %ecx,%eax
sub    %edx,%esi
cmp    %esi,%eax
jne    1110 <max+0x10>
ret

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

LLVM IR (-O2):
define i32 @max(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %21, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %19, %5 ], [ %3, %2 ]
%7 = phi i32 [ %17, %5 ], [ 0, %2 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %10, %13
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
%17 = add nuw nsw i32 %7, %16
%18 = sext i1 %14 to i32
%19 = add nsw i32 %6, %18
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %5
21: ; preds = %5, %2
%22 = phi i32 [ 0, %2 ], [ %17, %5 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ test_0();
int /*<<< orphan*/ test_1();
int /*<<< orphan*/ test_2();
int /*<<< orphan*/ test_3();
int main(void) {
  test_0();
  test_1();
  test_2();
  test_3();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_0@plt>
xor    %eax,%eax
call   1030 <test_1@plt>
xor    %eax,%eax
call   1040 <test_2@plt>
xor    %eax,%eax
call   1060 <test_3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_0()
%3 = call i32 (...) @test_1()
%4 = call i32 (...) @test_2()
%5 = call i32 (...) @test_3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_0()
%2 = tail call i32 (...) @test_1()
%3 = tail call i32 (...) @test_2()
%4 = tail call i32 (...) @test_3()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_16_be(unsigned char bytes[2]) {
  uint32_t result = 0;
  for (int i = 0; i < 2; i++)
    result = (result << 8) | bytes[i];
  return result;
}


x86 assembly (clang, -O0):
<read_16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1145 <read_16_be+0x45>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_16_be+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_16_be>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @read_16_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strbuf_isempty() {
  printf("NOT IMPLEMENTED:"
         "pa_strbuf_isempty"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_strbuf_isempty\00"
define i32 @pa_strbuf_isempty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *str) {
  char *tmp = xmalloc(strlen(str) + 1);
  strcpy(tmp, str);
  return tmp;
}


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

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
float erfcc(float);
float sqrt(double);
float func(float x) { return 1.0 - erfcc(x / sqrt(2.0)); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
call   1030 <erfcc@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xe9f(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movss  %xmm0,0x4(%rsp)
movsd  0xed1(%rip),%xmm0
call   1040 <sqrt@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <erfcc@plt>
movss  0xeba(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrt(double 2.000000e+00)
%5 = fdiv float %3, %4
%6 = call float @erfcc(float %5)
%7 = fpext float %6 to double
%8 = fsub double 1.000000e+00, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = tail call float @sqrt(double 2.000000e+00)
%3 = fdiv float %0, %2
%4 = tail call float @erfcc(float %3)
%5 = fsub float 1.000000e+00, %4
ret float %5
}
int setbit(int num, int position, int new_number) {
  new_number = num | 1 << position;
  return new_number;
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setbit(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 = shl i32 1, %8
%10 = or i32 %7, %9
store i32 %10, i32* %6
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @setbit(i32 %0, i32 %1, i32 %2) {
%4 = shl nuw i32 1, %1
%5 = or i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fs_univ_emptytrash(int /*<<< orphan*/, int /*<<< orphan*/,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ main_time();
void fs_emptytrash(void) { (void)fs_univ_emptytrash(main_time(), 0, 0, 0); }


x86 assembly (clang, -O0):
<fs_emptytrash>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <main_time@plt>
mov    %eax,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <fs_univ_emptytrash@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_emptytrash>:
push   %rax
xor    %eax,%eax
call   1040 <main_time@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1030 <fs_univ_emptytrash@plt>

LLVM IR (-O0):
define void @fs_emptytrash() {
%1 = call i32 (...) @main_time()
%2 = call i32 @fs_univ_emptytrash(i32 %1, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @fs_emptytrash() {
%1 = tail call i32 (...) @main_time()
%2 = tail call i32 @fs_univ_emptytrash(i32 %1, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swe_close();
void placalc_close_files() { swe_close(); }


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

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

LLVM IR (-O0):
define void @placalc_close_files() {
%1 = call i32 (...) @swe_close()
ret void
}

LLVM IR (-O2):
define void @placalc_close_files() {
%1 = tail call i32 (...) @swe_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_server_request_call() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_server_request_call>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_server_request_call>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_request_call() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_request_call() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ __OPEN_NEEDS_MODE(int);
int /*<<< orphan*/ __fortify_fail(char *);
int __open64(char const *, int);
int __open64_2(const char *file, int oflag) {
  if (__OPEN_NEEDS_MODE(oflag))
    __fortify_fail("invalid open64 call: O_CREAT or O_TMPFILE without mode");
  return __open64(file, oflag);
}


x86 assembly (clang, -O0):
<__open64_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__OPEN_NEEDS_MODE@plt>
cmp    $0x0,%rax
je     115d <__open64_2+0x2d>
lea    0xea8(%rip),%rdi
call   1050 <__fortify_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <__open64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__open64_2>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <__OPEN_NEEDS_MODE@plt>
test   %rax,%rax
je     1151 <__open64_2+0x21>
lea    0xeb4(%rip),%rdi
call   1050 <__fortify_fail@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__open64@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"invalid open64 call: O_CREAT or O_TMPFILE without mode\00"
define i32 @__open64_2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @__OPEN_NEEDS_MODE(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @__fortify_fail(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @__open64(i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [55 x i8] c"invalid open64 call: O_CREAT or O_TMPFILE without mode\00"
define i32 @__open64_2(i8* %0, i32 %1) {
%3 = tail call i64 @__OPEN_NEEDS_MODE(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__fortify_fail(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @__open64(i8* %0, i32 %1)
ret i32 %8
}
/* Variables and functions */
char *dialogNameOnly();
scalar_t__ isTerminalRunning();
scalar_t__ strlen(char *);
scalar_t__ terminalName();
char *dialogName(void) {
  char *lDialogName;
  lDialogName = dialogNameOnly();
  if (strlen(lDialogName) && (isTerminalRunning() || terminalName())) {
    return lDialogName;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<dialogName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <dialogNameOnly@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     1195 <dialogName+0x55>
mov    $0x0,%al
call   1030 <isTerminalRunning@plt>
cmp    $0x0,%rax
jne    1188 <dialogName+0x48>
mov    $0x0,%al
call   1060 <terminalName@plt>
cmp    $0x0,%rax
je     1195 <dialogName+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119d <dialogName+0x5d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dialogName>:
push   %rbx
xor    %eax,%eax
call   1040 <dialogNameOnly@plt>
cmpb   $0x0,(%rax)
je     1158 <dialogName+0x28>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <isTerminalRunning@plt>
test   %rax,%rax
jne    115a <dialogName+0x2a>
xor    %eax,%eax
call   1050 <terminalName@plt>
test   %rax,%rax
jne    115a <dialogName+0x2a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @dialogName() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @dialogNameOnly()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = call i64 (...) @isTerminalRunning()
%9 = icmp ne i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i64 (...) @terminalName()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10, %7
%14 = load i8*, i8** %2
store i8* %14, i8** %1
br label %16
15: ; preds = %10, %0
store i8* null, i8** %1
br label %16
16: ; preds = %15, %13
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
define i8* @dialogName() {
%1 = tail call i8* (...) @dialogNameOnly()
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = tail call i64 (...) @isTerminalRunning()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 (...) @terminalName()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %0
br label %11
11: ; preds = %4, %7, %10
%12 = phi i8* [ null, %10 ], [ %1, %7 ], [ %1, %4 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ dbg_break();
void reboot(void) { dbg_break(); }


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

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

LLVM IR (-O0):
define void @reboot() {
%1 = call i32 (...) @dbg_break()
ret void
}

LLVM IR (-O2):
define void @reboot() {
%1 = tail call i32 (...) @dbg_break()
ret void
}
/* Type definitions */
struct value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ make_pair(struct value *, struct value *);
struct value *new_pair(int /*<<< orphan*/);
struct value *pop();
int /*<<< orphan*/ push(struct value *);
void builtin_cons() {
  struct value *x, *y;
  x = pop();
  y = pop();
  struct value *v = new_pair(make_pair(y, x));
  push(v);
}


x86 assembly (clang, -O0):
<builtin_cons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <pop@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <make_pair@plt>
mov    %eax,%edi
call   1050 <new_pair@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_cons>:
push   %rbx
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <make_pair@plt>
mov    %eax,%edi
call   1050 <new_pair@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1060 <push@plt>

LLVM IR (-O0):
%struct.value = type { i32 }
define void @builtin_cons() {
%1 = alloca %struct.value*
%2 = alloca %struct.value*
%3 = alloca %struct.value*
%4 = call %struct.value* (...) @pop()
store %struct.value* %4, %struct.value** %1
%5 = call %struct.value* (...) @pop()
store %struct.value* %5, %struct.value** %2
%6 = load %struct.value*, %struct.value** %2
%7 = load %struct.value*, %struct.value** %1
%8 = call i32 @make_pair(%struct.value* %6, %struct.value* %7)
%9 = call %struct.value* @new_pair(i32 %8)
store %struct.value* %9, %struct.value** %3
%10 = load %struct.value*, %struct.value** %3
%11 = call i32 @push(%struct.value* %10)
ret void
}

LLVM IR (-O2):
%struct.value = type { i32 }
define void @builtin_cons() {
%1 = tail call %struct.value* (...) @pop()
%2 = tail call %struct.value* (...) @pop()
%3 = tail call i32 @make_pair(%struct.value* %2, %struct.value* %1)
%4 = tail call %struct.value* @new_pair(i32 %3)
%5 = tail call i32 @push(%struct.value* %4)
ret void
}
int strcoll(const char *s, const char *s2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int /*<<< orphan*/);
void color_reset() {
  char command[13];
  sprintf(command, "%c[%dm", 0x1B, 0);
  printf("%s", command);
}


x86 assembly (clang, -O0):
<color_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xd(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x1b,%edx
xor    %ecx,%ecx
call   1040 <sprintf@plt>
lea    -0xd(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_reset>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1b,%edx
xor    %ecx,%ecx
call   1040 <sprintf@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @color_reset() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 0)
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @color_reset() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int);
int lsi_b_strerror(int errnum, char *buf, size_t sz) {
  int r = 0;
  snprintf(buf, sz, "Errno %d", errnum);
  return r;
}


x86 assembly (clang, -O0):
<lsi_b_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%ecx
lea    0xec4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsi_b_strerror>:
push   %rax
mov    %edi,%ecx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Errno %d\00"
define i32 @lsi_b_strerror(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* %4
%11 = call i32 @snprintf(i8* %8, i64 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"Errno %d\00"
define i32 @lsi_b_strerror(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}