xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int read(int, unsigned int *, int);
unsigned int rand_urandom(void) {
  int fd;
  unsigned int r = 0;
  if ((fd = open("/dev/urandom", O_RDONLY)) != -1) {
    if (read(fd, &r, sizeof r) == -1)
      r = 0;
    close(fd);
  }
  return r;
}


x86 assembly (clang, -O0):
<rand_urandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
je     1189 <rand_urandom+0x59>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
cmp    $0xffffffff,%eax
jne    1181 <rand_urandom+0x51>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_urandom>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     117c <rand_urandom+0x4c>
mov    %eax,%ebx
lea    0x4(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
je     1173 <rand_urandom+0x43>
mov    0x4(%rsp),%ebp
mov    %ebx,%edi
call   1030 <close@plt>
jmp    117e <rand_urandom+0x4e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @rand_urandom() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = call i32 @read(i32 %4, i32* %1, i32 4)
%8 = icmp eq i32 %7, -1
%9 = load i32, i32* %1
%10 = select i1 %8, i32 0, i32 %9
%11 = tail call i32 @close(i32 %4)
br label %12
12: ; preds = %6, %0
%13 = phi i32 [ %10, %6 ], [ 0, %0 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t clock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ killnl(char *);
int /*<<< orphan*/ sscanf(char *, char *, unsigned long *);
void setPI(char *buf, unsigned long *pos, char **ifa) {
  sscanf(buf, "%08ld", pos);
  *ifa = buf + 9;
  killnl(buf + 9);
}


x86 assembly (clang, -O0):
<setPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <sscanf@plt>
mov    -0x8(%rbp),%rcx
add    $0x9,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x9,%rdi
call   1040 <killnl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPI>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
call   1030 <sscanf@plt>
add    $0x9,%rbx
mov    %rbx,(%r14)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <killnl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%08ld\00"
define void @setPI(i8* %0, i64* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i8**
store i8* %0, i8** %4
store i64* %1, i64** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i64*, i64** %5
%9 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 9
%12 = load i8**, i8*** %6
store i8* %11, i8** %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 9
%15 = call i32 @killnl(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08ld\00"
define void @setPI(i8* %0, i64* %1, i8** nocapture writeonly %2) {
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %1)
%5 = getelementptr inbounds i8, i8* %0, i64 9
store i8* %5, i8** %2
%6 = tail call i32 @killnl(i8* %5)
ret void
}
int updatebit(int num, int i, int v) {
  int mask = ~(1 << i);
  return (num & mask) | (v << i);
}


x86 assembly (clang, -O0):
<updatebit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<updatebit>:
mov    %edx,%eax
mov    %esi,%ecx
btr    %esi,%edi
shl    %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @updatebit(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = shl i32 1, %8
%10 = xor i32 %9, -1
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %7
%13 = and i32 %11, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = shl i32 %14, %15
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @updatebit(i32 %0, i32 %1, i32 %2) {
%4 = shl nuw i32 1, %1
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = shl i32 %2, %1
%8 = or i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  short s = 0x0102;
  char *c = (char *)&s;
  ;
  if (*c == 0x02)
    printf("little\n");
  else if (*c == 0x01)
    printf("big\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x102,-0x6(%rbp)
lea    -0x6(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
jne    114e <main+0x3e>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    116a <main+0x5a>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x5f>
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 = [8 x i8] c"little\0A\00"
@.str.1 = [5 x i8] c"big\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i8*
store i32 0, i32* %1
store i16 258, i16* %2
%4 = bitcast i16* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %19
11: ; preds = %0
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
br label %19
19: ; preds = %18, %9
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"little\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
main(void) {
  int i;
  unsigned u;
  i = 1;
  i = -1;
  i = -1l;
  i = -1u;
  i = -1ll;
  i = 32766 + 1 & 3;
  i = (int)32768 < 0;
  i = -1u < 0;
  u = 1;
  u = -1;
  u = -1l;
  u = -1u;
  u = -1ll;
  u = (unsigned)32768 < 0;
  u = 32766 + 1 & 3;
  u = -1u < 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0xc(%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
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 -1, i32* %2
store i32 -1, i32* %2
store i32 -1, i32* %2
store i32 -1, i32* %2
store i32 3, i32* %2
store i32 0, i32* %2
store i32 0, i32* %2
store i32 1, i32* %3
store i32 -1, i32* %3
store i32 -1, i32* %3
store i32 -1, i32* %3
store i32 -1, i32* %3
store i32 0, i32* %3
store i32 3, i32* %3
store i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run_cmd(char *, char *, char const *, char *);
void remove_tempdir(const char *tempdir) {
  run_cmd("rm", "-rf", tempdir, (char *)NULL);
}


x86 assembly (clang, -O0):
<remove_tempdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <run_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_tempdir>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee2(%rip),%rsi
xor    %ecx,%ecx
jmp    1030 <run_cmd@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rm\00"
@.str.1 = [4 x i8] c"-rf\00"
define void @remove_tempdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @run_cmd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* null)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"rm\00"
@.str.1 = [4 x i8] c"-rf\00"
define void @remove_tempdir(i8* %0) {
%2 = tail call i32 @run_cmd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeFile(FILE *file) { fclose(file); }


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

x86 assembly (clang, -O2):
<closeFile>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @closeFile(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Type definitions */
struct DList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlistCons(struct DList *const, void *);
void dlistInsertAtHead(struct DList *const dlist, void *data) {
  dlistCons(dlist, data);
}


x86 assembly (clang, -O0):
<dlistInsertAtHead>:
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 <dlistCons@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlistInsertAtHead>:
jmp    1030 <dlistCons@plt>

LLVM IR (-O0):
%struct.DList = type { i32 }
define void @dlistInsertAtHead(%struct.DList* %0, i8* %1) {
%3 = alloca %struct.DList*
%4 = alloca i8*
store %struct.DList* %0, %struct.DList** %3
store i8* %1, i8** %4
%5 = load %struct.DList*, %struct.DList** %3
%6 = load i8*, i8** %4
%7 = call i32 @dlistCons(%struct.DList* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.DList = type { i32 }
define void @dlistInsertAtHead(%struct.DList* %0, i8* %1) {
%3 = tail call i32 @dlistCons(%struct.DList* %0, i8* %1)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned long out(struct timeval i) {
  struct timeval o;
  gettimeofday(&o, 0);
  return (o.tv_sec - i.tv_sec) * 1000000 + o.tv_usec - i.tv_usec;
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
cltq
add    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
movslq %ebp,%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rcx
mov    0x10(%rsp),%rax
sub    %rbx,%rax
add    %rcx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @out(i32 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to { i32, i64 }*
%6 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %5, i32 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
%14 = mul nsw i32 %13, 1000000
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%17 = load i64, i64* %16
%18 = add i64 %15, %17
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%20 = load i64, i64* %19
%21 = sub i64 %18, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @out(i32 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sub nsw i32 %7, %0
%9 = mul nsw i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%12 = load i64, i64* %11
%13 = sub i64 %12, %1
%14 = add i64 %13, %10
ret i64 %14
}
int _strlen(char *s) {
  int i = 0;
  while (*s != '\0') {
    i++;
    s++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <_strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
cmpb   $0x0,(%rdi)
je     111c <_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int ld_lt_rc1(long double a1) { return (((a1) < (100))); }


x86 assembly (clang, -O0):
<ld_lt_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_lt_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_lt_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_lt_rc1(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSupportsLocale() {
  printf("XSupportsLocale called\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"XSupportsLocale called\00"
define i32 @XSupportsLocale() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ inc(long *);
int /*<<< orphan*/ printf(char *, long);
void main() {
  long a;
  a = 8;
  printf("a=%d\n", a);
  inc(&a);
  printf("a=%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <inc@plt>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x8,0x8(%rsp)
lea    0xecb(%rip),%rbx
mov    $0x8,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <inc@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"a=%d\0A\00"
define void @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 8, i64* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 8)
%4 = call i32 @inc(i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_126() {
  Assert_real((isqrt(126) == 11),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              635, ("Integer square root of 126 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_126>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x27b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_126>:
push   %rax
mov    $0x7e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x27b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 126 should be 11\00"
define void @t_sqrt_126() {
%1 = call i32 @isqrt(i32 126)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 126 should be 11\00"
define void @t_sqrt_126() {
%1 = tail call i32 @isqrt(i32 126)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int overlap_compare(int x) {
  if (x == -1 && x > 5)
    return 1;
  return 2;
}


x86 assembly (clang, -O0):
<overlap_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1127 <overlap_compare+0x27>
cmpl   $0x5,-0x8(%rbp)
jle    1127 <overlap_compare+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <overlap_compare+0x2e>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @overlap_compare(i32 %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ mod_stack(double);
void grow_stack() { mod_stack(1.25); }


x86 assembly (clang, -O0):
<grow_stack>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <mod_stack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow_stack>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <mod_stack@plt>

LLVM IR (-O0):
define void @grow_stack() {
%1 = call i32 @mod_stack(double 1.250000e+00)
ret void
}

LLVM IR (-O2):
define void @grow_stack() {
%1 = tail call i32 @mod_stack(double 1.250000e+00)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s) {
  int len = strlen(s) + 1;
  char *new_str = (char *)malloc(len);
  if (new_str)
    strcpy(new_str, s);
  return new_str;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116f <strdup+0x3f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %1
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Teapot_LowLevel_SetMvMatrixUniform(float const *);
void Teapot_LowLevel_SetMvMatrixUniformFloat(const float mvMatrix[16]) {
  Teapot_LowLevel_SetMvMatrixUniform(mvMatrix);
}


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

x86 assembly (clang, -O2):
<Teapot_LowLevel_SetMvMatrixUniformFloat>:
jmp    1030 <Teapot_LowLevel_SetMvMatrixUniform@plt>

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

LLVM IR (-O2):
define void @Teapot_LowLevel_SetMvMatrixUniformFloat(float* %0) {
%2 = tail call i32 @Teapot_LowLevel_SetMvMatrixUniform(float* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t rsbl123(uint64_t x) { return 123 - x; }


x86 assembly (clang, -O0):
<rsbl123>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x7b,%eax
sub    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsbl123>:
mov    $0x7b,%eax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @rsbl123(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 123, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @rsbl123(i64 %0) {
%2 = sub nsw i64 123, %0
ret i64 %2
}
void coherent_ht_mainboard(unsigned cpus) {}


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

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

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

LLVM IR (-O2):
define void @coherent_ht_mainboard(i32 %0) {
ret void
}
void BN_pseudo_rand(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_pseudo_rand() {
ret void
}
float GeometryImplicit(float NdotL, float NdotV) { return NdotL * NdotV; }


x86 assembly (clang, -O0):
<GeometryImplicit>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeometryImplicit>:
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @GeometryImplicit(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ replace_char(char *, char, char);
void niceChannel(char *value) {
  replace_char(value, ' ', '\0');
  replace_char(value, ';', ':');
}


x86 assembly (clang, -O0):
<niceChannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
call   1030 <replace_char@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3b,%esi
mov    $0x3a,%edx
call   1030 <replace_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<niceChannel>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%esi
xor    %edx,%edx
call   1030 <replace_char@plt>
mov    %rbx,%rdi
mov    $0x3b,%esi
mov    $0x3a,%edx
pop    %rbx
jmp    1030 <replace_char@plt>

LLVM IR (-O0):
define void @niceChannel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @replace_char(i8* %3, i8 signext 32, i8 signext 0)
%5 = load i8*, i8** %2
%6 = call i32 @replace_char(i8* %5, i8 signext 59, i8 signext 58)
ret void
}

LLVM IR (-O2):
define void @niceChannel(i8* %0) {
%2 = tail call i32 @replace_char(i8* %0, i8 signext 32, i8 signext 0)
%3 = tail call i32 @replace_char(i8* %0, i8 signext 59, i8 signext 58)
ret void
}
/* Variables and functions */
void *a_thread_func() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @a_thread_func() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @a_thread_func() {
ret i8* null
}
void while_statment(void *flag) {
  while (flag) {
    break;
  }
}


x86 assembly (clang, -O0):
<while_statment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <while_statment+0x18>
jmp    1118 <while_statment+0x18>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @while_statment(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int embed_standard_Laurent_system(int d) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(625, &d, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<embed_standard_Laurent_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x271,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @embed_standard_Laurent_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 625, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void movsx_reg32_16preg64preg64(int reg1, int reg2, int reg3) {
  put8(0x0F);
  put8(0xBF);
  put8((reg1 << 3) | 0x04);
  put8((reg2 << 3) | reg3);
}


x86 assembly (clang, -O0):
<movsx_reg32_16preg64preg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x4,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     -0xc(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_16preg64preg64>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
lea    0x4(,%rbx,8),%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %r14d,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @movsx_reg32_16preg64preg64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 15)
%8 = call i32 @put8(i32 191)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = or i32 %10, 4
%12 = call i32 @put8(i32 %11)
%13 = load i32, i32* %5
%14 = shl i32 %13, 3
%15 = load i32, i32* %6
%16 = or i32 %14, %15
%17 = call i32 @put8(i32 %16)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_16preg64preg64(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 15)
%5 = tail call i32 @put8(i32 191)
%6 = shl i32 %0, 3
%7 = or i32 %6, 4
%8 = tail call i32 @put8(i32 %7)
%9 = shl i32 %1, 3
%10 = or i32 %9, %2
%11 = tail call i32 @put8(i32 %10)
ret void
}
int f(int x) { int y$1; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double pow(double, int);
double area_circle(double diametet) { return 3.14159 * pow((diametet / 2), 2); }


x86 assembly (clang, -O0):
<area_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_circle>:
push   %rax
mulsd  0xee7(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @area_circle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+00
%5 = call double @pow(double %4, i32 2)
%6 = fmul double 3.141590e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @area_circle(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = tail call double @pow(double %2, i32 2)
%4 = fmul double %3, 3.141590e+00
ret double %4
}
void gdk_display_store_clipboard() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_store_clipboard() {
ret void
}
_Bool hxd_isspace(unsigned char chr, _Bool nlok) {
  static const unsigned char space[] = {
      ['\t'] = 1, ['\n'] = 1, ['\v'] = 1, ['\r'] = 1, ['\f'] = 1, [' '] = 1,
  };
  return (chr < sizeof space && space[chr] && (nlok || chr != '\n'));
}


x86 assembly (clang, -O0):
<hxd_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x21,%rcx
mov    %al,-0x3(%rbp)
jae    1168 <hxd_isspace+0x68>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
lea    0xecc(%rip),%rax
movzbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
je     1168 <hxd_isspace+0x68>
mov    $0x1,%al
testb  $0x1,-0x2(%rbp)
mov    %al,-0x4(%rbp)
jne    1162 <hxd_isspace+0x62>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hxd_isspace>:
cmp    $0x20,%dil
ja     1120 <hxd_isspace+0x20>
movzbl %dil,%eax
mov    $0xffffc1ff,%ecx
bt     %rax,%rcx
jb     1120 <hxd_isspace+0x20>
cmp    $0xa,%dil
setne  %al
or     %sil,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@hxd_isspace.space = internal constant [33 x i8] c"\00\00\00\00\00\00\00\00\00\01\01\01\01\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01"
define zeroext i1 @hxd_isspace(i8 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = zext i1 %1 to i8
store i8 %5, i8* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i64
%8 = icmp ult i64 %7, 33
br i1 %8, label %9, label %25
9: ; preds = %2
%10 = load i8, i8* %3
%11 = zext i8 %10 to i64
%12 = getelementptr inbounds [33 x i8], [33 x i8]* @hxd_isspace.space, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %9
%17 = load i8, i8* %4
%18 = trunc i8 %17 to i1
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = load i8, i8* %3
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %21, 10
br label %23
23: ; preds = %19, %16
%24 = phi i1 [ true, %16 ], [ %22, %19 ]
br label %25
25: ; preds = %23, %9, %2
%26 = phi i1 [ false, %9 ], [ false, %2 ], [ %24, %23 ]
ret i1 %26
}

LLVM IR (-O2):
define zeroext i1 @hxd_isspace(i8 zeroext %0, i1 zeroext %1) {
%3 = icmp ult i8 %0, 33
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i8 %0 to i64
%6 = lshr i64 4294951423, %5
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = icmp ne i8 %0, 10
%11 = or i1 %10, %1
br label %12
12: ; preds = %9, %4, %2
%13 = phi i1 [ false, %4 ], [ false, %2 ], [ %11, %9 ]
ret i1 %13
}
int test_imm_1Bint8_reg(signed char val) {
  return ((val) & (-0x1B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffe5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Bint8_reg>:
test   $0xe5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Bint8_reg(i8 signext %0) {
%2 = and i8 %0, -27
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
struct ifreq *__if_nextreq(struct ifreq *ifr) {
  return ifr + 1;
}


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

x86 assembly (clang, -O2):
<__if_nextreq>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
%struct.ifreq = type { i32 }
define %struct.ifreq* @__if_nextreq(%struct.ifreq* %0) {
%2 = alloca %struct.ifreq*
store %struct.ifreq* %0, %struct.ifreq** %2
%3 = load %struct.ifreq*, %struct.ifreq** %2
%4 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %3, i64 1
ret %struct.ifreq* %4
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
define %struct.ifreq* @__if_nextreq(%struct.ifreq* readnone %0) {
%2 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %0, i64 1
ret %struct.ifreq* %2
}
void INT_Excep_MTU1_TGIV1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU1_TGIV1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  i = 1 + 2 + 3;
  i = i + i;
  printf("i = %i\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"i = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
char *skip_spaces(char *str) {
  for (; *str == ' '; str++)
    ;
  return str;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    112e <skip_spaces+0x2e>
jmp    111d <skip_spaces+0x1d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_spaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <skip_spaces+0x10>
ret

LLVM IR (-O0):
define i8* @skip_spaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %12
8: ; preds = %3
br label %9
9: ; preds = %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *append3(char const *, char *, char const *);
scalar_t__ check_file_exists(char *);
scalar_t__ check_not_directory(char *);
unsigned int check_file_in_dir(const char *fn, const char *dir, char *buff) {
  buff = append3(dir, "/", fn);
  return check_file_exists(buff) && check_not_directory(buff);
}


x86 assembly (clang, -O0):
<check_file_in_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xead(%rip),%rsi
call   1050 <append3@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <check_file_exists@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     118a <check_file_in_dir+0x5a>
mov    -0x18(%rbp),%rdi
call   1030 <check_not_directory@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_in_dir>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xec2(%rip),%rsi
mov    %rax,%rdi
call   1050 <append3@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <check_file_exists@plt>
test   %rax,%rax
je     116b <check_file_in_dir+0x3b>
mov    %rbx,%rdi
call   1030 <check_not_directory@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i32 @check_file_in_dir(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @append3(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i64 @check_file_exists(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i64 @check_not_directory(i8* %14)
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %13, %3
%18 = phi i1 [ false, %3 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @check_file_in_dir(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i8* @append3(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i64 @check_file_exists(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i64 @check_not_directory(i8* %4)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ 0, %3 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
void *contract_non_null(void const *, char const *, char const *, int,
                        char const *, char *);
void *_contract_invariant_non_null(const void *x, const char *x_s,
                                   const char *file, int line,
                                   const char *func) {
  return contract_non_null(x, x_s, file, line, func,
                           "%s:%d: %s: Invariant `%s' != NULL failed.\n");
}


x86 assembly (clang, -O0):
<_contract_invariant_non_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
lea    0xebb(%rip),%r9
call   1030 <contract_non_null@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_contract_invariant_non_null>:
lea    0xee9(%rip),%r9
jmp    1030 <contract_non_null@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"%s:%d: %s: Invariant `%s' != NULL failed.\0A\00"
define i8* @_contract_invariant_non_null(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i8* @contract_non_null(i8* %11, i8* %12, i8* %13, i32 %14, i8* %15, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i8* %16
}

LLVM IR (-O2):
@.str = [43 x i8] c"%s:%d: %s: Invariant `%s' != NULL failed.\0A\00"
define i8* @_contract_invariant_non_null(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @contract_non_null(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i8* %6
}