xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("honey");
  main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
call   1040 <main@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"honey\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @main()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"honey\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %1
}
int test_imm_29uint16_mem(unsigned short *val) {
  return ((*val) & (-0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_29uint16_mem>:
movzwl (%rdi),%eax
test   $0xffd7,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_29uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -41
%7 = icmp ne i32 %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_29uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -41
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int *restar_1_svc(int a, int b, struct svc_req *rqstp) {
  static int r;
  r = a - b;
  return (&r);
}


x86 assembly (clang, -O0):
<restar_1_svc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,0x2f0a(%rip)
lea    0x2f03(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<restar_1_svc>:
sub    %esi,%edi
mov    %edi,0x2f1c(%rip)
lea    0x2f15(%rip),%rax
ret

LLVM IR (-O0):
%struct.svc_req = type opaque
@restar_1_svc.r = internal global i32 0
define i32* @restar_1_svc(i32 %0, i32 %1, %struct.svc_req* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.svc_req*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %7, %8
store i32 %9, i32* @restar_1_svc.r
ret i32* @restar_1_svc.r
}

LLVM IR (-O2):
%struct.svc_req = type opaque
@restar_1_svc.r = internal global i32 0
define i32* @restar_1_svc(i32 %0, i32 %1, %struct.svc_req* nocapture readnone %2) {
%4 = sub nsw i32 %0, %1
store i32 %4, i32* @restar_1_svc.r
ret i32* @restar_1_svc.r
}
/* Variables and functions */
int strlen(char *);
int isheader(char *string) {
  if (string[0] == '[' && string[strlen(string) - 1] == ']') {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<isheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1162 <isheader+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
jne    1162 <isheader+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1169 <isheader+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isheader>:
push   %rbx
cmpb   $0x5b,(%rdi)
jne    112d <isheader+0x1d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
mov    $0x1,%eax
cmpb   $0x5d,-0x1(%rcx,%rbx,1)
je     112f <isheader+0x1f>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isheader(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 91
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 93
br i1 %10, label %12, label %11
11: ; preds = %4, %1
br label %12
12: ; preds = %4, %11
%13 = phi i32 [ 0, %11 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ trio_fpclassify_and_signbit(double, int *);
int trio_signbit(double number) {
  int is_negative;
  (void)trio_fpclassify_and_signbit(number, &is_negative);
  return is_negative;
}


x86 assembly (clang, -O0):
<trio_signbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1030 <trio_fpclassify_and_signbit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @trio_signbit(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @trio_fpclassify_and_signbit(double %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
void error_retain_count_underflow(void *client_state, void *retainable) {}


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

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

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

LLVM IR (-O2):
define void @error_retain_count_underflow(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void mus_lfloat_to_char(unsigned char *j, float x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[3];
  j[1] = ox[2];
  j[2] = ox[1];
  j[3] = ox[0];
}


x86 assembly (clang, -O0):
<mus_lfloat_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_lfloat_to_char>:
movd   %xmm0,%eax
bswap  %eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @mus_lfloat_to_char(i8* nocapture writeonly %0, float %1) {
%3 = bitcast float %1 to i32
%4 = lshr i32 %3, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %0
%6 = lshr i32 %3, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %3, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %3 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
int /*<<< orphan*/ u_strlcpy(char *, char const *, size_t);
char *strlncpy(char *dest, const char *src, size_t l, size_t n) {
  if (n < (l - 1)) {
    strncpy(dest, src, n);
    dest[n] = '\0';
  } else
    u_strlcpy(dest, src, l);
  return dest;
}


x86 assembly (clang, -O0):
<strlncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    116f <strlncpy+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1180 <strlncpy+0x60>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <u_strlcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x1(%rdx),%rax
cmp    %rcx,%rax
jbe    1145 <strlncpy+0x25>
mov    %rcx,%rbx
mov    %r14,%rdi
mov    %rcx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r14,%rbx,1)
jmp    114d <strlncpy+0x2d>
mov    %r14,%rdi
call   1040 <u_strlcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlncpy(i8* returned %0, i8* %1, i64 %2, i64 %3) {
%5 = add i64 %2, -1
%6 = icmp ugt i64 %5, %3
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %3)
%9 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %9
br label %12
10: ; preds = %4
%11 = tail call i32 @u_strlcpy(i8* %0, i8* %1, i64 %2)
br label %12
12: ; preds = %10, %7
ret i8* %0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_pspoll(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x00A0);
}


x86 assembly (clang, -O0):
<ieee80211_is_pspoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xa4,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_pspoll>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xa4,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_pspoll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 164)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_pspoll(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 164)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t int2bcd(uint8_t value) { return (value % 10) + 16 * (value / 10); }


x86 assembly (clang, -O0):
<int2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x4,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2bcd>:
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
shl    $0x4,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int2bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
%7 = mul nsw i32 16, %6
%8 = add nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @int2bcd(i32 %0) {
%2 = srem i32 %0, 10
%3 = sdiv i32 %0, 10
%4 = shl nsw i32 %3, 4
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ add_command(unsigned int *, int, int);
int /*<<< orphan*/ ipfw_init(int, char **, unsigned int, char const *,
                             int /*<<< orphan*/);
scalar_t__ optind;
int ipfw_new_chain(int args, char **arglist, const char *chain) {
  unsigned int command = 0;
  add_command(&command, 0x0100u, 0x0000U);
  ipfw_init(args, arglist, command, chain, 0);
  optind = 0;
  return (0);
}


x86 assembly (clang, -O0):
<ipfw_new_chain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x100,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e81(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipfw_new_chain>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x100,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    0xc(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e84(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@optind = global i64 0
define i32 @ipfw_new_chain(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = call i32 @add_command(i32* %7, i32 256, i32 0)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @ipfw_init(i32 %9, i8** %10, i32 %11, i8* %12, i32 0)
store i64 0, i64* @optind
ret i32 0
}

LLVM IR (-O2):
@optind = global i64 0
define i32 @ipfw_new_chain(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @add_command(i32* %4, i32 256, i32 0)
%7 = load i32, i32* %4
%8 = call i32 @ipfw_init(i32 %0, i8** %1, i32 %7, i8* %2, i32 0)
store i64 0, i64* @optind
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strsignal(int signo) {
  static char buf[64];
  snprintf(buf, sizeof buf, "Signal %d", signo);
  return buf;
}


x86 assembly (clang, -O0):
<strsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x40,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsignal>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strsignal.buf = internal global [64 x i8] zeroinitializer
@.str = [10 x i8] c"Signal %d\00"
define i8* @strsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strsignal.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strsignal.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@strsignal.buf = internal global [64 x i8] zeroinitializer
@.str = [10 x i8] c"Signal %d\00"
define i8* @strsignal(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strsignal.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strsignal.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *string = "dad";
  string[0] = 'b';
  printf("%s\n", string);
  *string = 'm';
  printf("%s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x10(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movb   $0x6d,(%rax)
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee9(%rip),%rbx
lea    0xede(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"dad\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unlink(char *);
void checksize(FILE *fout, FILE *fin) {
  if (ftell(fout) > 512) {
    printf("Compiled size greater than 512 bytes!\n");
    fclose(fout);
    fclose(fin);
    unlink("63s_grub_cfg");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checksize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ftell@plt>
cmp    $0x200,%eax
jle    11a8 <checksize+0x58>
lea    0xe85(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xe8e(%rip),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checksize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <ftell@plt>
cmp    $0x201,%eax
jge    116e <checksize+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe98(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
lea    0xe6f(%rip),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Compiled size greater than 512 bytes!\0A\00"
@.str.1 = [13 x i8] c"63s_grub_cfg\00"
define void @checksize(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = call i32 @ftell(i32* %5)
%7 = icmp sgt i32 %6, 512
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
%12 = load i32*, i32** %4
%13 = call i32 @fclose(i32* %12)
%14 = call i32 @unlink(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"63s_grub_cfg\00"
@str = [38 x i8] c"Compiled size greater than 512 bytes!\00"
define void @checksize(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @ftell(i32* %0)
%4 = icmp sgt i32 %3, 512
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @fclose(i32* %0)
%8 = tail call i32 @fclose(i32* %1)
%9 = tail call i32 @unlink(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char const *);
void sa_log_output_exit(const char *buf) { panic(buf); }


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

x86 assembly (clang, -O2):
<sa_log_output_exit>:
jmp    1030 <panic@plt>

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

LLVM IR (-O2):
define void @sa_log_output_exit(i8* %0) {
%2 = tail call i32 @panic(i8* %0)
ret void
}
/* Variables and functions */
long double tanh(long double);
long double fun_tanh(long double a) { return tanh(a); }


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

x86 assembly (clang, -O2):
<fun_tanh>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define x86_fp80 @fun_tanh(x86_fp80 %0) {
%2 = tail call x86_fp80 @tanh(x86_fp80 %0)
ret x86_fp80 %2
}
int sub_i(int a, int b) { return (a - b); }


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

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

LLVM IR (-O0):
define i32 @sub_i(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sub_i(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
size_t __strftime_l(char *, size_t, char const *, struct tm const *,
                    int /*<<< orphan*/);
size_t strftime(char *restrict s, size_t n, const char *restrict f,
                const struct tm *restrict tm) {
  return __strftime_l(s, n, f, tm, 0);
}


x86 assembly (clang, -O0):
<strftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <__strftime_l@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strftime>:
xor    %r8d,%r8d
jmp    1030 <__strftime_l@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @strftime(i8* noalias %0, i64 %1, i8* noalias %2, %struct.tm* noalias %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca %struct.tm*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store %struct.tm* %3, %struct.tm** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load %struct.tm*, %struct.tm** %8
%13 = call i64 @__strftime_l(i8* %9, i64 %10, i8* %11, %struct.tm* %12, i32 0)
ret i64 %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @strftime(i8* noalias %0, i64 %1, i8* noalias %2, %struct.tm* noalias %3) {
%5 = tail call i64 @__strftime_l(i8* %0, i64 %1, i8* %2, %struct.tm* %3, i32 0)
ret i64 %5
}
int main(void) { int nums[3]; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int f_blt_cr1(float a1) { return (__builtin_isless(100, a1)); }


x86 assembly (clang, -O0):
<f_blt_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blt_cr1>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @f_blt_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_blt_cr1(float %0) {
%2 = fcmp ogt float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_word(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeconfig_enable(void) {
  eeprom_update_word((uint16_t *)0, (uint16_t)0xFEED);
}


x86 assembly (clang, -O0):
<eeconfig_enable>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0xfeed,%esi
call   1030 <eeprom_update_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_enable>:
xor    %edi,%edi
mov    $0xfeed,%esi
jmp    1030 <eeprom_update_word@plt>

LLVM IR (-O0):
define void @eeconfig_enable() {
%1 = call i32 @eeprom_update_word(i32* null, i32 65261)
ret void
}

LLVM IR (-O2):
define void @eeconfig_enable() {
%1 = tail call i32 @eeprom_update_word(i32* null, i32 65261)
ret void
}
/* Variables and functions */
double funcAngCor_alpha0_5minus_0plus_15097_L5(double *, double *);
double sin(double);
double fitAngDist_alpha0_5minus_0plus_15097_L5(double *x, double *par) {
  double result;
  result = funcAngCor_alpha0_5minus_0plus_15097_L5(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha0_5minus_0plus_15097_L5>:
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 <funcAngCor_alpha0_5minus_0plus_15097_L5@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha0_5minus_0plus_15097_L5>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <funcAngCor_alpha0_5minus_0plus_15097_L5@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha0_5minus_0plus_15097_L5(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha0_5minus_0plus_15097_L5(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha0_5minus_0plus_15097_L5(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha0_5minus_0plus_15097_L5(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
unsigned long long int gcd(unsigned long long int a, unsigned long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <gcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <gcd+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
store i64 %9, i64* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = urem i64 %12, %13
%15 = call i64 @gcd(i64 %11, i64 %14)
store i64 %15, i64* %3
br label %16
16: ; preds = %10, %8
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = urem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
unsigned long unpacki32(unsigned char *buf) {
  return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
}


x86 assembly (clang, -O0):
<unpacki32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpacki32>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x10,%rcx
cltq
or     %rcx,%rax
movzbl 0x2(%rdi),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x3(%rdi),%eax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @unpacki32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
%19 = sext i32 %18 to i64
ret i64 %19
}
/* Variables and functions */
long long computeSquare(long long);
long long int computeCubeSum(int n) {
  long long int cpyN = n;
  return computeSquare((cpyN * (cpyN + 1)) >> 1);
}


x86 assembly (clang, -O0):
<computeCubeSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
add    $0x1,%rax
imul   %rax,%rdi
sar    $0x1,%rdi
call   1030 <computeSquare@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeCubeSum>:
movslq %edi,%rax
lea    0x1(%rax),%rdi
imul   %rax,%rdi
sar    %rdi
jmp    1030 <computeSquare@plt>

LLVM IR (-O0):
define i64 @computeCubeSum(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 1
%9 = mul nsw i64 %6, %8
%10 = ashr i64 %9, 1
%11 = call i64 @computeSquare(i64 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @computeCubeSum(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 1
%4 = mul nsw i64 %3, %2
%5 = ashr i64 %4, 1
%6 = tail call i64 @computeSquare(i64 %5)
ret i64 %6
}
int bittest(unsigned char x, int b) { return x & (1 << b); }


x86 assembly (clang, -O0):
<bittest>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bittest>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bittest(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bittest(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw i32 1, %1
%5 = and i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t GetUInt16LE(uint8_t *ptr) { return ptr[0] + (ptr[1] << 8); }


x86 assembly (clang, -O0):
<GetUInt16LE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUInt16LE>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @GetUInt16LE(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = add nsw i32 %5, %2
ret i32 %6
}
__int128 add_128(__int128 *ptr, __int128 val) { return (*ptr + val); }


x86 assembly (clang, -O0):
<add_128>:
push   %rbp
mov    %rsp,%rbp
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdi,-0x28(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
mov    0x8(%rax),%rax
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
add    %rsi,%rcx
adc    %rdx,%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_128>:
mov    %rsi,%rax
add    (%rdi),%rax
adc    0x8(%rdi),%rdx
ret

LLVM IR (-O0):
define { i64, i64 } @add_128(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128*
%7 = alloca i128
%8 = bitcast i128* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %1, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %2, i64* %10
%11 = load i128, i128* %5
store i128* %0, i128** %6
store i128 %11, i128* %7
%12 = load i128*, i128** %6
%13 = load i128, i128* %12
%14 = load i128, i128* %7
%15 = add nsw i128 %13, %14
store i128 %15, i128* %4
%16 = bitcast i128* %4 to { i64, i64 }*
%17 = load { i64, i64 }, { i64, i64 }* %16
ret { i64, i64 } %17
}

LLVM IR (-O2):
define { i64, i64 } @add_128(i128* nocapture %0, i64 %1, i64 %2) {
%4 = zext i64 %2 to i128
%5 = shl nuw i128 %4, 64
%6 = zext i64 %1 to i128
%7 = or i128 %5, %6
%8 = load i128, i128* %0
%9 = add nsw i128 %7, %8
%10 = trunc i128 %9 to i64
%11 = lshr i128 %9, 64
%12 = trunc i128 %11 to i64
%13 = insertvalue { i64, i64 } poison, i64 %10, 0
%14 = insertvalue { i64, i64 } %13, i64 %12, 1
ret { i64, i64 } %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gl2psFree(void *ptr) {
  if (!ptr)
    return;
  free(ptr);
}


x86 assembly (clang, -O0):
<gl2psFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <gl2psFree+0x1c>
jmp    1135 <gl2psFree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl2psFree>:
test   %rdi,%rdi
je     111a <gl2psFree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @gl2psFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
unsigned xrop3_224_0_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;
  stk2 = D | S;
  stk1 = T & stk2;
  return stk1;
}


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

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

LLVM IR (-O0):
define i32 @xrop3_224_0_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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_224_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, 255
%8 = and i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fdatasync(int);
void pcap_rw_fsync_pcap(int fd) { fdatasync(fd); }


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

x86 assembly (clang, -O2):
<pcap_rw_fsync_pcap>:
jmp    1030 <fdatasync@plt>

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

LLVM IR (-O2):
define void @pcap_rw_fsync_pcap(i32 %0) {
%2 = tail call i32 @fdatasync(i32 %0)
ret void
}
void init_stat(void) {}


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

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

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

LLVM IR (-O2):
define void @init_stat() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swerr1(char *);
int /*<<< orphan*/ swerr_SetPos(char *, int);
int os_SetLock(char const *path, int perms, int left_open) {
  do {
    swerr_SetPos("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/misty-fungus/ejudge-debian/"
                 "refs/heads/master/win32/reuse_setlock.c",
                 35);
    swerr1("Not implemented");
  } while (0);
}


x86 assembly (clang, -O0):
<os_SetLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x23,%esi
call   1030 <swerr_SetPos@plt>
lea    0xf53(%rip),%rdi
call   1040 <swerr1@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_SetLock>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x23,%esi
call   1030 <swerr_SetPos@plt>
lea    0xf64(%rip),%rdi
pop    %rax
jmp    1040 <swerr1@plt>

LLVM IR (-O0):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/misty-fungus/ejudge-debian/refs/heads/master/win32/reuse_setlock.c\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define i32 @os_SetLock(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
br label %8
8: ; preds = %3
%9 = call i32 @swerr_SetPos(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 35)
%10 = call i32 @swerr1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/misty-fungus/ejudge-debian/refs/heads/master/win32/reuse_setlock.c\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define i32 @os_SetLock(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @swerr_SetPos(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 35)
%5 = tail call i32 @swerr1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
void mumps_config_file_return_c() {}


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

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

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

LLVM IR (-O2):
define void @mumps_config_file_return_c() {
ret void
}
int config_WITH_PCSC(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @config_WITH_PCSC() {
ret i32 0
}

LLVM IR (-O2):
define i32 @config_WITH_PCSC() {
ret i32 0
}