xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_lowerhex64(uint64_t value) {
  if (fprintf(stdout, "%016llx\n", value) < 0) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<print_lowerhex64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    115b <print_lowerhex64+0x3b>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lowerhex64>:
push   %rax
mov    %edi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     113f <print_lowerhex64+0x1f>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"%016llx\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_lowerhex64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"%016llx\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_lowerhex64(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
char *strchr(char *, char);
void copyc(char *cmdline, int bin) {
  char *i;
  if ((i = strchr(cmdline, ' ')) == NULL) {
    printf("too few arguments: %s\n", cmdline);
    return;
  }
  *i = '\0';
  copy(cmdline, i + 1, bin);
}


x86 assembly (clang, -O0):
<copyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1170 <copyc+0x40>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
jmp    118b <copyc+0x5b>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0xc(%rbp),%edx
call   1050 <copy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1161 <copyc+0x31>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <copy@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"too few arguments: %s\0A\00"
define void @copyc(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
7: ; preds = %2
store i8 0, i8* %3
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @copy(i8* %0, i8* %8, i32 %1)
br label %10
10: ; preds = %7, %5
ret void
}
void b43legacy_rfkill_free(struct b43legacy_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43legacy_wldev = type opaque
define void @b43legacy_rfkill_free(%struct.b43legacy_wldev* nocapture %0) {
ret void
}
unsigned char toalt(c)
unsigned char c;
{ return c; }


x86 assembly (clang, -O0):
<toalt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @toalt(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int _printf_putll(unsigned long long, int, int, int, unsigned int, char *);
int putlfnum(unsigned long long x, int base, int isSigned, int width,
             unsigned int fillChar) {
  return _printf_putll(x, base, isSigned, width, fillChar, ((char *)0x3000000));
}


x86 assembly (clang, -O0):
<putlfnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x3000000,%r9d
call   1030 <_printf_putll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putlfnum>:
mov    $0x3000000,%r9d
jmp    1030 <_printf_putll@plt>

LLVM IR (-O0):
define i32 @putlfnum(i64 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i64 %0, i64* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i64, i64* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @_printf_putll(i64 %11, i32 %12, i32 %13, i32 %14, i32 %15, i8* inttoptr (i64 50331648 to i8*))
ret i32 %16
}

LLVM IR (-O2):
define i32 @putlfnum(i64 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @_printf_putll(i64 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* inttoptr (i64 50331648 to i8*))
ret i32 %6
}
/* Variables and functions */
int HexToInt(unsigned short);
int wc_hextodec(unsigned short ch) { return ch < 127 ? HexToInt(ch) : 0; }


x86 assembly (clang, -O0):
<wc_hextodec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jge    113d <wc_hextodec+0x2d>
movzwl -0x2(%rbp),%edi
call   1030 <HexToInt@plt>
mov    %eax,-0x8(%rbp)
jmp    1147 <wc_hextodec+0x37>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <wc_hextodec+0x37>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wc_hextodec>:
cmp    $0x7e,%di
ja     111e <wc_hextodec+0xe>
movzwl %di,%edi
jmp    1030 <HexToInt@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @wc_hextodec(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp slt i32 %4, 127
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i16, i16* %2
%8 = call i32 @HexToInt(i16 zeroext %7)
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i32 [ %8, %6 ], [ 0, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @wc_hextodec(i16 zeroext %0) {
%2 = icmp ult i16 %0, 127
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @HexToInt(i16 zeroext %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int interval_mul(x1, x2, y1, y2, low, high)
double x1, x2, y1, y2, *low, *high;
{ return (interval_mul4(x1, x2, y1, y2, low, high)); }


x86 assembly (clang, -O0):
<interval_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0x4,%al
call   1030 <interval_mul4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interval_mul>:
mov    $0x4,%al
jmp    1030 <interval_mul4@plt>

LLVM IR (-O0):
define i32 @interval_mul(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double*, double** %11
%18 = load double*, double** %12
%19 = call i32 (double, double, double, double, double*, double*, ...) bitcast (i32 (...)* @interval_mul4 to i32 (double, double, double, double, double*, double*, ...)*)(double %13, double %14, double %15, double %16, double* %17, double* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @interval_mul(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = tail call i32 (double, double, double, double, double*, double*, ...) bitcast (i32 (...)* @interval_mul4 to i32 (double, double, double, double, double*, double*, ...)*)(double %0, double %1, double %2, double %3, double* %4, double* %5)
ret i32 %7
}
int wstrlen(char *str) {
  int len = 0;
  while (*str++)
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<wstrlen>:
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)
cmpb   $0x0,(%rax)
je     1135 <wstrlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <wstrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wstrlen>:
cmpb   $0x0,(%rdi)
je     111c <wstrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <wstrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wstrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int test_imm_DDuint32_reg(unsigned int val) {
  return ((val) & (0xDD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DDuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xdd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DDuint32_reg>:
test   $0xdd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DDuint32_reg(i32 %0) {
%2 = and i32 %0, 221
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ff_hevc_put_hevc_uni_epel_h16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h16_10_sse4() {
ret void
}
/* Variables and functions */
float ANTweenTimingFunctionBackIn(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionBackIn(float time, float duration) {
  return ANTweenTimingFunctionBackIn(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionBackIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionBackIn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionBackIn>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionBackIn@plt>

LLVM IR (-O0):
define float @ANTweenProgressTimingFunctionBackIn(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 @ANTweenTimingFunctionBackIn(float %5, i32 0, i32 1, float %6)
ret float %7
}

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionBackIn(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionBackIn(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: set wifi mode to boot\n");
  printf("	2g	: 2.4G \n");
  printf("	5g	: 5G\n");
  printf("	read: read wifi mode from boot\n");
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"usage: set wifi mode to boot\0A\00"
@.str.1 = [13 x i8] c"\092g\09: 2.4G \0A\00"
@.str.2 = [10 x i8] c"\095g\09: 5G\0A\00"
@.str.3 = [33 x i8] c"\09read: read wifi mode from boot\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [29 x i8] c"usage: set wifi mode to boot\00"
@str.5 = [12 x i8] c"\092g\09: 2.4G \00"
@str.6 = [9 x i8] c"\095g\09: 5G\00"
@str.7 = [32 x i8] c"\09read: read wifi mode from boot\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int core4_safe(char const *);
int U_EMRFILLPATH_safe(const char *record) { return (core4_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRFILLPATH_safe>:
jmp    1030 <core4_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRFILLPATH_safe(i8* %0) {
%2 = tail call i32 @core4_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
long double imms_average_winc(long double, long double, long double, int);
long double imms_average(long double avg, long double add, long double count) {
  return imms_average_winc(avg, add, count, 1);
}


x86 assembly (clang, -O0):
<imms_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x1,%edi
call   1030 <imms_average_winc@plt>
fld    %st(0)
fstp   %st(0)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imms_average>:
mov    $0x1,%edi
jmp    1030 <imms_average_winc@plt>

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

LLVM IR (-O2):
define x86_fp80 @imms_average(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call x86_fp80 @imms_average_winc(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, i32 1)
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ *stdin;
scalar_t__ strcmp(char const *, char *);
FILE *fopen_with_dash(const char *path, const char *mode) {
  if (strcmp(path, "-") == 0)
    return stdin;
  return fopen(path, mode);
}


x86 assembly (clang, -O0):
<fopen_with_dash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115d <fopen_with_dash+0x3d>
mov    0x2e97(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <fopen_with_dash+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_with_dash>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114d <fopen_with_dash+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fopen@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
define i32* @fopen_with_dash(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i32*, i32** @stdin
br label %9
7: ; preds = %2
%8 = tail call i32* @fopen(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32* [ %6, %5 ], [ %8, %7 ]
ret i32* %10
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int close(int);
int /*<<< orphan*/ printf(char *);
int *cerrar_1_svc(int fd, struct svc_req *rqstp) {
  static int result;
  if ((result = close(fd)) == -1) {
    printf("Error al cerrar el fichero \n ");
  } else {
    printf("Fichero cerrado \n");
  }
  return &result;
}


x86 assembly (clang, -O0):
<cerrar_1_svc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    %eax,0x2ef7(%rip)
cmp    $0xffffffff,%eax
jne    1157 <cerrar_1_svc+0x37>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <cerrar_1_svc+0x43>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0x2eca(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cerrar_1_svc>:
push   %rax
call   1050 <close@plt>
mov    %eax,0x2f00(%rip)
cmp    $0xffffffff,%eax
je     114f <cerrar_1_svc+0x1f>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
jmp    115b <cerrar_1_svc+0x2b>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0x2eda(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@cerrar_1_svc.result = internal global i32 0
@.str = [30 x i8] c"Error al cerrar el fichero \0A \00"
@.str.1 = [18 x i8] c"Fichero cerrado \0A\00"
define i32* @cerrar_1_svc(i32 %0, %struct.svc_req* %1) {
%3 = alloca i32
%4 = alloca %struct.svc_req*
store i32 %0, i32* %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
store i32 %6, i32* @cerrar_1_svc.result
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32* @cerrar_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@cerrar_1_svc.result = internal global i32 0
@.str = [30 x i8] c"Error al cerrar el fichero \0A \00"
@str = [17 x i8] c"Fichero cerrado \00"
define i32* @cerrar_1_svc(i32 %0, %struct.svc_req* nocapture readnone %1) {
%3 = tail call i32 @close(i32 %0)
store i32 %3, i32* @cerrar_1_svc.result
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32* @cerrar_1_svc.result
}
/* Variables and functions */
unsigned short USHRT_MAX;
int expect_unsigned_short_sum(unsigned short (*f)(unsigned short,
                                                  unsigned short)) {
  return f(USHRT_MAX - 1, 1) == USHRT_MAX;
}


x86 assembly (clang, -O0):
<expect_unsigned_short_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed1(%rip),%rcx
movzwl (%rcx),%ecx
sub    $0x1,%ecx
mov    $0x1,%esi
movzwl %cx,%edi
call   *%rax
movzwl %ax,%eax
mov    0x2eb7(%rip),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_unsigned_short_sum>:
push   %rbx
mov    %rdi,%rax
mov    0x2edd(%rip),%rbx
movzwl (%rbx),%ecx
add    $0xffffffff,%ecx
movzwl %cx,%edi
mov    $0x1,%esi
call   *%rax
xor    %ecx,%ecx
cmp    (%rbx),%ax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@USHRT_MAX = global i16 0
define i32 @expect_unsigned_short_sum(i16 (i16, i16)* %0) {
%2 = alloca i16 (i16, i16)*
store i16 (i16, i16)* %0, i16 (i16, i16)** %2
%3 = load i16 (i16, i16)*, i16 (i16, i16)** %2
%4 = load i16, i16* @USHRT_MAX
%5 = zext i16 %4 to i32
%6 = sub nsw i32 %5, 1
%7 = trunc i32 %6 to i16
%8 = call zeroext i16 %3(i16 zeroext %7, i16 zeroext 1)
%9 = zext i16 %8 to i32
%10 = load i16, i16* @USHRT_MAX
%11 = zext i16 %10 to i32
%12 = icmp eq i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@USHRT_MAX = global i16 0
define i32 @expect_unsigned_short_sum(i16 (i16, i16)* nocapture %0) {
%2 = load i16, i16* @USHRT_MAX
%3 = add i16 %2, -1
%4 = tail call zeroext i16 %0(i16 zeroext %3, i16 zeroext 1)
%5 = load i16, i16* @USHRT_MAX
%6 = icmp eq i16 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int server_read(void *client_data, int idx, char *data, int len) {
  printf("%s\n", data);
  return (0);
}


x86 assembly (clang, -O0):
<server_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_read>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @server_read(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
float Window(float, float, float);
float sin(double);
float Pulse300Hz(float t, float duration) {
  return sin(2.0 * 3.14159265358979324 * 300.0 * t) *
         Window(duration, 0.005f, t);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xe9d(%rip),%xmm1
call   1030 <Window@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xec4(%rip),%xmm0
call   1040 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0xeb9(%rip),%xmm1
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm2
call   1030 <Window@plt>
mulss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @Pulse300Hz(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 = fpext float %5 to double
%7 = fmul double 0x409D73D286BFE4D8, %6
%8 = call float @sin(double %7)
%9 = load float, float* %4
%10 = load float, float* %3
%11 = call float @Window(float %9, float 0x3F747AE140000000, float %10)
%12 = fmul float %8, %11
ret float %12
}

LLVM IR (-O2):
define float @Pulse300Hz(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x409D73D286BFE4D8
%5 = tail call float @sin(double %4)
%6 = tail call float @Window(float %1, float 0x3F747AE140000000, float %0)
%7 = fmul float %5, %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int tabela[] = {1, 2, 4, 6, 12};
  for (int i = 4; i >= 0; i--) {
    printf("%d \n", tabela[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1171 <main+0x61>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1145 <main+0x35>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @foo113(i32 %0) {
ret void
}
void foo_1_1_1_1_1_2_2_2_1() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @exit_ext4_xattr() {
ret void
}
unsigned int f9(unsigned int x, int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f9(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %8, %12
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f9(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct response {
  int dummy;
};

/* Variables and functions */
int resp_header_locate(struct response const *, char const *,
                       int /*<<< orphan*/, char const **, char const **);
int resp_header_get(const struct response *resp, const char *name,
                    const char **begptr, const char **endptr) {
  int pos = resp_header_locate(resp, name, 0, begptr, endptr);
  return pos != -1;
}


x86 assembly (clang, -O0):
<resp_header_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %edx,%edx
call   1030 <resp_header_locate@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resp_header_get>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
call   1030 <resp_header_locate@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.response = type { i32 }
define i32 @resp_header_get(%struct.response* %0, i8* %1, i8** %2, i8** %3) {
%5 = alloca %struct.response*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
store %struct.response* %0, %struct.response** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load %struct.response*, %struct.response** %5
%11 = load i8*, i8** %6
%12 = load i8**, i8*** %7
%13 = load i8**, i8*** %8
%14 = call i32 @resp_header_locate(%struct.response* %10, i8* %11, i32 0, i8** %12, i8** %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp ne i32 %15, -1
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.response = type { i32 }
define i32 @resp_header_get(%struct.response* %0, i8* %1, i8** %2, i8** %3) {
%5 = tail call i32 @resp_header_locate(%struct.response* %0, i8* %1, i32 0, i8** %2, i8** %3)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int *);
void main() {
  int z;
  for (int i = 0; i < 100; i++) {
    int z;
    z = i + 1;
    foo(i, &z);
    z++;
    z++;
    z++;
    z++;
    z++;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1179 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rdi),%ebp
mov    %ebp,0x4(%rsp)
mov    %rbx,%rsi
call   1030 <foo@plt>
mov    %ebp,%edi
cmp    $0x64,%ebp
jne    1120 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %22, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @foo(i32 %10, i32* %3)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %7
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %4
3: ; preds = %4
ret void
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %6, %4 ]
%6 = add nuw nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i32 @foo(i32 %5, i32* %1)
%8 = icmp eq i32 %6, 100
br i1 %8, label %3, label %4
}
unsigned xrop3_122_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~D;
  stk3 = S | stk4;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_122_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %3, -256
%8 = and i32 %6, %7
%9 = xor i32 %8, 255
%10 = xor i32 %4, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int search(int *, int /*<<< orphan*/, int, int);
int test_not_found() {
  int input[] = {6, 7, 8, 9, 10, 1, 2, 3, 4, 5};
  return -1 == search(input, 0, 9, 11);
}


x86 assembly (clang, -O0):
<test_not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0xb,%ecx
call   1030 <search@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not_found>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0xb,%ecx
call   1030 <search@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_not_found.input = [10 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10, i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_not_found() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 0, i32 9, i32 11)
%5 = icmp eq i32 -1, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_not_found.input = [10 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10, i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_not_found() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 0, i32 9, i32 11)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
void nand_select(void) { (*(volatile unsigned long *)0x4E000004) &= ~(1 << 1); }


x86 assembly (clang, -O0):
<nand_select>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000004,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x4e000004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_select>:
andq   $0xfffffffffffffffd,0x4e000004
4e fd
ret

LLVM IR (-O0):
define void @nand_select() {
%1 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 1308622852 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_select() {
%1 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 1308622852 to i64*)
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *s, size_t n) {
  size_t len;
  char *dup;
  len = strnlen(s, n);
  dup = malloc(len + 1);
  if (dup) {
    memcpy(dup, s, len);
    dup[len] = '\0';
  }
  return dup;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118a <strndup+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t crc8_end(uint8_t crc) { return crc; }


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

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

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

LLVM IR (-O2):
define i32 @crc8_end(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ output_check(int);
int /*<<< orphan*/ output_timing();
void problem_output() {
  if (output_check(1.)) {
    output_timing();
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <output_check@plt>
cmp    $0x0,%rax
je     113f <problem_output+0x1f>
mov    $0x0,%al
call   1030 <output_timing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
mov    $0x1,%edi
call   1040 <output_check@plt>
test   %rax,%rax
je     1138 <problem_output+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1030 <output_timing@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @problem_output() {
%1 = call i64 @output_check(i32 1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @problem_output() {
%1 = tail call i64 @output_check(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}