xunge/DecIR huggingface dataset:
double sgn(double x) { return (x > 0) - (x < 0); }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @sgn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @sgn(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt double %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("usage: physlock [-dhLlmsv] [-u user]\n"); }


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"usage: physlock [-dhLlmsv] [-u user]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"usage: physlock [-dhLlmsv] [-u user]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
uint16_t read16(FILE *fp) {
  uint16_t result;
  fread((&((uint8_t *)&result)[0]), 1, 1, fp);
  fread((&((uint8_t *)&result)[1]), 1, 1, fp);
  return result;
}


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

x86 assembly (clang, -O2):
<read16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read16(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 1, i32 1, i32* %0)
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = call i32 @fread(i32* %5, i32 1, i32 1, i32* %0)
%7 = load i32, i32* %2
ret i32 %7
}
/* Variables and functions */
long long atoll(char *);
char *euca_strestr(char const *, char const *, char const *);
int /*<<< orphan*/ free(char *);
long long euca_strtoll(const char *string, const char *begin, const char *end) {
  char *sBuffer = NULL;
  long long val = -1L;
  if ((sBuffer = euca_strestr(string, begin, end)) != NULL) {
    val = atoll(sBuffer);
    {
      free((sBuffer));
      (sBuffer) = NULL;
    };
  }
  return (val);
}


x86 assembly (clang, -O0):
<euca_strtoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0xffffffffffffffff,-0x28(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <euca_strestr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1191 <euca_strtoll+0x61>
mov    -0x20(%rbp),%rdi
call   1050 <atoll@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euca_strtoll>:
push   %r14
push   %rbx
push   %rax
call   1040 <euca_strestr@plt>
test   %rax,%rax
je     1159 <euca_strtoll+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atoll@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1160 <euca_strtoll+0x30>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @euca_strtoll(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* null, i8** %7
store i64 -1, i64* %8
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i8* @euca_strestr(i8* %9, i8* %10, i8* %11)
store i8* %12, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = call i64 @atoll(i8* %15)
store i64 %16, i64* %8
%17 = load i8*, i8** %7
%18 = call i32 @free(i8* %17)
store i8* null, i8** %7
br label %19
19: ; preds = %14, %3
%20 = load i64, i64* %8
ret i64 %20
}

LLVM IR (-O2):
define i64 @euca_strtoll(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @euca_strestr(i8* %0, i8* %1, i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @atoll(i8* %4)
%8 = tail call i32 @free(i8* %4)
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %7, %6 ], [ -1, %3 ]
ret i64 %10
}
int ft_is_reg(int r1, int r2, int r3) {
  if (r1 < 0 || r1 >= 16 || r2 < 0 || r2 >= 16 || r3 < 0 || r3 >= 16)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<ft_is_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <ft_is_reg+0x49>
cmpl   $0x10,-0x8(%rbp)
jge    1149 <ft_is_reg+0x49>
cmpl   $0x0,-0xc(%rbp)
jl     1149 <ft_is_reg+0x49>
cmpl   $0x10,-0xc(%rbp)
jge    1149 <ft_is_reg+0x49>
cmpl   $0x0,-0x10(%rbp)
jl     1149 <ft_is_reg+0x49>
cmpl   $0x10,-0x10(%rbp)
jl     1155 <ft_is_reg+0x55>
movl   $0x0,-0x4(%rbp)
jmp    115c <ft_is_reg+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_reg>:
or     %esi,%edi
or     %edx,%edi
xor    %eax,%eax
cmp    $0x10,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_is_reg(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %1, %0
%5 = or i32 %4, %2
%6 = icmp ult i32 %5, 16
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void println(int arr[], int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <println+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <println+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <println+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <println+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @println(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HMAC_SHA1_Hash(char *, unsigned char *, unsigned char *,
                                  int);
unsigned char *malloc(int);
unsigned char *HMAC_SHA1(char *cpukey, unsigned char *hmac_key) {
  unsigned char *digest = malloc(16);
  HMAC_SHA1_Hash(cpukey, hmac_key, digest, 16);
  return digest;
}


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

x86 assembly (clang, -O2):
<HMAC_SHA1>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
mov    $0x10,%ecx
call   1030 <HMAC_SHA1_Hash@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @HMAC_SHA1(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%4 = tail call i32 @HMAC_SHA1_Hash(i8* %0, i8* %1, i8* %3, i32 16)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(char *name __attribute__((unused))) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
int test_imm_17uint8_mem(unsigned char *val) {
  return ((*val) & (-0x17 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_17uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -23
%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_17uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -23
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct json_writer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ json_begin_string(struct json_writer *);
int /*<<< orphan*/ json_emit_string_part(struct json_writer *, char const *,
                                         size_t);
int /*<<< orphan*/ json_end_string(struct json_writer *);
void json_emit_string_n(struct json_writer *writer, const char *string,
                        size_t n) {
  json_begin_string(writer);
  json_emit_string_part(writer, string, n);
  json_end_string(writer);
}


x86 assembly (clang, -O0):
<json_emit_string_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <json_begin_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <json_emit_string_part@plt>
mov    -0x8(%rbp),%rdi
call   1030 <json_end_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_emit_string_n>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <json_begin_string@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <json_emit_string_part@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <json_end_string@plt>

LLVM IR (-O0):
%struct.json_writer = type { i32 }
define void @json_emit_string_n(%struct.json_writer* %0, i8* %1, i64 %2) {
%4 = alloca %struct.json_writer*
%5 = alloca i8*
%6 = alloca i64
store %struct.json_writer* %0, %struct.json_writer** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.json_writer*, %struct.json_writer** %4
%8 = call i32 @json_begin_string(%struct.json_writer* %7)
%9 = load %struct.json_writer*, %struct.json_writer** %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @json_emit_string_part(%struct.json_writer* %9, i8* %10, i64 %11)
%13 = load %struct.json_writer*, %struct.json_writer** %4
%14 = call i32 @json_end_string(%struct.json_writer* %13)
ret void
}

LLVM IR (-O2):
%struct.json_writer = type { i32 }
define void @json_emit_string_n(%struct.json_writer* %0, i8* %1, i64 %2) {
%4 = tail call i32 @json_begin_string(%struct.json_writer* %0)
%5 = tail call i32 @json_emit_string_part(%struct.json_writer* %0, i8* %1, i64 %2)
%6 = tail call i32 @json_end_string(%struct.json_writer* %0)
ret void
}
/* Variables and functions */
int RSA2048_execute(int, char *);
int /*<<< orphan*/ printf(char *);
int RSA2048_Encrypt(int fd) {
  int ret;
  ret = RSA2048_execute(fd, "BF11C00000");
  if (ret != 0) {
    printf("ERR:RSA2048_Encrypt failed!\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<RSA2048_Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <RSA2048_execute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115a <RSA2048_Encrypt+0x3a>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_Encrypt>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <RSA2048_execute@plt>
test   %eax,%eax
je     113d <RSA2048_Encrypt+0x1d>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"BF11C00000\00"
@.str.1 = [29 x i8] c"ERR:RSA2048_Encrypt failed!\0A\00"
define i32 @RSA2048_Encrypt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @RSA2048_execute(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"BF11C00000\00"
@str = [28 x i8] c"ERR:RSA2048_Encrypt failed!\00"
define i32 @RSA2048_Encrypt(i32 %0) {
%2 = tail call i32 @RSA2048_execute(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char *, char);
char *skipSpace(char *p) {
  while ((!!strchr(" \t\n\r", *p)))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed9(%rip),%rdi
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
test   $0x1,%al
jne    1146 <skipSpace+0x36>
jmp    1157 <skipSpace+0x47>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0x1(%rbx),%esi
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %eax,%eax
jne    1130 <skipSpace+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @skipSpace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %10, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i32 @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @skipSpace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void network_ipv4_destroy() { system("iptables -F"); }


x86 assembly (clang, -O0):
<network_ipv4_destroy>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"iptables -F\00"
define void @network_ipv4_destroy() {
%1 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"iptables -F\00"
define void @network_ipv4_destroy() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *s) {
  printf("ERROR: %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strcmp(char *, char *);
int hash_cmp(void *a, void *b) { return strcmp(((char *)a), ((char *)b)); }


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

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

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

LLVM IR (-O2):
define i32 @hash_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ F(int, int, int);
scalar_t__ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  while (scanf("%d/%d/%d", &a, &b, &c) != EOF) {
    F(a, b, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <F@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e99(%rip),%r13
cmp    0x0(%r13),%rax
je     1198 <main+0x78>
lea    0xea4(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
call   1030 <F@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d/%d/%d\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %18, label %10
10: ; preds = %0, %10
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @F(i32 %11, i32 %12, i32 %13)
%15 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %10
18: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
void bar() {
  printf("In bar()\n");
  foo();
  printf("After calling foo, but you won't see me here.\n");
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"In bar()\0A\00"
@.str.1 = [47 x i8] c"After calling foo, but you won't see me here.\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @foo()
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"In bar()\00"
@str.2 = [46 x i8] c"After calling foo, but you won't see me here.\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sscanf(char const *, char *, float *);
int capture_float(const char *carg, void *pvar) {
  float *pf = pvar;
  return sscanf(carg, "%f", pf) == 1 ? 0 : 1;
}


x86 assembly (clang, -O0):
<capture_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xec9(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_float>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @capture_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
store float* %7, float** %5
%8 = load i8*, i8** %3
%9 = load float*, float** %5
%10 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %9)
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @capture_float(i8* nocapture %0, i8* %1) {
%3 = bitcast i8* %1 to float*
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void picolcd_exit_cir(struct picolcd_data *data) {}


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

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

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

LLVM IR (-O2):
%struct.picolcd_data = type opaque
define void @picolcd_exit_cir(%struct.picolcd_data* nocapture %0) {
ret void
}
/* Type definitions */
struct text_tag_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_free(struct genlist *);
void text_tag_list_free(struct text_tag_list *tthis) {
  genlist_free(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<text_tag_list_free>:
jmp    1030 <genlist_free@plt>

LLVM IR (-O0):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_free(%struct.text_tag_list* %0) {
%2 = alloca %struct.text_tag_list*
store %struct.text_tag_list* %0, %struct.text_tag_list** %2
%3 = load %struct.text_tag_list*, %struct.text_tag_list** %2
%4 = bitcast %struct.text_tag_list* %3 to %struct.genlist*
%5 = call i32 @genlist_free(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_free(%struct.text_tag_list* %0) {
%2 = bitcast %struct.text_tag_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_free(%struct.genlist* %2)
ret void
}
/* Type definitions */
struct group {
  int /*<<< orphan*/ gr_gid;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
struct group *getgrnam(char *);
int /*<<< orphan*/ stderr;
gid_t get_group_id(char *group) {
  struct group *gr;
  gr = getgrnam(group);
  if (!gr) {
    fprintf(stderr, "no such group: %s\n", group);
    exit(1);
  }
  return gr->gr_gid;
}


x86 assembly (clang, -O0):
<get_group_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getgrnam@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <get_group_id+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_group_id>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getgrnam@plt>
test   %rax,%rax
je     1142 <get_group_id+0x12>
mov    (%rax),%eax
pop    %rbx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.group = type { i32 }
@stderr = global i32 0
@.str = [19 x i8] c"no such group: %s\0A\00"
define i32 @get_group_id(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.group*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.group* @getgrnam(i8* %4)
store %struct.group* %5, %struct.group** %3
%6 = load %struct.group*, %struct.group** %3
%7 = icmp ne %struct.group* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load %struct.group*, %struct.group** %3
%15 = getelementptr inbounds %struct.group, %struct.group* %14, i32 0, i32 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
%struct.group = type { i32 }
@stderr = global i32 0
@.str = [19 x i8] c"no such group: %s\0A\00"
define i32 @get_group_id(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int fft_size(int);
void fft_expand(int n, int *l, int *h) {
  int N, d;
  N = n + *l + *h;
  d = fft_size(N) - N;
  *l += d / 2;
  *h += d - d / 2;
}


x86 assembly (clang, -O0):
<fft_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <fft_size@plt>
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_expand>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
add    (%rsi),%ebp
add    (%rdx),%ebp
mov    %ebp,%edi
call   1030 <fft_size@plt>
sub    %ebp,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    %ecx,(%rbx)
sub    %ecx,%eax
add    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fft_expand(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @fft_size(i32 %16)
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = sdiv i32 %20, 2
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %21
store i32 %24, i32* %22
%25 = load i32, i32* %8
%26 = load i32, i32* %8
%27 = sdiv i32 %26, 2
%28 = sub nsw i32 %25, %27
%29 = load i32*, i32** %6
%30 = load i32, i32* %29
%31 = add nsw i32 %30, %28
store i32 %31, i32* %29
ret void
}

LLVM IR (-O2):
define void @fft_expand(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = tail call i32 @fft_size(i32 %7)
%9 = sub nsw i32 %8, %7
%10 = sdiv i32 %9, 2
%11 = load i32, i32* %1
%12 = add nsw i32 %10, %11
store i32 %12, i32* %1
%13 = sub i32 %9, %10
%14 = load i32, i32* %2
%15 = add nsw i32 %13, %14
store i32 %15, i32* %2
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR72_set(void) { return U_WMRCORENONE_set("U_WMR72"); }


x86 assembly (clang, -O0):
<U_WMR72_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR72\00"
define i8* @U_WMR72_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR72\00"
define i8* @U_WMR72_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(void *);
void *TNCJob_close_wrapper(void *freeable_fd) {
  close(*(int *)freeable_fd);
  free(freeable_fd);
  return NULL;
}


x86 assembly (clang, -O0):
<TNCJob_close_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TNCJob_close_wrapper>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <close@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @TNCJob_close_wrapper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @TNCJob_close_wrapper(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @free(i8* %0)
ret i8* null
}
void SHAREMIND_MAP_KEY_FREE_int(int *const dest) { (void)dest; }


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int(i32* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int hasard(unsigned int const, unsigned int const);
unsigned int tirerChance(const unsigned int min, const unsigned int max) {
  unsigned int chance;
  chance = hasard(min, max);
  return chance == 1;
}


x86 assembly (clang, -O0):
<tirerChance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <hasard@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tirerChance>:
push   %rax
call   1030 <hasard@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tirerChance(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @hasard(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @tirerChance(i32 %0, i32 %1) {
%3 = tail call i32 @hasard(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int indexOf_shift(char *, char *, int /*<<< orphan*/);
int indexOf(char *base, char *str) { return indexOf_shift(base, str, 0); }


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

x86 assembly (clang, -O2):
<indexOf>:
xor    %edx,%edx
jmp    1030 <indexOf_shift@plt>

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

LLVM IR (-O2):
define i32 @indexOf(i8* %0, i8* %1) {
%3 = tail call i32 @indexOf_shift(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_version() {
  printf("mac-robber information:\n");
  printf("   version: %s \n", "1.02");
  printf("   author: Brian Carrier\n");
  printf("   url: http://www.sleuthkit.org\n");
  exit(0);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"mac-robber information:\0A\00"
@.str.1 = [17 x i8] c" version: %s \0A\00"
@.str.2 = [5 x i8] c"1.02\00"
@.str.3 = [26 x i8] c" author: Brian Carrier\0A\00"
@.str.4 = [34 x i8] c" url: http://www.sleuthkit.org\0A\00"
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c" version: %s \0A\00"
@.str.2 = [5 x i8] c"1.02\00"
@str = [24 x i8] c"mac-robber information:\00"
@str.5 = [25 x i8] c" author: Brian Carrier\00"
@str.6 = [33 x i8] c" url: http://www.sleuthkit.org\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
void paravirt_set_cap(void) {}


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

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

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

LLVM IR (-O2):
define void @paravirt_set_cap() {
ret void
}
/* Variables and functions */
int apic_read(int);
void apic_wait_icr_idle(void) {
  do {
  } while (apic_read(0x300) & 0x01000);
}


x86 assembly (clang, -O0):
<apic_wait_icr_idle>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <apic_wait_icr_idle+0x9>
jmp    111e <apic_wait_icr_idle+0xe>
mov    $0x300,%edi
call   1030 <apic_read@plt>
and    $0x1000,%eax
cmp    $0x0,%eax
jne    1119 <apic_wait_icr_idle+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic_wait_icr_idle>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x300,%edi
call   1030 <apic_read@plt>
test   $0x1000,%eax
jne    1120 <apic_wait_icr_idle+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @apic_wait_icr_idle() {
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
%3 = call i32 @apic_read(i32 768)
%4 = and i32 %3, 4096
%5 = icmp ne i32 %4, 0
br i1 %5, label %1, label %6
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @apic_wait_icr_idle() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @apic_read(i32 768)
%3 = and i32 %2, 4096
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ rook_attacks(int, int);
void rook_attacks_test(void **state) {
  assert_int_equal(0x000010106C101000ul,
                   rook_attacks(0x0000000010000000ul, 0x8181918144819181ul));
}


x86 assembly (clang, -O0):
<rook_attacks_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10000000,%edi
mov    $0x44819181,%esi
call   1030 <rook_attacks@plt>
mov    %eax,%esi
mov    $0x6c101000,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rook_attacks_test>:
push   %rax
mov    $0x10000000,%edi
mov    $0x44819181,%esi
call   1030 <rook_attacks@plt>
mov    $0x6c101000,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @rook_attacks_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @rook_attacks(i32 268435456, i32 1149342081)
%4 = call i32 @assert_int_equal(i32 1812992000, i32 %3)
ret void
}

LLVM IR (-O2):
define void @rook_attacks_test(i8** nocapture readnone %0) {
%2 = tail call i32 @rook_attacks(i32 268435456, i32 1149342081)
%3 = tail call i32 @assert_int_equal(i32 1812992000, i32 %2)
ret void
}