xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("HATA!\n"
         "user_programs/bin icerisindeki program derlenmemis.\n"
         "program kodu hatali ya da tools derlenmemis olabilir\n"
         "\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [114 x i8] c"HATA!\0Auser_programs/bin icerisindeki program derlenmemis.\0Aprogram kodu hatali ya da tools derlenmemis olabilir\0A\0A\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 ([114 x i8], [114 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [113 x i8] c"HATA!\0Auser_programs/bin icerisindeki program derlenmemis.\0Aprogram kodu hatali ya da tools derlenmemis olabilir\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void PoissonNoiseSeed(unsigned int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<PoissonNoiseSeed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @PoissonNoiseSeed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_compression_mode_pg(struct list_head *, int);
uint8_t set_ait_compression(struct list_head *l, int lvl) {
  ;
  return set_compression_mode_pg(l, lvl);
}


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

x86 assembly (clang, -O2):
<set_ait_compression>:
jmp    1030 <set_compression_mode_pg@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define i32 @set_ait_compression(%struct.list_head* %0, i32 %1) {
%3 = alloca %struct.list_head*
%4 = alloca i32
store %struct.list_head* %0, %struct.list_head** %3
store i32 %1, i32* %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load i32, i32* %4
%7 = call i32 @set_compression_mode_pg(%struct.list_head* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_ait_compression(%struct.list_head* %0, i32 %1) {
%3 = tail call i32 @set_compression_mode_pg(%struct.list_head* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void printError(char *id) {
  printf("ERRORE: l'id %s non coincide tra begin e end\n", id);
  exit(-1);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printError>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"ERRORE: l'id %s non coincide tra begin e end\0A\00"
define void @printError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"ERRORE: l'id %s non coincide tra begin e end\0A\00"
define void @printError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
struct wiphy {
  int dummy;
};
struct brcmf_cfg80211_info {
  int dummy;
};

/* Variables and functions */
scalar_t__ wiphy_priv(struct wiphy *);
struct brcmf_cfg80211_info *wiphy_to_cfg(struct wiphy *w) {
  return (struct brcmf_cfg80211_info *)(wiphy_priv(w));
}


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

x86 assembly (clang, -O2):
<wiphy_to_cfg>:
jmp    1030 <wiphy_priv@plt>

LLVM IR (-O0):
%struct.brcmf_cfg80211_info = type { i32 }
%struct.wiphy = type { i32 }
define %struct.brcmf_cfg80211_info* @wiphy_to_cfg(%struct.wiphy* %0) {
%2 = alloca %struct.wiphy*
store %struct.wiphy* %0, %struct.wiphy** %2
%3 = load %struct.wiphy*, %struct.wiphy** %2
%4 = call i64 @wiphy_priv(%struct.wiphy* %3)
%5 = inttoptr i64 %4 to %struct.brcmf_cfg80211_info*
ret %struct.brcmf_cfg80211_info* %5
}

LLVM IR (-O2):
%struct.brcmf_cfg80211_info = type { i32 }
%struct.wiphy = type { i32 }
define %struct.brcmf_cfg80211_info* @wiphy_to_cfg(%struct.wiphy* %0) {
%2 = tail call i64 @wiphy_priv(%struct.wiphy* %0)
%3 = inttoptr i64 %2 to %struct.brcmf_cfg80211_info*
ret %struct.brcmf_cfg80211_info* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bym(int /*<<< orphan*/);
int /*<<< orphan*/ shr();
void shr_bym(uint32_t x) {
  bym(x);
  shr();
}


x86 assembly (clang, -O0):
<shr_bym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bym@plt>
mov    $0x0,%al
call   1030 <shr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr_bym>:
push   %rax
call   1040 <bym@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <shr@plt>

LLVM IR (-O0):
define void @shr_bym(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bym(i32 %3)
%5 = call i32 (...) @shr()
ret void
}

LLVM IR (-O2):
define void @shr_bym(i32 %0) {
%2 = tail call i32 @bym(i32 %0)
%3 = tail call i32 (...) @shr()
ret void
}
/* Variables and functions */
size_t cstr_length(const char *str) {
  register const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<cstr_length>:
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     1133 <cstr_length+0x33>
jmp    1122 <cstr_length+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <cstr_length+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @cstr_length(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @cstr_length(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int get_le32(unsigned int);
int clHCA_CheckFile(void *data, unsigned int size) {
  return (data && size >= 4 &&
          (get_le32(*(unsigned int *)data) & 0x7F7F7F7F) == 0x00414348);
}


x86 assembly (clang, -O0):
<clHCA_CheckFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1159 <clHCA_CheckFile+0x49>
xor    %eax,%eax
cmpl   $0x4,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jb     1159 <clHCA_CheckFile+0x49>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <get_le32@plt>
and    $0x7f7f7f7f,%eax
cmp    $0x414348,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clHCA_CheckFile>:
xor    %eax,%eax
test   %rdi,%rdi
je     113b <clHCA_CheckFile+0x2b>
cmp    $0x4,%esi
jb     113b <clHCA_CheckFile+0x2b>
push   %rax
mov    (%rdi),%edi
call   1030 <get_le32@plt>
mov    %eax,%ecx
and    $0x7f7f7f7f,%ecx
xor    %eax,%eax
cmp    $0x414348,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @clHCA_CheckFile(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp uge i32 %8, 4
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = call i32 @get_le32(i32 %13)
%15 = and i32 %14, 2139062143
%16 = icmp eq i32 %15, 4277064
br label %17
17: ; preds = %10, %7, %2
%18 = phi i1 [ false, %7 ], [ false, %2 ], [ %16, %10 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @clHCA_CheckFile(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ugt i32 %1, 3
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @get_le32(i32 %8)
%10 = and i32 %9, 2139062143
%11 = icmp eq i32 %10, 4277064
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long encoding;
};
typedef TYPE_1__ XTextProperty;

/* Variables and functions */
void set_XTextProperty_encoding(void *_p, unsigned long _v) {
  ((XTextProperty *)_p)->encoding = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XTextProperty_encoding(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XTextProperty_encoding(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: mod-extract [-v] <modulefile> <extractfile>\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: mod-extract [-v] <modulefile> <extractfile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: mod-extract [-v] <modulefile> <extractfile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t adc_read(uint32_t *adc) { return adc[0x048 / 4]; }


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

x86 assembly (clang, -O2):
<adc_read>:
mov    0x48(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @adc_read(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 18
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void WatchdogResetDisable(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<WatchdogResetDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <WatchdogResetDisable+0x2a>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogResetDisable>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xfffffffd,0x8(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogResetDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 8
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, -3
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @WatchdogResetDisable(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 8
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -3
store volatile i32 %10, i32* %8
ret void
}
/* Type definitions */
struct slab_stat {
  int dummy;
};
struct slab_info {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int parse_slabinfo10(struct slab_info **list, struct slab_stat *stats,
                     FILE *f) {
  (void)list, (void)stats, (void)f;
  fprintf(stderr, "slabinfo version 1.0 not yet supported\n");
  return 1;
}


x86 assembly (clang, -O0):
<parse_slabinfo10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_slabinfo10>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.slab_info = type { i32 }
%struct.slab_stat = type { i32 }
@stderr = global i32 0
@.str = [40 x i8] c"slabinfo version 1.0 not yet supported\0A\00"
define i32 @parse_slabinfo10(%struct.slab_info** %0, %struct.slab_stat* %1, i32* %2) {
%4 = alloca %struct.slab_info**
%5 = alloca %struct.slab_stat*
%6 = alloca i32*
store %struct.slab_info** %0, %struct.slab_info*** %4
store %struct.slab_stat* %1, %struct.slab_stat** %5
store i32* %2, i32** %6
%7 = load %struct.slab_info**, %struct.slab_info*** %4
%8 = load %struct.slab_stat*, %struct.slab_stat** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.slab_info = type { i32 }
%struct.slab_stat = type { i32 }
@stderr = global i32 0
@.str = [40 x i8] c"slabinfo version 1.0 not yet supported\0A\00"
define i32 @parse_slabinfo10(%struct.slab_info** nocapture readnone %0, %struct.slab_stat* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ psClosePrng();
int /*<<< orphan*/ psCoreClose();
void psCryptoClose(void) {
  psClosePrng();
  psCoreClose();
}


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

x86 assembly (clang, -O2):
<psCryptoClose>:
push   %rax
xor    %eax,%eax
call   1030 <psClosePrng@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <psCoreClose@plt>

LLVM IR (-O0):
define void @psCryptoClose() {
%1 = call i32 (...) @psClosePrng()
%2 = call i32 (...) @psCoreClose()
ret void
}

LLVM IR (-O2):
define void @psCryptoClose() {
%1 = tail call i32 (...) @psClosePrng()
%2 = tail call i32 (...) @psCoreClose()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcscmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int dvm_wcscmp(const wchar_t *s1, const wchar_t *s2) { return wcscmp(s1, s2); }


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

x86 assembly (clang, -O2):
<dvm_wcscmp>:
jmp    1030 <wcscmp@plt>

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

LLVM IR (-O2):
define i32 @dvm_wcscmp(i32* %0, i32* %1) {
%3 = tail call i32 @wcscmp(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ i2c_WriteDataREG(int /*<<< orphan*/, unsigned char);
void i2c0_WriteDataREG(unsigned char val) { i2c_WriteDataREG(0, val); }


x86 assembly (clang, -O0):
<i2c0_WriteDataREG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2c_WriteDataREG@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c0_WriteDataREG>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <i2c_WriteDataREG@plt>

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

LLVM IR (-O2):
define void @i2c0_WriteDataREG(i8 zeroext %0) {
%2 = tail call i32 @i2c_WriteDataREG(i32 0, i8 zeroext %0)
ret void
}
long bitrev(long b, long c) {
  long i, j;
  for (i = 1, j = 0, c = (1 << c); i < c; i += i) {
    j += j;
    if (b & i)
      j++;
  }
  return (j);
}


x86 assembly (clang, -O0):
<bitrev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    117d <bitrev+0x7d>
mov    -0x20(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
je     1167 <bitrev+0x67>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    116c <bitrev+0x6c>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bitrev+0x2f>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitrev>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x2,%eax
jl     1136 <bitrev+0x36>
movslq %eax,%rcx
mov    $0x1,%edx
xor    %eax,%eax
nopl   0x0(%rax)
xor    %esi,%esi
test   %rdi,%rdx
setne  %sil
lea    (%rsi,%rax,2),%rax
add    %rdx,%rdx
cmp    %rcx,%rdx
jl     1120 <bitrev+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @bitrev(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = icmp sgt i32 %4, 1
br i1 %6, label %7, label %17
7: ; preds = %2, %7
%8 = phi i64 [ %14, %7 ], [ 0, %2 ]
%9 = phi i64 [ %15, %7 ], [ 1, %2 ]
%10 = shl nsw i64 %8, 1
%11 = and i64 %9, %0
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = or i64 %10, %13
%15 = shl nsw i64 %9, 1
%16 = icmp slt i64 %15, %5
br i1 %16, label %7, label %17
17: ; preds = %7, %2
%18 = phi i64 [ 0, %2 ], [ %14, %7 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_4(int, char *, unsigned long);
void extern_func1_3(int a, char *b, unsigned long c) {
  extern_func1_4(a, b, c);
}


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

x86 assembly (clang, -O2):
<extern_func1_3>:
jmp    1030 <extern_func1_4@plt>

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

LLVM IR (-O2):
define void @extern_func1_3(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_4(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void vc_sleep(int ms) { usleep(1000 * ms); }


x86 assembly (clang, -O0):
<vc_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vc_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @vc_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @vc_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *, char *);
int strftime(char *, int, char const *, struct tm *);
void my_strftime(char const *fmt, struct tm *t) {
  char buf[64] = {0};
  int ret = strftime(buf, sizeof(buf), fmt, t);
  printf("[%02d] '%s': %s\n", ret, fmt, buf);
}


x86 assembly (clang, -O0):
<my_strftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
call   1050 <strftime@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strftime>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
mov    %rbx,%rdx
call   1040 <strftime@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <printf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [17 x i8] c"[%02d] '%s': %s\0A\00"
define void @my_strftime(i8* %0, %struct.tm* %1) {
%3 = alloca i8*
%4 = alloca %struct.tm*
%5 = alloca [64 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store %struct.tm* %1, %struct.tm** %4
%7 = bitcast [64 x i8]* %5 to i8*
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = load %struct.tm*, %struct.tm** %4
%11 = call i32 @strftime(i8* %8, i32 64, i8* %9, %struct.tm* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i8*, i8** %3
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [17 x i8] c"[%02d] '%s': %s\0A\00"
define void @my_strftime(i8* %0, %struct.tm* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @strftime(i8* %4, i32 64, i8* %0, %struct.tm* %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int align_of(void *);
int /*<<< orphan*/ printf(char *, void *, int);
void pr(void *addr) { printf("%p : %d\n", addr, 1 << align_of(addr)); }


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <align_of@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <align_of@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%p : %d\0A\00"
define void @pr(i8* %0) {
%2 = tail call i32 @align_of(i8* %0)
%3 = shl nuw i32 1, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
int test_imm_15int16_mem(short *val) {
  return ((*val) & (-0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffeb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_15int16_mem>:
movzwl (%rdi),%eax
test   $0xffeb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_15int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -21
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ls_int_compare(const void *key1, const void *key2) {
  long i1 = (long)key1;
  long i2 = (long)key2;
  if (i1 < i2) {
    return -1;
  }
  return (i1 == i2 ? 0 : 1);
}


x86 assembly (clang, -O0):
<ls_int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1136 <ls_int_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <ls_int_compare+0x4e>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_int_compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ls_int_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void client_meters_finish_program(void) { int empty = 1; }


x86 assembly (clang, -O0):
<client_meters_finish_program>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @client_meters_finish_program() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f(int x) { puts("Hello!"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello!\00"
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
define void @f(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToSndModule(int, char *, int /*<<< orphan*/ *);
int mgrVolumeDown(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToSndModule((8006), "/audio_out/volume/down", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<mgrVolumeDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1f46,%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrVolumeDown>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1f46,%edi
xor    %edx,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/audio_out/volume/down\00"
define i32 @mgrVolumeDown(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToSndModule(i32 8006, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"/audio_out/volume/down\00"
define i32 @mgrVolumeDown(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToSndModule(i32 8006, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
/* Type definitions */
struct ip_usbph {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int ip_usbph_backlight(struct ip_usbph *);
int cmd_backlight(struct ip_usbph *ph, int argc, char **argv) {
  if (argc > 1) {
    return -EINVAL;
  }
  return ip_usbph_backlight(ph);
}


x86 assembly (clang, -O0):
<cmd_backlight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1140 <cmd_backlight+0x30>
xor    %eax,%eax
mov    0x2eaa(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <cmd_backlight+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <ip_usbph_backlight@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_backlight>:
cmp    $0x2,%esi
jl     1121 <cmd_backlight+0x11>
mov    0x2ec4(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret
jmp    1030 <ip_usbph_backlight@plt>

LLVM IR (-O0):
%struct.ip_usbph = type { i32 }
@EINVAL = global i32 0
define i32 @cmd_backlight(%struct.ip_usbph* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.ip_usbph*
%6 = alloca i32
%7 = alloca i8**
store %struct.ip_usbph* %0, %struct.ip_usbph** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
store i32 %12, i32* %4
br label %16
13: ; preds = %3
%14 = load %struct.ip_usbph*, %struct.ip_usbph** %5
%15 = call i32 @ip_usbph_backlight(%struct.ip_usbph* %14)
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.ip_usbph = type { i32 }
@EINVAL = global i32 0
define i32 @cmd_backlight(%struct.ip_usbph* %0, i32 %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %3
%9 = tail call i32 @ip_usbph_backlight(%struct.ip_usbph* %0)
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}
void b_NOP(void) { return; }


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

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

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

LLVM IR (-O2):
define void @b_NOP() {
ret void
}
int test_imm_67int64_lowword_reg(long long val) {
  return ((val) & (0x67 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_67int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 103
%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_67int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 103
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit_command() { exit(0); }


x86 assembly (clang, -O0):
<quit_command>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit_command>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @quit_command() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit_command() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ compare_decompose_pages();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ make_hfsplus_decompose_pages();
main() {
  make_hfsplus_decompose_pages();
  compare_decompose_pages();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <make_hfsplus_decompose_pages@plt>
mov    $0x0,%al
call   1040 <compare_decompose_pages@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <make_hfsplus_decompose_pages@plt>
xor    %eax,%eax
call   1040 <compare_decompose_pages@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @make_hfsplus_decompose_pages()
%3 = call i32 (...) @compare_decompose_pages()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @make_hfsplus_decompose_pages()
%2 = tail call i32 (...) @compare_decompose_pages()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int a(int x, int y) { return x ^ ((x ^ y) & -(x < y)); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
cmp    -0x8(%rbp),%edx
setl   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @a(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* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int htonl(int);
void buf_htonl(void *buf, int len) {
  int *buf_i = (int *)buf;
  for (int i = 0; i < (len / sizeof(int)) + 1; i++) {
    buf_i[i] = htonl(buf_i[i]);
  }
}


x86 assembly (clang, -O0):
<buf_htonl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jae    1172 <buf_htonl+0x62>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <htonl@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <buf_htonl+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_htonl>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
movslq %esi,%r14
shr    $0x2,%r14
add    $0x1,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,4),%edi
call   1030 <htonl@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <buf_htonl+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @buf_htonl(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = sext i32 %1 to i64
%5 = lshr i64 %4, 2
br label %7
6: ; preds = %7
ret void
7: ; preds = %2, %7
%8 = phi i64 [ 0, %2 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @htonl(i32 %10)
store i32 %11, i32* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %8, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xa3() {
  Assert_real((iscntrl(163) == 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_iscntrl.c",
              820, ("iscntrl should be 0 for 0xa3"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xa3>:
push   %rax
mov    $0xa3,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x334,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa3\00"
define void @t_iscntrl_0xa3() {
%1 = call i64 @iscntrl(i32 163)
%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 820, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa3\00"
define void @t_iscntrl_0xa3() {
%1 = tail call i64 @iscntrl(i32 163)
%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 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_dump(int /*<<< orphan*/);
int debug_dump_cb(void *data, const char *signal, const char *type_data,
                  void *signal_data) {
  (void)data;
  (void)signal;
  (void)type_data;
  (void)signal_data;
  debug_dump(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @debug_dump_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @debug_dump(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @debug_dump_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @debug_dump(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 7);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%r8d
mov    %r8d,%ecx
call   1030 <sprintf@plt>
lea    0x2eed(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0x7,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 7)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 7)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Variables and functions */
char *strstr(char const *, char *);
char *tl_search_nwk_rootcmd(const char *nwk) { return strstr(nwk, "[&"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"[&\00"
define i8* @tl_search_nwk_rootcmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"[&\00"
define i8* @tl_search_nwk_rootcmd(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}