xunge/DecIR huggingface dataset:
void XRayInit(int stack_size, int buffer_size, int frame_count,
              const char *mapfilename) {}


x86 assembly (clang, -O0):
<XRayInit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @XRayInit(i32 %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enca_malloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *enca_strdup(const char *s) {
  if (s == NULL)
    return NULL;
  else
    return strcpy(enca_malloc(strlen(s) + 1), s);
}


x86 assembly (clang, -O0):
<enca_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <enca_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1178 <enca_strdup+0x48>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <enca_malloc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enca_strdup>:
test   %rdi,%rdi
je     1152 <enca_strdup+0x22>
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1040 <enca_malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @enca_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @enca_malloc(i64 %5)
%7 = tail call i8* @strcpy(i32 %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
char *g();
char *f1(int x) { return (x == 0 ? "" : g()); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1135 <f1+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1140 <f1+0x30>
mov    $0x0,%al
call   1030 <g@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   %edi,%edi
je     111b <f1+0xb>
xor    %eax,%eax
jmp    1030 <g@plt>
lea    0xede(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i8* (...) @g()
br label %8
8: ; preds = %6, %5
%9 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %5 ], [ %7, %6 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @f1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* (...) @g()
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
void *realloc(void *, int);
int /*<<< orphan*/ stderr;
void *myrealloc(void *oldp, int newsize, char *what) {
  void *dummy = realloc(oldp, newsize);
  if (!dummy) {
    fprintf(stderr, "failed to reallocate to %d bytes for %s\n", newsize, what);
    exit(1);
  }
  return dummy;
}


x86 assembly (clang, -O0):
<myrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1184 <myrealloc+0x54>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrealloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <realloc@plt>
test   %rax,%rax
je     1149 <myrealloc+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"failed to reallocate to %d bytes for %s\0A\00"
define i8* @myrealloc(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i8* @realloc(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %19, label %13
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %3
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"failed to reallocate to %d bytes for %s\0A\00"
define i8* @myrealloc(i8* %0, i32 %1, i8* %2) {
%4 = tail call i8* @realloc(i8* %0, i32 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
char *emalloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *make_label(void) {
  static int n = 0;
  char *lbl = emalloc(8);
  sprintf(lbl, ".L%d", n);
  ++n;
  return lbl;
}


x86 assembly (clang, -O0):
<make_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <emalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ef4(%rip),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    0x2ee2(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed9(%rip)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_label>:
push   %rbx
mov    $0x8,%edi
call   1030 <emalloc@plt>
mov    %rax,%rbx
mov    0x2f00(%rip),%edx
lea    0xec5(%rip),%rsi
mov    %rax,%rdi
call   1040 <sprintf@plt>
addl   $0x1,0x2eea(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@make_label.n = internal global i32 0
@.str = [5 x i8] c".L%d\00"
define i8* @make_label() {
%1 = alloca i8*
%2 = call i8* @emalloc(i32 8)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = load i32, i32* @make_label.n
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @make_label.n
%7 = add nsw i32 %6, 1
store i32 %7, i32* @make_label.n
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@make_label.n = internal unnamed_addr global i32 0
@.str = [5 x i8] c".L%d\00"
define i8* @make_label() {
%1 = tail call i8* @emalloc(i32 8)
%2 = load i32, i32* @make_label.n
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @make_label.n
%5 = add nsw i32 %4, 1
store i32 %5, i32* @make_label.n
ret i8* %1
}
/* Variables and functions */
int shl_mult_ull(unsigned int *, unsigned int);
int /*<<< orphan*/ static_assert(int, char *);
int shl_mult_u(unsigned int *val, unsigned int factor) {
  static_assert(sizeof(unsigned int) == sizeof(unsigned long long),
                "sizeof(unsigned int) == sizeof(unsigned long long)");
  return shl_mult_ull(val, factor);
}


x86 assembly (clang, -O0):
<shl_mult_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
lea    0xec8(%rip),%rsi
call   1040 <static_assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <shl_mult_ull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_mult_u>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
xor    %edi,%edi
call   1040 <static_assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <shl_mult_ull@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"sizeof(unsigned int) == sizeof(unsigned long long)\00"
define i32 @shl_mult_u(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @static_assert(i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @shl_mult_ull(i32* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [51 x i8] c"sizeof(unsigned int) == sizeof(unsigned long long)\00"
define i32 @shl_mult_u(i32* %0, i32 %1) {
%3 = tail call i32 @static_assert(i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @shl_mult_ull(i32* %0, i32 %1)
ret i32 %4
}
__attribute__((no, noclone)) unsigned __int128 t172_4mul(unsigned __int128 x) {
  unsigned __int128 y = (0);
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t172_4mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    %rdx,-0x68(%rbp)
test   %rdx,%rdx
setne  %dl
test   %rax,%rax
setne  %dil
and    %dl,%dil
mul    %rcx
mov    -0x60(%rbp),%rdx
mov    %rax,%rsi
mov    -0x68(%rbp),%rax
seto   %r8b
or     %r8b,%dil
mul    %rdx
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
seto   %r8b
or     %r8b,%dil
mov    %dil,-0x51(%rbp)
add    %rdx,%rsi
mul    %rcx
mov    %rax,%rcx
mov    -0x51(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
mov    %rcx,-0x50(%rbp)
mov    %rdx,-0x48(%rbp)
test   $0x1,%al
jne    11bd <t172_4mul+0xad>
jmp    11c4 <t172_4mul+0xb4>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t172_4mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t172_4mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
/* Variables and functions */
uintptr_t PAGE_MASK;
uintptr_t PAGE_SIZE;
uintptr_t next_page_size(uintptr_t size) {
  return (size + PAGE_SIZE - 1) & PAGE_MASK;
}


x86 assembly (clang, -O0):
<next_page_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed5(%rip),%rcx
add    (%rcx),%rax
sub    $0x1,%rax
mov    0x2eb7(%rip),%rcx
and    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_page_size>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
mov    0x2ec0(%rip),%rcx
and    (%rcx),%rax
ret

LLVM IR (-O0):
@PAGE_SIZE = global i64 0
@PAGE_MASK = global i64 0
define i64 @next_page_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @PAGE_SIZE
%5 = add i64 %3, %4
%6 = sub i64 %5, 1
%7 = load i64, i64* @PAGE_MASK
%8 = and i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
@PAGE_SIZE = global i64 0
@PAGE_MASK = global i64 0
define i64 @next_page_size(i64 %0) {
%2 = load i64, i64* @PAGE_SIZE
%3 = add i64 %0, -1
%4 = add i64 %3, %2
%5 = load i64, i64* @PAGE_MASK
%6 = and i64 %4, %5
ret i64 %6
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_geteuid16(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_geteuid16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_geteuid16>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_geteuid16(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_geteuid16(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
unsigned char func(unsigned char arg0) { return arg0 + 3; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x3,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
lea    0x3(%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @func(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, 3
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @func(i8 zeroext %0) {
%2 = add i8 %0, 3
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int i;
  for (i = 0; i <= 3; i++) {
    if (i % 3 <= 1) {
      {
        hash(1);
        hash(i);
      };
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jg     1162 <test+0x52>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jg     114f <test+0x3f>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
jmp    1154 <test+0x44>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1030 <hash@plt>
xor    %edi,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %14, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 3
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = load i32, i32* %1
%7 = srem i32 %6, 3
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = call i32 @hash(i32 1)
%11 = load i32, i32* %1
%12 = call i32 @hash(i32 %11)
br label %13
13: ; preds = %9, %5
br label %14
14: ; preds = %13
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %2
17: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 1)
%2 = tail call i32 @hash(i32 0)
%3 = tail call i32 @hash(i32 1)
%4 = tail call i32 @hash(i32 1)
%5 = tail call i32 @hash(i32 1)
%6 = tail call i32 @hash(i32 3)
ret void
}
int dec4(char **buf, int *x) {
  char *p = *buf;
  *x = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
  *buf += 4;
  return 0;
}


x86 assembly (clang, -O0):
<dec4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
shl    $0x18,%ecx
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
movsbl 0x3(%rax),%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec4>:
mov    (%rdi),%rax
movzbl (%rax),%ecx
shl    $0x18,%ecx
movsbl 0x1(%rax),%edx
shl    $0x10,%edx
or     %ecx,%edx
movsbl 0x2(%rax),%r8d
shl    $0x8,%r8d
movsbl 0x3(%rax),%ecx
or     %r8d,%ecx
or     %edx,%ecx
mov    %ecx,(%rsi)
add    $0x4,%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dec4(i8** nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = shl nuw i32 %5, 24
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = shl nsw i32 %9, 16
%11 = or i32 %10, %6
%12 = getelementptr inbounds i8, i8* %3, i64 2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = shl nsw i32 %14, 8
%16 = or i32 %11, %15
%17 = getelementptr inbounds i8, i8* %3, i64 3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = or i32 %16, %19
store i32 %20, i32* %1
%21 = getelementptr inbounds i8, i8* %3, i64 4
store i8* %21, i8** %0
ret i32 0
}
int is_index_delimiter(c)
char c;
{ return (c == '['); }


x86 assembly (clang, -O0):
<is_index_delimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_index_delimiter>:
xor    %eax,%eax
cmp    $0x5b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_index_delimiter(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 91
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_index_delimiter(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 91
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ av_set_audio_stc(int /*<<< orphan*/);
int /*<<< orphan*/ av_set_video_stc(int /*<<< orphan*/);
int av_reset_stc(void) {
  av_set_audio_stc(0);
  av_set_video_stc(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<av_reset_stc>:
push   %rax
xor    %edi,%edi
call   1040 <av_set_audio_stc@plt>
xor    %edi,%edi
call   1030 <av_set_video_stc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @av_reset_stc() {
%1 = call i32 @av_set_audio_stc(i32 0)
%2 = call i32 @av_set_video_stc(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @av_reset_stc() {
%1 = tail call i32 @av_set_audio_stc(i32 0)
%2 = tail call i32 @av_set_video_stc(i32 0)
ret i32 0
}
double l2d(long long a) { return (double)a; }


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

x86 assembly (clang, -O2):
<l2d>:
cvtsi2sd %rdi,%xmm0
ret

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

LLVM IR (-O2):
define double @l2d(i64 %0) {
%2 = sitofp i64 %0 to double
ret double %2
}
int int_fetch_ior_release(int *ptr, int value) {
  return __atomic_fetch_or(ptr, value, 3);
}


x86 assembly (clang, -O0):
<int_fetch_ior_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    %ecx,-0x1c(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
or     %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x2c(%rbp)
test   $0x1,%cl
mov    %eax,-0x18(%rbp)
jne    114d <int_fetch_ior_release+0x4d>
jmp    1124 <int_fetch_ior_release+0x24>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_fetch_ior_release>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
or     %esi,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <int_fetch_ior_release+0x10>
ret

LLVM IR (-O0):
define i32 @int_fetch_ior_release(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = atomicrmw or i32* %7, i32 %9 release
store i32 %10, i32* %6
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @int_fetch_ior_release(i32* nocapture %0, i32 %1) {
%3 = atomicrmw or i32* %0, i32 %1 release
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _L3L4_clock_domain_close();
scalar_t__ _L3L4_clock_domain_status_get();
int /*<<< orphan*/ _L3L4_clock_domain_status_set(int /*<<< orphan*/);
int L3L4_clock_domain_close(void) {
  if (_L3L4_clock_domain_status_get() == 0) {
    return 1;
  }
  _L3L4_clock_domain_close();
  _L3L4_clock_domain_status_set(0);
  return 0;
}


x86 assembly (clang, -O0):
<L3L4_clock_domain_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_L3L4_clock_domain_status_get@plt>
cmp    $0x0,%rax
jne    1155 <L3L4_clock_domain_close+0x25>
movl   $0x1,-0x4(%rbp)
jmp    116a <L3L4_clock_domain_close+0x3a>
mov    $0x0,%al
call   1050 <_L3L4_clock_domain_close@plt>
xor    %edi,%edi
call   1040 <_L3L4_clock_domain_status_set@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L3L4_clock_domain_close>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <_L3L4_clock_domain_status_get@plt>
test   %rax,%rax
je     114f <L3L4_clock_domain_close+0x1f>
xor    %eax,%eax
call   1050 <_L3L4_clock_domain_close@plt>
xor    %edi,%edi
call   1040 <_L3L4_clock_domain_status_set@plt>
jmp    1154 <L3L4_clock_domain_close+0x24>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @L3L4_clock_domain_close() {
%1 = alloca i32
%2 = call i64 (...) @_L3L4_clock_domain_status_get()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 (...) @_L3L4_clock_domain_close()
%7 = call i32 @_L3L4_clock_domain_status_set(i32 0)
store i32 0, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @L3L4_clock_domain_close() {
%1 = tail call i64 (...) @_L3L4_clock_domain_status_get()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @_L3L4_clock_domain_close()
%5 = tail call i32 @_L3L4_clock_domain_status_set(i32 0)
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
int foo(double **);
int bar(void) {
  double buf[8] __attribute__((__aligned__(16)));
  return foo(&buf);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
call   1030 <foo@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to double**
%3 = call i32 @foo(double** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = bitcast [8 x double]* %1 to double**
%4 = call i32 @foo(double** %3)
ret i32 %4
}
/* Variables and functions */
unsigned long long atoi(char *);
unsigned long long int square(char *p) {
  unsigned long long int q = atoi(p);
  q = q * q;
  return q;
}


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

x86 assembly (clang, -O2):
<square>:
push   %rax
call   1030 <atoi@plt>
imul   %rax,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @square(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @atoi(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @square(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
%3 = mul i64 %2, %2
ret i64 %3
}
int test_imm_31int64_lowword_reg(long long val) {
  return ((val) & (0x31 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_31int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 49
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void free(void *);
void free_key_struct(void *keys) { return free(keys); }


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

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

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

LLVM IR (-O2):
define void @free_key_struct(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
alphan(c) char c;
{
  if (alpha(c))
    return (1);
  if (c <= '9' && c >= '0')
    return (1);
  if (c == '$')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<alphan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
mov    $0x0,%al
call   1030 <alpha@plt>
cmp    $0x0,%eax
je     113e <alphan+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1184 <alphan+0x74>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1164 <alphan+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1164 <alphan+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1184 <alphan+0x74>
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
jne    117d <alphan+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <alphan+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphan>:
push   %rbx
movsbl %dil,%eax
mov    %edi,%ebx
shl    $0x18,%ebx
mov    %eax,%edi
xor    %eax,%eax
call   1030 <alpha@plt>
test   %eax,%eax
setne  %al
lea    -0x2f000001(%rbx),%ecx
cmp    $0xaffffff,%ecx
setb   %cl
or     %al,%cl
cmp    $0x24000000,%ebx
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alphan(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @alpha to i32 (i32, ...)*)(i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %25
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 48
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %2
br label %25
19: ; preds = %14, %10
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 36
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23, %18, %9
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @alphan(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @alpha to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = add i32 %2, -788529153
%7 = icmp ult i32 %6, 184549375
%8 = or i1 %7, %5
%9 = icmp eq i32 %2, 603979776
%10 = or i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void myprint(int i) { printf("myprint() i = %d", i); }


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"myprint() i = %d\00"
define void @myprint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ GPIOBaseValid(unsigned long);
void GPIOADCTriggerDisable(unsigned long ulPort, unsigned char ucPins) {
  DEBUG_ASSERT(GPIOBaseValid(ulPort));
  (*((volatile unsigned long *)(ulPort + 0x00000530))) &= (~ucPins);
}


x86 assembly (clang, -O0):
<GPIOADCTriggerDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GPIOBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x530(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x530(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOADCTriggerDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <GPIOBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %ebp,%eax
not    %rax
and    %rax,0x530(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @GPIOADCTriggerDisable(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = call i32 @GPIOBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = xor i32 %9, -1
%11 = sext i32 %10 to i64
%12 = load i64, i64* %3
%13 = add i64 %12, 1328
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, %11
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @GPIOADCTriggerDisable(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIOBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = zext i8 %1 to i64
%6 = xor i64 %5, -1
%7 = add i64 %0, 1328
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %6
store volatile i64 %10, i64* %8
ret void
}
void auditd_tcp_listen_reconfigure(struct daemon_conf *nconf,
                                   struct daemon_conf *oconf) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.daemon_conf = type opaque
define void @auditd_tcp_listen_reconfigure(%struct.daemon_conf* nocapture %0, %struct.daemon_conf* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *medprio(void *null) {
  int i = 1;
  printf("MEDPRIO : acquired cpu \n");
  while (i < 100) {
    printf("MEDPRIO : running\n");
    i++;
  }
}


x86 assembly (clang, -O0):
<medprio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x64,-0x14(%rbp)
jge    1153 <medprio+0x43>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <medprio+0x1f>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medprio>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x63,%ebp
lea    0xeed(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1130 <medprio+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [24 x i8] c"MEDPRIO : acquired cpu \00"
@str.2 = [18 x i8] c"MEDPRIO : running\00"
define noalias i8* @medprio(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 1, %1 ], [ %6, %3 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %3
8: ; preds = %3
ret i8* undef
}
char *strchr(char *s, int c) {
  c = (char)c;
  while (*s) {
    if (*s == c)
      return s;
    ++s;
  }
  if (!c)
    return s;
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <strchr+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113e <strchr+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <strchr+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strchr+0x14>
cmpl   $0x0,-0x14(%rbp)
jne    1166 <strchr+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <strchr+0x6e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     112c <strchr+0x2c>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %ecx,%ecx
shl    $0x18,%esi
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %2, %12
%8 = phi i8 [ %14, %12 ], [ %5, %2 ]
%9 = phi i8* [ %13, %12 ], [ %0, %2 ]
%10 = sext i8 %8 to i32
%11 = icmp eq i32 %4, %10
br i1 %11, label %20, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %12, %2
%17 = phi i8* [ %0, %2 ], [ %13, %12 ]
%18 = icmp eq i32 %3, 0
%19 = select i1 %18, i8* %17, i8* null
br label %20
20: ; preds = %7, %16
%21 = phi i8* [ %19, %16 ], [ %9, %7 ]
ret i8* %21
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char *);
char *igraph_strerror(int);
int /*<<< orphan*/ stderr;
void igraph_error_handler_abort(const char *reason, const char *file, int line,
                                int igraph_errno) {
  fprintf(stderr, "Error at %s:%i :%s, %s\n", file, line, reason,
          igraph_strerror(igraph_errno));
  abort();
}


x86 assembly (clang, -O0):
<igraph_error_handler_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <igraph_strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    %rax,%r9
lea    0xe78(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<igraph_error_handler_abort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%r15
mov    0x2e99(%rip),%rax
mov    (%rax),%ebp
mov    %ecx,%edi
call   1040 <igraph_strerror@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14d,%ecx
mov    %r15,%r8
mov    %rax,%r9
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Error at %s:%i :%s, %s\0A\00"
define void @igraph_error_handler_abort(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %5
%13 = load i32, i32* %8
%14 = call i8* @igraph_strerror(i32 %13)
%15 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %14)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Error at %s:%i :%s, %s\0A\00"
define void @igraph_error_handler_abort(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i8* @igraph_strerror(i32 %3)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0, i8* %6)
%8 = tail call i32 (...) @abort()
unreachable
}
int mongo_sock_init() {
  static int called_once;
  static int retval;
  if (called_once)
    return retval;
  called_once = 1;
  return retval;
}


x86 assembly (clang, -O0):
<mongo_sock_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     111f <mongo_sock_init+0x1f>
mov    0x2f11(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <mongo_sock_init+0x32>
movl   $0x1,0x2efb(%rip)
mov    0x2ef9(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mongo_sock_init>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <mongo_sock_init+0x10>
movb   $0x1,0x2f14(%rip)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@mongo_sock_init.called_once = internal unnamed_addr global i1 false
define i32 @mongo_sock_init() {
%1 = load i1, i1* @mongo_sock_init.called_once
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @mongo_sock_init.called_once
br label %3
3: ; preds = %0, %2
ret i32 0
}
void g_DUMMY_menu_hide_popup(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_menu_hide_popup(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xe2() {
  Assert_real((isalnum(226) == 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_isalnum.c",
              1135, ("isalnum should be 0 for 0xe2"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe2\00"
define void @t_isalnum_0xe2() {
%1 = call i64 @isalnum(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe2\00"
define void @t_isalnum_0xe2() {
%1 = tail call i64 @isalnum(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ temperatureConvert();
int main() {
  temperatureConvert();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @temperatureConvert()
ret i32 0
}