xunge/DecIR huggingface dataset:
unsigned int swapInt(unsigned int dw) {
  unsigned int tmp;
  tmp = (dw & 0x000000FF);
  tmp = ((dw & 0x0000FF00) >> 0x08) | (tmp << 0x08);
  tmp = ((dw & 0x00FF0000) >> 0x10) | (tmp << 0x08);
  tmp = ((dw & 0xFF000000) >> 0x18) | (tmp << 0x08);
  return (tmp);
}


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

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

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

LLVM IR (-O2):
define i32 @swapInt(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint8_t inUse(uint64_t *guard_object) {
  return (((uint8_t *)guard_object)[1] != 0);
}


x86 assembly (clang, -O0):
<inUse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inUse>:
xor    %eax,%eax
cmpl   $0x0,0x4(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @inUse(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @inUse(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void debug_puts(const char *str) {
  const char *c;
  for (c = str; *c; c++) {
    (*((volatile char *)0x20)) = *c;
  }
}


x86 assembly (clang, -O0):
<debug_puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113b <debug_puts+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    $0x20,%eax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <debug_puts+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_puts>:
mov    (%rdi),%al
test   %al,%al
je     1122 <debug_puts+0x22>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,0x20
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <debug_puts+0x10>
ret

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

LLVM IR (-O2):
define void @debug_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
store volatile i8 %5, i8* inttoptr (i64 32 to i8*)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ read_file(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s filename\n", argv[0]);
    return 1;
  }
  read_file(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1168 <main+0x48>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <read_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1145 <main+0x25>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <read_file@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @read_file(i8* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @read_file(i8* %10)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
bool nrf52_errata_181(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_181() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AM_STR;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_amstr() { return nl_langinfo(AM_STR); }


x86 assembly (clang, -O0):
<langinfo_amstr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_amstr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@AM_STR = global i32 0
define i8* @langinfo_amstr() {
%1 = load i32, i32* @AM_STR
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@AM_STR = global i32 0
define i8* @langinfo_amstr() {
%1 = load i32, i32* @AM_STR
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
int /*<<< orphan*/ free(char *);
char *getcwd(char *, int /*<<< orphan*/);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *pwd;
  pwd = malloc(PATH_MAX);
  pwd = getcwd(pwd, PATH_MAX);
  printf("pwd: %s\n", pwd);
  free(pwd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1050 <getcwd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,%rdi
mov    %ebx,%esi
call   1050 <getcwd@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [9 x i8] c"pwd: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i32, i32* @PATH_MAX
%4 = call i8* @malloc(i32 %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @PATH_MAX
%7 = call i8* @getcwd(i8* %5, i32 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [9 x i8] c"pwd: %s\0A\00"
define i32 @main() {
%1 = load i32, i32* @PATH_MAX
%2 = tail call i8* @malloc(i32 %1)
%3 = tail call i8* @getcwd(i8* %2, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ storemax(int);
int callback(int depth) {
  storemax(depth);
  return depth != 0;
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <storemax@plt>
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %rbx
mov    %edi,%ebx
call   1030 <storemax@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @callback(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @storemax(i32 %3)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @callback(i32 %0) {
%2 = tail call i32 @storemax(i32 %0)
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int error(char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int f(int c, int b, int d) {
  int r, e;
  if (c)
    r = b + d;
  else {
    e = b + d;
    r = e;
  }
  return r;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1125 <f+0x25>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <f+0x34>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rsi,%rdx,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t ntime() {
  struct timespec ts;
  uint64_t r;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  r = ts.tv_sec * (1000000000);
  r += ts.tv_nsec;
  return r;
}


x86 assembly (clang, -O0):
<ntime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%eax
3b
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @ntime() {
%1 = alloca %struct.timespec
%2 = alloca i32
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @ntime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add i32 %7, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m36_setParams41X3(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m36_setParams42XX(int /*<<< orphan*/, int /*<<< orphan*/);
void m36_setParams41X3_42XX(uint16_t addr, uint8_t val) {
  m36_setParams41X3(addr, val);
  m36_setParams42XX(addr, val);
}


x86 assembly (clang, -O0):
<m36_setParams41X3_42XX>:
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   1040 <m36_setParams41X3@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <m36_setParams42XX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m36_setParams41X3_42XX>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <m36_setParams41X3@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <m36_setParams42XX@plt>

LLVM IR (-O0):
define void @m36_setParams41X3_42XX(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 @m36_setParams41X3(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @m36_setParams42XX(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @m36_setParams41X3_42XX(i32 %0, i32 %1) {
%3 = tail call i32 @m36_setParams41X3(i32 %0, i32 %1)
%4 = tail call i32 @m36_setParams42XX(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/ *);
void uninitvar_freopen(void) {
  char *filename;
  char *mode;
  FILE *stream;
  FILE *p = freopen(filename, mode, stream);
  fclose(p);
}


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

x86 assembly (clang, -O2):
<uninitvar_freopen>:
push   %rax
call   1040 <freopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @uninitvar_freopen() {
%1 = tail call i32* @freopen(i8* undef, i8* undef, i32* undef)
%2 = tail call i32 @fclose(i32* %1)
ret void
}
int test_imm_50uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x50,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_50uint64_highword_reg>:
movabs $0x5000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_50uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 80
%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_50uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 343597383680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_polysys_witset(int dim) {
  int *b;
  double *c;
  int fail = _ada_use_c2phc4c(855, &dim, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @copy_quaddobl_polysys_witset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 855, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t get_block_number_from_tag(uint8_t *tag) {
  return ((uint64_t)(tag[0] & 0x7f) << 56) ^ ((uint64_t)tag[1] << 48) ^
         ((uint64_t)tag[2] << 40) ^ ((uint64_t)tag[3] << 32) ^
         ((uint64_t)tag[4] << 24) ^ ((uint64_t)tag[5] << 16) ^
         ((uint64_t)tag[6] << 8) ^ ((uint64_t)tag[7]);
}


x86 assembly (clang, -O0):
<get_block_number_from_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7f,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%ecx
shl    $0x18,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%ecx
shl    $0x10,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%ecx
shl    $0x8,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
xor    0x1c(%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_block_number_from_tag(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 127
%7 = shl i32 %6, 56
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 48
%12 = xor i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 40
%17 = xor i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = shl i32 %20, 32
%22 = xor i32 %17, %21
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 4
%25 = load i32, i32* %24
%26 = shl i32 %25, 24
%27 = xor i32 %22, %26
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 5
%30 = load i32, i32* %29
%31 = shl i32 %30, 16
%32 = xor i32 %27, %31
%33 = load i32*, i32** %2
%34 = getelementptr inbounds i32, i32* %33, i64 6
%35 = load i32, i32* %34
%36 = shl i32 %35, 8
%37 = xor i32 %32, %36
%38 = load i32*, i32** %2
%39 = getelementptr inbounds i32, i32* %38, i64 7
%40 = load i32, i32* %39
%41 = xor i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @get_block_number_from_tag(i32* nocapture readnone %0) {
ret i32 poison
}
int compareIntegers(const int *lhs, const int *rhs) { return *lhs - *rhs; }


x86 assembly (clang, -O0):
<compareIntegers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareIntegers>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareIntegers(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @compareIntegers(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int sub(int, int);
int main() {
  int x = 10, y = 20;
  printf("\n%d + %d = %d", x, y, add(x, y));
  printf("\n%d + %d = %d", x, y, sub(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <add@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <sub@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <add@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <sub@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0A%d + %d = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @add(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @sub(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0A%d + %d = %d\00"
define i32 @main() {
%1 = tail call i32 @add(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 %1)
%3 = tail call i32 @sub(i32 10, i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int *foo() {
  int i;
  int array[5];
  int array1[5];
  printf("%p\n", array);
  printf("%p\n", array1);
  for (i = 0; i < 5; i++) {
    array[i] = 17;
  }
  return array;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x20(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1163 <foo+0x53>
movslq -0x4(%rbp),%rax
movl   $0x11,-0x20(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <foo+0x2f>
lea    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xee2(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32* @foo() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %7)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ inlinedFunctionImplementation();
int main() {
  inlinedFunctionImplementation();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @inlinedFunctionImplementation()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursorshow(void) { printf("\033[?25h"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @cursorshow() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) void fn1(int x) {
  __asm volatile("" : "+r"(x) : : "memory");
}


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

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

LLVM IR (-O0):
define void @fn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm sideeffect "", "=r,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @fn1(i32 %0) {
%2 = tail call i32 asm sideeffect "", "=r,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ common();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello from prog2.c\n");
  common();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"hello from prog2.c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @common()
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"hello from prog2.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @common()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xc6() {
  Assert_real((isodigit(198) == 0),
              "/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/ctype/test_isodigit.c",
              995, ("isodigit should be 0 for 0xc6"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xc6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc6,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3e3,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xc6>:
push   %rax
mov    $0xc6,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3e3,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc6\00"
define void @t_isodigit_0xc6() {
%1 = call i64 @isodigit(i32 198)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc6\00"
define void @t_isodigit_0xc6() {
%1 = tail call i64 @isodigit(i32 198)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpunord_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d f4(__m128d x, __m128d y) { return _mm_cmpunord_pd(x, y); }


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

x86 assembly (clang, -O2):
<f4>:
jmp    1030 <_mm_cmpunord_pd@plt>

LLVM IR (-O0):
define i32 @f4(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 @_mm_cmpunord_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpunord_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, int);
char *mongo_data_append64(char *start, const void *data) {
  (memcpy(start, data, 8));
  return start + 8;
}


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

x86 assembly (clang, -O2):
<mongo_data_append64>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x8,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mongo_data_append64(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 @memcpy(i8* %5, i8* %6, i32 8)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 8
ret i8* %9
}

LLVM IR (-O2):
define i8* @mongo_data_append64(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 8)
%4 = getelementptr inbounds i8, i8* %0, i64 8
ret i8* %4
}
/* Variables and functions */
int keypad_getchar();
int d2x24_getch(void) {
  int return_key;
  int key = keypad_getchar();
  switch (key) {
  case 'A':
    return_key = 'f';
    break;
  case 'B':
    return_key = 's';
    break;
  case '*':
    return_key = 'q';
    break;
  case 'C':
    return_key = 'a';
    break;
  case 'D':
    return_key = 'm';
    break;
  default:
    return_key = key;
  }
  return return_key;
}


x86 assembly (clang, -O0):
<d2x24_getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <keypad_getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1a,%eax
ja     1187 <d2x24_getch+0x77>
mov    -0x10(%rbp),%rax
lea    0xebe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x66,-0x4(%rbp)
jmp    118d <d2x24_getch+0x7d>
movl   $0x73,-0x4(%rbp)
jmp    118d <d2x24_getch+0x7d>
movl   $0x71,-0x4(%rbp)
jmp    118d <d2x24_getch+0x7d>
movl   $0x61,-0x4(%rbp)
jmp    118d <d2x24_getch+0x7d>
movl   $0x6d,-0x4(%rbp)
jmp    118d <d2x24_getch+0x7d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2x24_getch>:
push   %rax
xor    %eax,%eax
call   1030 <keypad_getchar@plt>
mov    %eax,%ecx
lea    -0x2a(%rcx),%edx
cmp    $0x1a,%edx
ja     113e <d2x24_getch+0x2e>
mov    $0x66,%eax
lea    0xed2(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x71,%eax
pop    %rcx
ret
mov    %ecx,%eax
pop    %rcx
ret
mov    $0x73,%eax
pop    %rcx
ret
mov    $0x61,%eax
pop    %rcx
ret
mov    $0x6d,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @d2x24_getch() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @keypad_getchar()
store i32 %3, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %10 [
i32 65, label %5
i32 66, label %6
i32 42, label %7
i32 67, label %8
i32 68, label %9
]
5: ; preds = %0
store i32 102, i32* %1
br label %12
6: ; preds = %0
store i32 115, i32* %1
br label %12
7: ; preds = %0
store i32 113, i32* %1
br label %12
8: ; preds = %0
store i32 97, i32* %1
br label %12
9: ; preds = %0
store i32 109, i32* %1
br label %12
10: ; preds = %0
%11 = load i32, i32* %2
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @d2x24_getch() {
%1 = tail call i32 (...) @keypad_getchar()
switch i32 %1, label %6 [
i32 65, label %7
i32 66, label %2
i32 42, label %3
i32 67, label %4
i32 68, label %5
]
2: ; preds = %0
br label %7
3: ; preds = %0
br label %7
4: ; preds = %0
br label %7
5: ; preds = %0
br label %7
6: ; preds = %0
br label %7
7: ; preds = %0, %6, %5, %4, %3, %2
%8 = phi i32 [ %1, %6 ], [ 109, %5 ], [ 97, %4 ], [ 113, %3 ], [ 115, %2 ], [ 102, %0 ]
ret i32 %8
}
void XPutImage() {}


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

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

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

LLVM IR (-O2):
define void @XPutImage() {
ret void
}
unsigned int call_link(unsigned int descriptor) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_link(i32 %0) {
ret i32 0
}
/* Type definitions */
struct uc_program {
  int dummy;
};

/* Variables and functions */
int uc_program_current_character(struct uc_program *);
char uc_whitespace(struct uc_program *program) {
  switch (uc_program_current_character(program)) {
  case 'S':
    return ' ';
  case 'N':
    return '\n';
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<uc_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <uc_program_current_character@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x4e,%eax
je     1152 <uc_whitespace+0x42>
jmp    1138 <uc_whitespace+0x28>
mov    -0x14(%rbp),%eax
sub    $0x53,%eax
jne    115b <uc_whitespace+0x4b>
jmp    1149 <uc_whitespace+0x39>
movb   $0x20,-0x1(%rbp)
jmp    115f <uc_whitespace+0x4f>
movb   $0xa,-0x1(%rbp)
jmp    115f <uc_whitespace+0x4f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_whitespace>:
push   %rax
call   1030 <uc_program_current_character@plt>
xor    %ecx,%ecx
cmp    $0x4e,%eax
mov    $0xa,%edx
cmovne %ecx,%edx
cmp    $0x53,%eax
mov    $0x20,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.uc_program = type { i32 }
define signext i8 @uc_whitespace(%struct.uc_program* %0) {
%2 = alloca i8
%3 = alloca %struct.uc_program*
store %struct.uc_program* %0, %struct.uc_program** %3
%4 = load %struct.uc_program*, %struct.uc_program** %3
%5 = call i32 @uc_program_current_character(%struct.uc_program* %4)
switch i32 %5, label %8 [
i32 83, label %6
i32 78, label %7
]
6: ; preds = %1
store i8 32, i8* %2
br label %9
7: ; preds = %1
store i8 10, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
%struct.uc_program = type { i32 }
define signext i8 @uc_whitespace(%struct.uc_program* %0) {
%2 = tail call i32 @uc_program_current_character(%struct.uc_program* %0)
%3 = icmp eq i32 %2, 78
%4 = select i1 %3, i8 10, i8 0
%5 = icmp eq i32 %2, 83
%6 = select i1 %5, i8 32, i8 %4
ret i8 %6
}
/* Type definitions */
struct nc_buff {
  int dummy;
};

/* Variables and functions */
struct nc_buff *ncb_get(struct nc_buff *);
struct nc_buff *ncb_clone(struct nc_buff *ncb) {
  return ncb_get(ncb);
}


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

x86 assembly (clang, -O2):
<ncb_clone>:
jmp    1030 <ncb_get@plt>

LLVM IR (-O0):
%struct.nc_buff = type { i32 }
define %struct.nc_buff* @ncb_clone(%struct.nc_buff* %0) {
%2 = alloca %struct.nc_buff*
store %struct.nc_buff* %0, %struct.nc_buff** %2
%3 = load %struct.nc_buff*, %struct.nc_buff** %2
%4 = call %struct.nc_buff* @ncb_get(%struct.nc_buff* %3)
ret %struct.nc_buff* %4
}

LLVM IR (-O2):
%struct.nc_buff = type { i32 }
define %struct.nc_buff* @ncb_clone(%struct.nc_buff* %0) {
%2 = tail call %struct.nc_buff* @ncb_get(%struct.nc_buff* %0)
ret %struct.nc_buff* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int sysis_little_endian() {
  uint16_t n;
  n = 1;
  return !!(*((char *)(&n)));
}


x86 assembly (clang, -O0):
<sysis_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpb   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sysis_little_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @sysis_little_endian() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int uint32_t;
struct srng_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ srng_rand(struct srng_state *);
float srng_randf(struct srng_state *state) {
  uint64_t r;
  union {
    uint32_t i;
    float f;
  } u;
  r = srng_rand(state);
  u.i = (uint32_t)r;
  u.i &= 0x007fffff;
  u.i |= 0x3f800000;
  u.f -= 1.f;
  return u.f;
}


x86 assembly (clang, -O0):
<srng_randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <srng_rand@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0x7fffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     $0x3f800000,%eax
mov    %eax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xead(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srng_randf>:
push   %rax
call   1030 <srng_rand@plt>
and    $0x7fffff,%eax
or     $0x3f800000,%eax
movd   %eax,%xmm0
addss  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.srng_state = type { i32 }
%union.anon = type { i32 }
define float @srng_randf(%struct.srng_state* %0) {
%2 = alloca %struct.srng_state*
%3 = alloca i64
%4 = alloca %union.anon
store %struct.srng_state* %0, %struct.srng_state** %2
%5 = load %struct.srng_state*, %struct.srng_state** %2
%6 = call i64 @srng_rand(%struct.srng_state* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = bitcast %union.anon* %4 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.anon* %4 to i32*
%11 = load i32, i32* %10
%12 = and i32 %11, 8388607
store i32 %12, i32* %10
%13 = bitcast %union.anon* %4 to i32*
%14 = load i32, i32* %13
%15 = or i32 %14, 1065353216
store i32 %15, i32* %13
%16 = bitcast %union.anon* %4 to float*
%17 = load float, float* %16
%18 = fsub float %17, 1.000000e+00
store float %18, float* %16
%19 = bitcast %union.anon* %4 to float*
%20 = load float, float* %19
ret float %20
}

LLVM IR (-O2):
%struct.srng_state = type { i32 }
define float @srng_randf(%struct.srng_state* %0) {
%2 = tail call i64 @srng_rand(%struct.srng_state* %0)
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 8388607
%5 = or i32 %4, 1065353216
%6 = bitcast i32 %5 to float
%7 = fadd float %6, -1.000000e+00
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
uid_t geteuid() { return syscall(74, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<geteuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4a,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<geteuid>:
mov    $0x4a,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @geteuid() {
%1 = call i32 @syscall(i32 74, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @geteuid() {
%1 = tail call i32 @syscall(i32 74, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
void __cyg_profile_func_exit(void *func __attribute__((unused)),
                             void *caller __attribute__((unused))) {
  return;
}


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

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

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void RTTcpSgWriteNB(void) {}


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

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

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

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