xunge/DecIR huggingface dataset:
int build_cmd6_args(int cmd_set, int value, int index, int access) {
  int args = 0;
  args = (cmd_set & 0x7) | ((value & 0xFF) << 8) | ((index & 0xFF) << 16) |
         ((access & 0x3) << 24);
  return args;
}


x86 assembly (clang, -O0):
<build_cmd6_args>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0x3,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_cmd6_args>:
and    $0x7,%edi
shl    $0x8,%esi
movzwl %si,%esi
or     %edi,%esi
movzbl %dl,%eax
shl    $0x10,%eax
or     %esi,%eax
and    $0x3,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @build_cmd6_args(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = and i32 %10, 7
%12 = load i32, i32* %6
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %7
%17 = and i32 %16, 255
%18 = shl i32 %17, 16
%19 = or i32 %15, %18
%20 = load i32, i32* %8
%21 = and i32 %20, 3
%22 = shl i32 %21, 24
%23 = or i32 %19, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @build_cmd6_args(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, 7
%6 = shl i32 %1, 8
%7 = and i32 %6, 65280
%8 = or i32 %7, %5
%9 = shl i32 %2, 16
%10 = and i32 %9, 16711680
%11 = or i32 %8, %10
%12 = shl i32 %3, 24
%13 = and i32 %12, 50331648
%14 = or i32 %11, %13
ret i32 %14
}
int __tiger__not(int i) {
  if (i) {
    return 0;
  };
  return 1;
}


x86 assembly (clang, -O0):
<__tiger__not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <__tiger__not+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <__tiger__not+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tiger__not>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @__tiger__not(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void huawei_add_persistent_device(void) {}


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

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

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

LLVM IR (-O2):
define void @huawei_add_persistent_device() {
ret void
}
int send_tui_msg_running(int type, int val, void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @send_tui_msg_running(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
unsigned char applegcr_decode4and4(unsigned char b1, unsigned char b2) {
  return (((b1 << 1) | 1) & b2);
}


x86 assembly (clang, -O0):
<applegcr_decode4and4>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
or     $0x1,%eax
movzbl -0x2(%rbp),%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<applegcr_decode4and4>:
lea    (%rdi,%rdi,1),%eax
or     $0x1,%al
and    %sil,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @applegcr_decode4and4(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %0, 1
%4 = or i8 %3, 1
%5 = and i8 %4, %1
ret i8 %5
}
/* Variables and functions */
char toupper(char);
char *upcase(char *s) {
  char *p = s;
  while (*p = toupper(*p))
    p++;
  return s;
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114f <upcase+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <upcase+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <upcase+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @upcase(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *join(char *string1, char *string2) {
  char *return_line = (char *)malloc(strlen(string1) + strlen(string2));
  strcpy(return_line, string1);
  strcat(return_line, string2);
  return return_line;
}


x86 assembly (clang, -O0):
<join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @join(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @join(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, %3
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int scanf(char *, double *);
int /*<<< orphan*/ stdin;
void readDouble1(double *variableAddress) {
  bool ret;
  ret = scanf("\n%lf", variableAddress);
  __fpurge(stdin);
  if (ret != true) {
    readDouble1(variableAddress);
  }
}


x86 assembly (clang, -O0):
<readDouble1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0xc(%rbp)
je     1170 <readDouble1+0x40>
mov    -0x8(%rbp),%rdi
call   1040 <readDouble1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDouble1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xecf(%rip),%r14
mov    0x2eb0(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %eax,%ebp
mov    (%r15),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1140 <readDouble1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%lf\00"
@stdin = global i32 0
define void @readDouble1(double* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %0)
%4 = load i32, i32* @stdin
%5 = tail call i32 @__fpurge(i32 %4)
%6 = icmp eq i32 %3, 1
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
/* Variables and functions */
double exp(double);
double fn(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<fn>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @fn(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
double _get_double(const char *data, size_t pos) {
  double *buf = (double *)data;
  return (buf[pos]);
}


x86 assembly (clang, -O0):
<_get_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_double>:
movsd  (%rdi,%rsi,8),%xmm0
ret

LLVM IR (-O0):
define double @_get_double(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca double*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to double*
store double* %7, double** %5
%8 = load double*, double** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds double, double* %8, i64 %9
%11 = load double, double* %10
ret double %11
}

LLVM IR (-O2):
define double @_get_double(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to double*
%4 = getelementptr inbounds double, double* %3, i64 %1
%5 = load double, double* %4
ret double %5
}
void loadErrors(void) {}


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

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

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

LLVM IR (-O2):
define void @loadErrors() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int ExistsFile(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<ExistsFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <ExistsFile+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <ExistsFile+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExistsFile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @ExistsFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @ExistsFile(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
double _g_0(void) { return 0.0; }


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

x86 assembly (clang, -O2):
<_g_0>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_g_0() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @_g_0() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ firc_send(char *, char const *, ...);
void login(const char *nick, const char *user, const char *real) {
  firc_send("USER %s 6 6 :%s", user, real);
  firc_send("NICK %s", nick);
}


x86 assembly (clang, -O0):
<login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <firc_send@plt>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <firc_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<login>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <firc_send@plt>
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <firc_send@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"USER %s 6 6 :%s\00"
@.str.1 = [8 x i8] c"NICK %s\00"
define void @login(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, ...) @firc_send(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%5 = tail call i32 (i8*, i8*, ...) @firc_send(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int Problem038(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @Problem038() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Problem038() {
ret i32 1
}
/* Variables and functions */
void CL_InitRef(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_InitRef() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha512_finish_ctx(void *, unsigned char *);
void sha512_final(unsigned char *digest, void *context) {
  sha512_finish_ctx(context, digest);
}


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

x86 assembly (clang, -O2):
<sha512_final>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <sha512_finish_ctx@plt>

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

LLVM IR (-O2):
define void @sha512_final(i8* %0, i8* %1) {
%3 = tail call i32 @sha512_finish_ctx(i8* %1, i8* %0)
ret void
}
/* Type definitions */
struct blob_buf {
  int dummy;
};
struct blob_attr {
  int dummy;
};

/* Variables and functions */
struct blob_attr *blob_put(struct blob_buf *, int, char const *, scalar_t__);
scalar_t__ strlen(char const *);
struct blob_attr *blob_put_string(struct blob_buf *buf, int id,
                                  const char *str) {
  return blob_put(buf, id, str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<blob_put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
call   1040 <blob_put@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blob_put_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rcx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <blob_put@plt>

LLVM IR (-O0):
%struct.blob_attr = type { i32 }
%struct.blob_buf = type { i32 }
define %struct.blob_attr* @blob_put_string(%struct.blob_buf* %0, i32 %1, i8* %2) {
%4 = alloca %struct.blob_buf*
%5 = alloca i32
%6 = alloca i8*
store %struct.blob_buf* %0, %struct.blob_buf** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.blob_buf*, %struct.blob_buf** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call %struct.blob_attr* @blob_put(%struct.blob_buf* %7, i32 %8, i8* %9, i64 %12)
ret %struct.blob_attr* %13
}

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
%struct.blob_buf = type { i32 }
define %struct.blob_attr* @blob_put_string(%struct.blob_buf* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add nsw i64 %4, 1
%6 = tail call %struct.blob_attr* @blob_put(%struct.blob_buf* %0, i32 %1, i8* %2, i64 %5)
ret %struct.blob_attr* %6
}
/* Variables and functions */
int /*<<< orphan*/ use(int *);
void test_all_zeros() {
  int a[16] = {};
  use(a);
}


x86 assembly (clang, -O0):
<test_all_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
call   1030 <use@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_zeros>:
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <use@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @test_all_zeros() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @use(i32* %3)
ret void
}

LLVM IR (-O2):
define void @test_all_zeros() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @use(i32* %3)
ret void
}
int(toascii)(int c) { return toascii(c); }


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

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

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
ret i32 undef
}
int atfd(int fd) {
  if (fd == -2)
    return -100;
  return fd;
}


x86 assembly (clang, -O0):
<atfd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jne    111d <atfd+0x1d>
movl   $0xffffff9c,-0x4(%rbp)
jmp    1123 <atfd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atfd>:
cmp    $0xfffffffe,%edi
mov    $0xffffff9c,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @atfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -100, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @atfd(i32 %0) {
%2 = icmp eq i32 %0, -2
%3 = select i1 %2, i32 -100, i32 %0
ret i32 %3
}
void fly_process_args(int *argc, char **argv[], char ***envp) {}


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

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

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

LLVM IR (-O2):
define void @fly_process_args(i32* nocapture %0, i8*** nocapture %1, i8*** nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *memchr(void const *, int, size_t);
void *Memchr(const void *s, int c, size_t n) {
  assert(s != NULL);
  assert(n > 0);
  return memchr(s, c, n);
}


x86 assembly (clang, -O0):
<Memchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memchr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <memchr@plt>

LLVM IR (-O0):
define i8* @Memchr(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i64, i64* %6
%12 = icmp ugt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = load i64, i64* %6
%18 = call i8* @memchr(i8* %15, i32 %16, i64 %17)
ret i8* %18
}

LLVM IR (-O2):
define i8* @Memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i64 %2, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i8* @memchr(i8* %0, i32 %1, i64 %2)
ret i8* %10
}
int implies(int a, int b) {
  if (a && !b) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<implies>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <implies+0x2a>
cmpl   $0x0,-0xc(%rbp)
jne    112a <implies+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1131 <implies+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<implies>:
test   %edi,%edi
sete   %al
test   %esi,%esi
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @implies(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct feature {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ marknoteend(struct feature *);
int /*<<< orphan*/ marknotestart(struct feature *);
void marknote(struct feature *place) {
  marknotestart(place);
  marknoteend(place);
}


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

x86 assembly (clang, -O2):
<marknote>:
push   %rbx
mov    %rdi,%rbx
call   1040 <marknotestart@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <marknoteend@plt>

LLVM IR (-O0):
%struct.feature = type { i32 }
define void @marknote(%struct.feature* %0) {
%2 = alloca %struct.feature*
store %struct.feature* %0, %struct.feature** %2
%3 = load %struct.feature*, %struct.feature** %2
%4 = call i32 @marknotestart(%struct.feature* %3)
%5 = load %struct.feature*, %struct.feature** %2
%6 = call i32 @marknoteend(%struct.feature* %5)
ret void
}

LLVM IR (-O2):
%struct.feature = type { i32 }
define void @marknote(%struct.feature* %0) {
%2 = tail call i32 @marknotestart(%struct.feature* %0)
%3 = tail call i32 @marknoteend(%struct.feature* %0)
ret void
}
int instructions_million(void) {
  asm("	xor	%%ecx,%%ecx\n"
      "	mov	$499999,%%ecx\n"
      "1:\n"
      "	dec	%%ecx\n"
      "	jnz	1b\n"
      :
      :
      : "cc", "%ecx");
  return 0;
  return -1;
}


x86 assembly (clang, -O0):
<instructions_million>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    $0x7a11f,%ecx
dec    %ecx
jne    110b <instructions_million+0xb>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instructions_million>:
xor    %ecx,%ecx
mov    $0x7a11f,%ecx
dec    %ecx
jne    1107 <instructions_million+0x7>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @instructions_million() {
tail call void asm sideeffect "\09xor\09%ecx,%ecx\0A\09mov\09$$499999,%ecx\0A1:\0A\09dec\09%ecx\0A\09jnz\091b\0A", "~{cc},~{ecx},~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
int sys_addcall(void *p1) {
  int a;
  asm volatile("int $0x80" : "=a"(a) : "0"(0), "b"((int)p1));
  return a;
}


x86 assembly (clang, -O0):
<sys_addcall>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ebx
xor    %eax,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_addcall>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sys_addcall(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i32 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @sys_addcall(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %3)
ret i32 %4
}
double min_triple(double a, double b, double c) {
  double min_ab = (a < b) ? a : b;
  return (min_ab < c) ? min_ab : c;
}


x86 assembly (clang, -O0):
<min_triple>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <min_triple+0x36>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1140 <min_triple+0x40>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    116d <min_triple+0x6d>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1177 <min_triple+0x77>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_triple>:
minsd  %xmm1,%xmm0
minsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min_triple(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %4
br label %15
13: ; preds = %3
%14 = load double, double* %5
br label %15
15: ; preds = %13, %11
%16 = phi double [ %12, %11 ], [ %14, %13 ]
store double %16, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load double, double* %7
br label %24
22: ; preds = %15
%23 = load double, double* %6
br label %24
24: ; preds = %22, %20
%25 = phi double [ %21, %20 ], [ %23, %22 ]
ret double %25
}

LLVM IR (-O2):
define double @min_triple(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = select i1 %4, double %0, double %1
%6 = fcmp olt double %5, %2
%7 = select i1 %6, double %5, double %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_TYPE_PROG_ARRAY;
int bpf_create_map(int /*<<< orphan*/, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int create_prog_array(void) {
  int map_fd;
  map_fd =
      bpf_create_map(BPF_MAP_TYPE_PROG_ARRAY, sizeof(int), sizeof(int), 4, 0);
  if (map_fd < 0) {
    printf("failed to create prog_array '%s'\n", strerror(errno));
  }
  return map_fd;
}


x86 assembly (clang, -O0):
<create_prog_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <bpf_create_map@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117c <create_prog_array+0x4c>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_prog_array>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
call   1040 <bpf_create_map@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1174 <create_prog_array+0x44>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe94(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@BPF_MAP_TYPE_PROG_ARRAY = global i32 0
@.str = [34 x i8] c"failed to create prog_array '%s'\0A\00"
@errno = global i32 0
define i32 @create_prog_array() {
%1 = alloca i32
%2 = load i32, i32* @BPF_MAP_TYPE_PROG_ARRAY
%3 = call i32 @bpf_create_map(i32 %2, i32 4, i32 4, i32 4, i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@BPF_MAP_TYPE_PROG_ARRAY = global i32 0
@.str = [34 x i8] c"failed to create prog_array '%s'\0A\00"
@errno = global i32 0
define i32 @create_prog_array() {
%1 = load i32, i32* @BPF_MAP_TYPE_PROG_ARRAY
%2 = tail call i32 @bpf_create_map(i32 %1, i32 4, i32 4, i32 4, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %4, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void playOneGame(void) { printf(". . . play the game\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c". . . play the game\0A\00"
define void @playOneGame() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c". . . play the game\00"
define void @playOneGame() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void mem_issue(void) {
  printf("go fuck yourself, you and your stupid machine");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<mem_issue>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<mem_issue>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"go fuck yourself, you and your stupid machine\00"
@EXIT_FAILURE = global i32 0
define void @mem_issue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"go fuck yourself, you and your stupid machine\00"
@EXIT_FAILURE = global i32 0
define void @mem_issue() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
double tosReal_fromInt(int x) { return (double)x; }


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

x86 assembly (clang, -O2):
<tosReal_fromInt>:
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @tosReal_fromInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @tosReal_fromInt(i32 %0) {
%2 = sitofp i32 %0 to double
ret double %2
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input_number;
  scanf("%d", &input_number);
  printf("%d", is_prime(input_number));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <is_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int _is_equal_to(int cmpResult) { return (0 == cmpResult); }


x86 assembly (clang, -O0):
<_is_equal_to>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_equal_to>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @_is_equal_to(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 0, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_is_equal_to(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int pow_mod(int, int, int);
int64_t legendre_symbol(int64_t a, int64_t p) {
  int64_t x = pow_mod(a, (p - 1) / 2, p);
  if ((p - 1) == x) {
    return x - p;
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<legendre_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1030 <pow_mod@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cmp    -0x10(%rbp),%eax
jne    1159 <legendre_symbol+0x49>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <legendre_symbol+0x4f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<legendre_symbol>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
lea    -0x1(%rbx),%ebp
mov    %ebp,%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%esi
add    $0xffffffff,%esi
sar    %esi
mov    %ebx,%edx
call   1030 <pow_mod@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
cmove  %ebx,%ecx
sub    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @legendre_symbol(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @pow_mod(i32 %0, i32 %4, i32 %1)
%6 = icmp eq i32 %3, %5
%7 = select i1 %6, i32 %1, i32 0
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void zan_exit(int status) { exit(status); }


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

x86 assembly (clang, -O2):
<zan_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @zan_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __bson_uint32_swap_slow(uint32_t v) {
  return ((v & 0x000000FFU) << 24) | ((v & 0x0000FF00U) << 8) |
         ((v & 0x00FF0000U) >> 8) | ((v & 0xFF000000U) >> 24);
}


x86 assembly (clang, -O0):
<__bson_uint32_swap_slow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__bson_uint32_swap_slow(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @__bson_uint32_swap_slow(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ re_match(char const *, char *);
int validate_no_bash_special(const char *str) {
  if (!str)
    return 0;
  return (!re_match(str, "[;&\"'`!$><|]"));
}


x86 assembly (clang, -O0):
<validate_no_bash_special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <validate_no_bash_special+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1153 <validate_no_bash_special+0x43>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <re_match@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_no_bash_special>:
test   %rdi,%rdi
je     1130 <validate_no_bash_special+0x20>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <re_match@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"[;&\22'`!$><|]\00"
define i32 @validate_no_bash_special(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @re_match(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"[;&\22'`!$><|]\00"
define i32 @validate_no_bash_special(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @re_match(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void jac_chain_nm3_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @jac_chain_nm3_decref() {
ret void
}
void gtk_clipboard_request_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_request_text() {
ret void
}
int test_imm_12int32_mem(int *val) {
  return ((*val) & (0x12 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_12int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 18
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct Array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printArray(struct Array *);
struct Array *readArrayFromFile();
int main(void) {
  struct Array *a = readArrayFromFile();
  printArray(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <readArrayFromFile@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <readArrayFromFile@plt>
mov    %rax,%rdi
call   1040 <printArray@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Array = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Array*
store i32 0, i32* %1
%3 = call %struct.Array* (...) @readArrayFromFile()
store %struct.Array* %3, %struct.Array** %2
%4 = load %struct.Array*, %struct.Array** %2
%5 = call i32 @printArray(%struct.Array* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.Array = type { i32 }
define i32 @main() {
%1 = tail call %struct.Array* (...) @readArrayFromFile()
%2 = tail call i32 @printArray(%struct.Array* %1)
ret i32 0
}