xunge/DecIR huggingface dataset:
/* Variables and functions */
int dup2(int, int);
int c_dup2(int oldfd, int newfd) { return dup2(oldfd, newfd); }


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

x86 assembly (clang, -O2):
<c_dup2>:
jmp    1030 <dup2@plt>

LLVM IR (-O0):
define i32 @c_dup2(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 = call i32 @dup2(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @c_dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *f(char *);
int main() {
  char *a = "foo";
  a = f("bar");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = tail call i8* @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
double sqrt(double x) {
  __asm__("sqrtsd %1, %0" : "=x"(x) : "x"(x));
  return x;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
sqrtsd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
sqrtsd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm "sqrtsd $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double asm "sqrtsd $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
int fun1140() { return 1140; }


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

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

LLVM IR (-O0):
define i32 @fun1140() {
ret i32 1140
}

LLVM IR (-O2):
define i32 @fun1140() {
ret i32 1140
}
/* Type definitions */
struct dyn_string {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ds_append_string(struct dyn_string *, char *);
struct dyn_string *ds_get();
struct dyn_string *ds_get_string(char *str) {
  struct dyn_string *string = ds_get();
  ds_append_string(string, str);
  return string;
}


x86 assembly (clang, -O0):
<ds_get_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ds_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ds_append_string@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_get_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <ds_get@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ds_append_string@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dyn_string = type { i32 }
define %struct.dyn_string* @ds_get_string(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.dyn_string*
store i8* %0, i8** %2
%4 = call %struct.dyn_string* (...) @ds_get()
store %struct.dyn_string* %4, %struct.dyn_string** %3
%5 = load %struct.dyn_string*, %struct.dyn_string** %3
%6 = load i8*, i8** %2
%7 = call i32 @ds_append_string(%struct.dyn_string* %5, i8* %6)
%8 = load %struct.dyn_string*, %struct.dyn_string** %3
ret %struct.dyn_string* %8
}

LLVM IR (-O2):
%struct.dyn_string = type { i32 }
define %struct.dyn_string* @ds_get_string(i8* %0) {
%2 = tail call %struct.dyn_string* (...) @ds_get()
%3 = tail call i32 @ds_append_string(%struct.dyn_string* %2, i8* %0)
ret %struct.dyn_string* %2
}
void znop(void) {}


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

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

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

LLVM IR (-O2):
define void @znop() {
ret void
}
void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.ctrl_iface_priv = type opaque
define void @wpa_supplicant_ctrl_iface_deinit(%struct.ctrl_iface_priv* nocapture %0) {
ret void
}
int cf(register const char *s1, register const char *s2) {
  while (*s1++ == *s2) {
    if (*s2++ == 0) {
      return (0);
      ;
    };
  }
  return (*--s1 - *s2);
}


x86 assembly (clang, -O0):
<cf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <cf+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <cf+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <cf+0x78>
jmp    110c <cf+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <cf+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <cf+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cf(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %22, %2
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %10, %13
br i1 %14, label %15, label %23
15: ; preds = %6
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 0, i32* %3
br label %32
22: ; preds = %15
br label %6
23: ; preds = %6
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 -1
store i8* %25, i8** %4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = load i8*, i8** %5
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %27, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %23, %21
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @cf(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %10, %9 ]
%5 = phi i8* [ %1, %2 ], [ %11, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %7 to i32
%15 = sext i8 %6 to i32
%16 = sub nsw i32 %15, %14
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int strcasecmp(char *, char *);
int main() { return strcasecmp("", ""); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @strcasecmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509_TRUSTED;
scalar_t__ i2d_X509_AUX;
int PEM_write_X509_AUX(FILE *fp, X509 *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_X509_AUX, PEM_STRING_X509_TRUSTED,
                        fp, x, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_X509_AUX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_X509_AUX>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509_AUX = global i64 0
@PEM_STRING_X509_TRUSTED = global i32 0
define i32 @PEM_write_X509_AUX(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509_AUX
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_TRUSTED
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509_AUX = global i64 0
@PEM_STRING_X509_TRUSTED = global i32 0
define i32 @PEM_write_X509_AUX(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509_AUX
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509_TRUSTED
%6 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
int putchar(int ic) { return ic; }


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, int *);
long sum2recur(int, int);
int main() {
  int n;
  long result;
  scanf("%d", &n);
  result = sum2recur(n, 10);
  printf("Sum = %ld\n", result);
  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   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
call   1050 <sum2recur@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0xa,%esi
call   1050 <sum2recur@plt>
lea    0xeac(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\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 i64 @sum2recur(i32 %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int ndb_cif_next_datablock();
int /*<<< orphan*/ ndb_cif_reset_datablock();
int ndb_cif_rewind_datablock();
int ndb_cif_reset_datablocks() {
  int ret;
  ret = ndb_cif_rewind_datablock();
  while (ret) {
    ret = ndb_cif_next_datablock();
    if (ret)
      ndb_cif_reset_datablock();
  }
  return ret;
}


x86 assembly (clang, -O0):
<ndb_cif_reset_datablocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ndb_cif_rewind_datablock@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <ndb_cif_reset_datablocks+0x3c>
mov    $0x0,%al
call   1050 <ndb_cif_next_datablock@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1167 <ndb_cif_reset_datablocks+0x37>
mov    $0x0,%al
call   1030 <ndb_cif_reset_datablock@plt>
jmp    1142 <ndb_cif_reset_datablocks+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_cif_reset_datablocks>:
push   %rax
xor    %eax,%eax
call   1040 <ndb_cif_rewind_datablock@plt>
test   %eax,%eax
je     1154 <ndb_cif_reset_datablocks+0x24>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <ndb_cif_next_datablock@plt>
test   %eax,%eax
je     1154 <ndb_cif_reset_datablocks+0x24>
xor    %eax,%eax
call   1030 <ndb_cif_reset_datablock@plt>
jmp    1140 <ndb_cif_reset_datablocks+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ndb_cif_reset_datablocks() {
%1 = tail call i32 (...) @ndb_cif_rewind_datablock()
%2 = icmp eq i32 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @ndb_cif_next_datablock()
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = tail call i32 (...) @ndb_cif_reset_datablock()
%8 = tail call i32 (...) @ndb_cif_next_datablock()
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %3, %0
ret i32 0
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void sem_signal(int semid, int val) {
  struct sembuf semaphore;
  semaphore.sem_num = 0;
  semaphore.sem_op = val;
  semaphore.sem_flg = 1;
  semop(semid, &semaphore, 1);
}


x86 assembly (clang, -O0):
<sem_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_signal>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    %esi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @sem_signal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 1, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @sem_signal(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cf(void *a, void *b) { return strcmp((const char *)a, (const char *)b); }


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

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

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

LLVM IR (-O2):
define i32 @cf(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void puthex_ll(unsigned long value) {}


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

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

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

LLVM IR (-O2):
define void @puthex_ll(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int distance = 100;
  int test = 200;
  printf("You are %d miles away %d\n", distance, test);
  printf("Hello world\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0xc8,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"You are %d miles away %d\0A\00"
@.str.1 = [13 x i8] c"Hello world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
store i32 200, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"You are %d miles away %d\0A\00"
@str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 100, i32 200)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void addReplySds(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               29, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<addReplySds>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1d,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReplySds>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x1d,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplySds = [12 x i8] c"addReplySds\00"
define void @addReplySds() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.addReplySds, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplySds = [12 x i8] c"addReplySds\00"
define void @addReplySds() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.addReplySds, i64 0, i64 0))
ret void
}
unsigned int fn3(unsigned int a) { return a >> ~6; }


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff9,%ecx
shr    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_quaddobl_set_continuation_parameter(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(877, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_quaddobl_set_continuation_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x36d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_quaddobl_set_continuation_parameter>:
mov    $0x36d,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_quaddobl_set_continuation_parameter() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 877, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_quaddobl_set_continuation_parameter() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 877, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int regulator_set_mode(struct regulator *regulator, unsigned int mode) {
  return 0;
}


x86 assembly (clang, -O0):
<regulator_set_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.regulator = type opaque
define i32 @regulator_set_mode(%struct.regulator* %0, i32 %1) {
%3 = alloca %struct.regulator*
%4 = alloca i32
store %struct.regulator* %0, %struct.regulator** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.regulator = type opaque
define i32 @regulator_set_mode(%struct.regulator* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void free_page(unsigned long page) { assert(0); }


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

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

LLVM IR (-O0):
define void @free_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @free_page(i64 %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void restoreColors() { printf("\033[0m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @restoreColors() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @restoreColors() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ izbaci_rijec(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[] = "Azer voli lijepe cure";
  izbaci_rijec(s, 4);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <izbaci_rijec@plt>
lea    -0x20(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x65727563206570,%rax
mov    %rax,0xe(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <izbaci_rijec@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [22 x i8] c"Azer voli lijepe cure\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [22 x i8]
store i32 0, i32* %1
%3 = bitcast [22 x i8]* %2 to i8*
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%5 = call i32 @izbaci_rijec(i8* %4, i32 4)
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [22 x i8] c"Azer voli lijepe cure\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = call i32 @izbaci_rijec(i8* %2, i32 4)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int isLeap(int);
int yearLength(int year) {
  if (year == 1582)
    return 355;
  else
    return 365 + isLeap(year);
}


x86 assembly (clang, -O0):
<yearLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x62e,-0x8(%rbp)
jne    1134 <yearLength+0x24>
movl   $0x163,-0x4(%rbp)
jmp    1144 <yearLength+0x34>
mov    -0x8(%rbp),%edi
call   1030 <isLeap@plt>
add    $0x16d,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yearLength>:
mov    $0x163,%eax
cmp    $0x62e,%edi
je     112c <yearLength+0x1c>
push   %rax
call   1030 <isLeap@plt>
add    $0x16d,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @yearLength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1582
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 355, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @isLeap(i32 %8)
%10 = add nsw i32 365, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @yearLength(i32 %0) {
%2 = icmp eq i32 %0, 1582
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @isLeap(i32 %0)
%5 = add nsw i32 %4, 365
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 355, %1 ]
ret i32 %7
}
/* Variables and functions */
float __ocml_sinh_f32(float);
float sinhf(float x) { return __ocml_sinh_f32(x); }


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

x86 assembly (clang, -O2):
<sinhf>:
jmp    1030 <__ocml_sinh_f32@plt>

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

LLVM IR (-O2):
define float @sinhf(float %0) {
%2 = tail call float @__ocml_sinh_f32(float %0)
ret float %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int LSAPI_CreateListenSock2(struct sockaddr *, int);
int LSAPI_ParseSockAddr(char const *, struct sockaddr *);
int LSAPI_CreateListenSock(const char *pBind, int backlog) {
  char serverAddr[128];
  int ret;
  int fd = -1;
  ret = LSAPI_ParseSockAddr(pBind, (struct sockaddr *)serverAddr);
  if (!ret) {
    fd = LSAPI_CreateListenSock2((struct sockaddr *)serverAddr, backlog);
  }
  return fd;
}


x86 assembly (clang, -O0):
<LSAPI_CreateListenSock>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x98(%rbp)
ff ff ff
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <LSAPI_ParseSockAddr@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
jne    1174 <LSAPI_CreateListenSock+0x54>
lea    -0x90(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <LSAPI_CreateListenSock2@plt>
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSAPI_CreateListenSock>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ebx
mov    %rsp,%rsi
call   1030 <LSAPI_ParseSockAddr@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    1147 <LSAPI_CreateListenSock+0x27>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1040 <LSAPI_CreateListenSock2@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @LSAPI_CreateListenSock(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [128 x i8]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 -1, i32* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = bitcast i8* %9 to %struct.sockaddr*
%11 = call i32 @LSAPI_ParseSockAddr(i8* %8, %struct.sockaddr* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %2
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%16 = bitcast i8* %15 to %struct.sockaddr*
%17 = load i32, i32* %4
%18 = call i32 @LSAPI_CreateListenSock2(%struct.sockaddr* %16, i32 %17)
store i32 %18, i32* %7
br label %19
19: ; preds = %14, %2
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @LSAPI_CreateListenSock(i8* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = bitcast [128 x i8]* %3 to %struct.sockaddr*
%6 = call i32 @LSAPI_ParseSockAddr(i8* %0, %struct.sockaddr* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @LSAPI_CreateListenSock2(%struct.sockaddr* %5, i32 %1)
br label %10
10: ; preds = %8, %2
%11 = phi i32 [ -1, %2 ], [ %9, %8 ]
ret i32 %11
}
void test_unusual_order() { int unsigned auto *const *const a; }


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

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

LLVM IR (-O0):
define void @test_unusual_order() {
%1 = alloca i32**
ret void
}

LLVM IR (-O2):
define void @test_unusual_order() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPopAttrib();
void highlightEnd(void) { glPopAttrib(); }


x86 assembly (clang, -O0):
<highlightEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <glPopAttrib@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<highlightEnd>:
xor    %eax,%eax
jmp    1030 <glPopAttrib@plt>

LLVM IR (-O0):
define void @highlightEnd() {
%1 = call i32 (...) @glPopAttrib()
ret void
}

LLVM IR (-O2):
define void @highlightEnd() {
%1 = tail call i32 (...) @glPopAttrib()
ret void
}
int main() {
#pragma critTer : 610 :../ test / resources / fileLength.c:
#pragma critTer : 611 :../ test / resources / fileLength.c:
#pragma critTer : 612 :../ test / resources / fileLength.c:
#pragma critTer : 613 :../ test / resources / fileLength.c:
#pragma critTer : 614 :../ test / resources / fileLength.c:
#pragma critTer : 615 :../ test / resources / fileLength.c:
#pragma critTer : 616 :../ test / resources / fileLength.c:
  return 0;
#pragma critTer : 617 :../ test / resources / fileLength.c:
#pragma critTer : 618 :../ test / resources / fileLength.c:
#pragma critTer : 619 :../ test / resources / fileLength.c:
#pragma critTer : 620 :../ test / resources / fileLength.c:
#pragma critTer : 621 :../ test / resources / fileLength.c:
#pragma critTer : 622 :../ test / resources / fileLength.c:
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_30int64_midword_reg(long long val) {
  return ((val >> 16) & (0x30 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_30int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x30,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_30int64_midword_reg>:
test   $0x300000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_30int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 48
%6 = icmp ne i64 %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_30int64_midword_reg(i64 %0) {
%2 = and i64 %0, 3145728
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter a number\n");
  scanf("%d", &a);
  if (a < 0) {
    printf("Enter a non negative number\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1161 <main+0x41>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jns    1151 <main+0x31>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Enter a non negative number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [15 x i8] c"Enter a number\00"
@str.3 = [28 x i8] c"Enter a non negative number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret i32 0
}
void g_child_watch_add_full() {}


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

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

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

LLVM IR (-O2):
define void @g_child_watch_add_full() {
ret void
}
int sendwho(int usern) { return 0x0; }


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

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

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

LLVM IR (-O2):
define i32 @sendwho(i32 %0) {
ret i32 0
}
void UARTTxIntModeSet(unsigned long ulBase, unsigned long ulMode) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) =
      (((*((volatile unsigned long *)(ulBase + 0x00000030))) &
        ~(0x00000010 | 0x00000000)) |
       ulMode);
}


x86 assembly (clang, -O0):
<UARTTxIntModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xffffffffffffffef,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTTxIntModeSet>:
mov    0x30(%rdi),%rax
and    $0xffffffffffffffef,%rax
or     %rsi,%rax
mov    %rax,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTTxIntModeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 48
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -17
%10 = load i64, i64* %4
%11 = or i64 %9, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 48
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @UARTTxIntModeSet(i64 %0, i64 %1) {
%3 = add i64 %0, 48
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -17
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
void rop3_8_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_8_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_8_1_0>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_8_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
intmax_t imaxabs(intmax_t _j) { return _j >= 0 ? _j : -_j; }


x86 assembly (clang, -O0):
<imaxabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <imaxabs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <imaxabs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @imaxabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void McASPTxFrameSyncCfg(unsigned int baseAddr, unsigned int fsMode,
                         unsigned int fsWidth, unsigned int fsSetting) {
  (*((volatile unsigned int *)(baseAddr + (0xAC)))) =
      ((fsMode << (0x00000007u)) | fsWidth | fsSetting);
}


x86 assembly (clang, -O0):
<McASPTxFrameSyncCfg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x7,%ecx
or     -0xc(%rbp),%ecx
or     -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xac,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPTxFrameSyncCfg>:
shl    $0x7,%esi
or     %ecx,%edx
or     %esi,%edx
add    $0xac,%edi
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @McASPTxFrameSyncCfg(i32 %0, i32 %1, i32 %2, i32 %3) {
%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
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = shl i32 %9, 7
%11 = load i32, i32* %7
%12 = or i32 %10, %11
%13 = load i32, i32* %8
%14 = or i32 %12, %13
%15 = load i32, i32* %5
%16 = add i32 %15, 172
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @McASPTxFrameSyncCfg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 7
%6 = or i32 %5, %2
%7 = or i32 %6, %3
%8 = add i32 %0, 172
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %7, i32* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_group_mod_command_print(int /*<<< orphan*/ *,
                                               int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_group_mod_command_to_string(uint16_t command) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_group_mod_command_print(stream, command);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_group_mod_command_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <ofl_group_mod_command_print@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_group_mod_command_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ofl_group_mod_command_print@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_group_mod_command_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_group_mod_command_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_group_mod_command_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_group_mod_command_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}