xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t list_meter_int16_t(const void *el) { return sizeof(int16_t); }


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

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

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

LLVM IR (-O2):
define i64 @list_meter_int16_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_dec_atRi(FILE *stream, unsigned char i) {
  fprintf(stream, "DEC   @R%X                       ", i);
}


x86 assembly (clang, -O0):
<fprint_dec_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_dec_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"DEC @R%X \00"
define void @fprint_dec_atRi(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"DEC @R%X \00"
define void @fprint_dec_atRi(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
int is_hex_digit(char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
         (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<is_hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_hex_digit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_digit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_hex_digit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_digit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_hex_digit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_hex_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_hex_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ DEC16(int /*<<< orphan*/, int);
void OpDEM0X0(void) { DEC16(AbsoluteIndexedXX0(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<OpDEM0X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <DEC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpDEM0X0>:
push   %rax
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <DEC16@plt>

LLVM IR (-O0):
define void @OpDEM0X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 3)
%2 = call i32 @DEC16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @OpDEM0X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 3)
%2 = tail call i32 @DEC16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SDL_getenv(char *);
int /*<<< orphan*/ SDL_putenv(char *);
int game_main(int, char **);
int main(int argc, char **argv) {
  if (!SDL_getenv("SDL_AUDIODRIVER")) {
    SDL_putenv("SDL_AUDIODRIVER=waveout");
  }
  return game_main(argc, argv);
}


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    0xeb3(%rip),%rdi
call   1040 <SDL_getenv@plt>
cmp    $0x0,%eax
jne    1167 <main+0x37>
lea    0xeae(%rip),%rdi
call   1050 <SDL_putenv@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <game_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1040 <SDL_getenv@plt>
test   %eax,%eax
jne    1154 <main+0x24>
lea    0xec1(%rip),%rdi
call   1050 <SDL_putenv@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <game_main@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"SDL_AUDIODRIVER\00"
@.str.1 = [24 x i8] c"SDL_AUDIODRIVER=waveout\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 @SDL_getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @SDL_putenv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @game_main(i32 %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"SDL_AUDIODRIVER\00"
@.str.1 = [24 x i8] c"SDL_AUDIODRIVER=waveout\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @SDL_getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @SDL_putenv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @game_main(i32 %0, i8** %1)
ret i32 %8
}
void debug_urb_completed(struct imx21 *imx21, struct urb *urb, int status) {}


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

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

LLVM IR (-O0):
%struct.imx21 = type opaque
%struct.urb = type opaque
define void @debug_urb_completed(%struct.imx21* %0, %struct.urb* %1, i32 %2) {
%4 = alloca %struct.imx21*
%5 = alloca %struct.urb*
%6 = alloca i32
store %struct.imx21* %0, %struct.imx21** %4
store %struct.urb* %1, %struct.urb** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.imx21 = type opaque
%struct.urb = type opaque
define void @debug_urb_completed(%struct.imx21* nocapture %0, %struct.urb* nocapture %1, i32 %2) {
ret void
}
long int labs(long int x) {
  if (x < 0) {
    return -1 * x;
  }
  return x;
}


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1121 <labs+0x21>
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1129 <labs+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int probably_works() {
  int x = 3;
  f(x);
}


x86 assembly (clang, -O0):
<probably_works>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probably_works>:
mov    $0x3,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @probably_works() {
%1 = tail call i32 @f(i32 3)
ret i32 undef
}
/* Variables and functions */
int syscall(int, int, char const *, int, char *);
int quotactl(int cmd, const char *special, int id, char *addr) {
  return syscall(131, cmd, special, id, addr);
}


x86 assembly (clang, -O0):
<quotactl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x83,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotactl>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x83,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @quotactl(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @syscall(i32 131, i32 %0, i8* %1, i32 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int *paging_findpte(int);
int paging_findphysaddr(int virtaddr) {
  int *pte = paging_findpte(virtaddr);
  int *physaddr = (int)pte & 0xFFFFF000;
  return (int)physaddr;
}


x86 assembly (clang, -O0):
<paging_findphysaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <paging_findpte@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffff000,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paging_findphysaddr>:
push   %rax
call   1030 <paging_findpte@plt>
and    $0xfffff000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @paging_findphysaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32* @paging_findpte(i32 %5)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i32
%9 = and i32 %8, -4096
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = ptrtoint i32* %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @paging_findphysaddr(i32 %0) {
%2 = tail call i32* @paging_findpte(i32 %0)
%3 = ptrtoint i32* %2 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, -4096
ret i32 %5
}
void cloog_finalize(void) {}


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

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

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

LLVM IR (-O2):
define void @cloog_finalize() {
ret void
}
int text_get_width(const char *text) {}


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

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

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

LLVM IR (-O2):
define i32 @text_get_width(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int sis_85c496_read(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ sis_85c496_write(int /*<<< orphan*/, int, int,
                                    int /*<<< orphan*/ *);
void sis_85c496_pci_reset(void) {
  uint8_t val = 0;
  val = sis_85c496_read(0, 0x44, NULL);
  sis_85c496_write(0, 0x44, val & 0xf, NULL);
}


x86 assembly (clang, -O0):
<sis_85c496_pci_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x44,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <sis_85c496_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf,%edx
xor    %edi,%edi
mov    $0x44,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <sis_85c496_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sis_85c496_pci_reset>:
push   %rax
xor    %edi,%edi
mov    $0x44,%esi
xor    %edx,%edx
call   1040 <sis_85c496_read@plt>
and    $0xf,%eax
xor    %edi,%edi
mov    $0x44,%esi
mov    %eax,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1030 <sis_85c496_write@plt>

LLVM IR (-O0):
define void @sis_85c496_pci_reset() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sis_85c496_read(i32 0, i32 68, i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 15
%5 = call i32 @sis_85c496_write(i32 0, i32 68, i32 %4, i32* null)
ret void
}

LLVM IR (-O2):
define void @sis_85c496_pci_reset() {
%1 = tail call i32 @sis_85c496_read(i32 0, i32 68, i32* null)
%2 = and i32 %1, 15
%3 = tail call i32 @sis_85c496_write(i32 0, i32 68, i32 %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ internal_func();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, void *);
int main() {
  printf("location of code  : %p\n", (void *)main);
  printf("location of heap  : %p\n", (void *)malloc(1));
  int x = 3;
  printf("location of stack : %p\n\n", (void *)&x);
  internal_func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    0x2e9b(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <internal_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    0x2ea9(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <malloc@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
movl   $0x3,0x4(%rsp)
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <internal_func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"location of code : %p\0A\00"
@.str.1 = [24 x i8] c"location of heap : %p\0A\00"
@.str.2 = [25 x i8] c"location of stack : %p\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* bitcast (i32 ()* @main to i8*))
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %5)
store i32 3, i32* %2
%7 = bitcast i32* %2 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 (...) @internal_func()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"location of code : %p\0A\00"
@.str.1 = [24 x i8] c"location of heap : %p\0A\00"
@.str.2 = [25 x i8] c"location of stack : %p\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* bitcast (i32 ()* @main to i8*))
%3 = tail call i64 @malloc(i32 1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @internal_func()
ret i32 0
}
int test_imm_E4int16_reg(short val) {
  return ((val) & (0xE4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E4int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E4int16_reg(i16 signext %0) {
%2 = and i16 %0, 228
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int volatile);
int main(int argc, char **argv) {
  int ordinary = 0;
  volatile int vol = 4;
  ordinary++;
  vol++;
  printf("%d\n", ordinary);
  printf("%d\n", vol);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0xc(%rsp)
addl   $0x1,0xc(%rsp)
lea    0xed7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 4, i32* %3
%5 = load volatile i32, i32* %3
%6 = add nsw i32 %5, 1
store volatile i32 %6, i32* %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = load volatile i32, i32* %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void SystemClear() { fputs("\033[2J\033[H", stdout); }


x86 assembly (clang, -O0):
<SystemClear>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemClear>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define void @SystemClear() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define void @SystemClear() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void serial_puts_nothing(const char *s) { return; }


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

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

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

LLVM IR (-O2):
define void @serial_puts_nothing(i8* nocapture %0) {
ret void
}
const char *Creator_createDeallocatorMethod(struct Creator *self) {
  const char *method = "void free_object( void* theObject )\n"
                       "{\n"
                       "\tstruct Instance* instance = theObject;\n"
                       "\tvoid*  original   = instance->_components[ 0 ];\n"
                       "\tvoid** pointer	  = &original;\n"
                       "\tvoid** components = instance->_components;\n"
                       "\tfree( original );\n"
                       "\tfree( components );\n"
                       "\t*pointer = NULL;\n"
                       "};\n";
  return method;
}


x86 assembly (clang, -O0):
<Creator_createDeallocatorMethod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Creator_createDeallocatorMethod>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.Creator = type opaque
@.str = [264 x i8] c"void free_object( void* theObject )\0A{\0A\09struct Instance* instance = theObject;\0A\09void* original = instance->_components[ 0 ];\0A\09void** pointer\09 = &original;\0A\09void** components = instance->_components;\0A\09free( original );\0A\09free( components );\0A\09*pointer = NULL;\0A};\0A\00"
define i8* @Creator_createDeallocatorMethod(%struct.Creator* %0) {
%2 = alloca %struct.Creator*
%3 = alloca i8*
store %struct.Creator* %0, %struct.Creator** %2
store i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
ret i8* %4
}

LLVM IR (-O2):
%struct.Creator = type opaque
@.str = [264 x i8] c"void free_object( void* theObject )\0A{\0A\09struct Instance* instance = theObject;\0A\09void* original = instance->_components[ 0 ];\0A\09void** pointer\09 = &original;\0A\09void** components = instance->_components;\0A\09free( original );\0A\09free( components );\0A\09*pointer = NULL;\0A};\0A\00"
define i8* @Creator_createDeallocatorMethod(%struct.Creator* nocapture readnone %0) {
ret i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ malloc(int);
void *func2(void *x) {
  int **p;
  p = (int **)malloc(sizeof(int *));
  *p = (int *)malloc(sizeof(int));
  if (*p) {
    **p = 1;
    **p = 10;
  }
  return (void *)0;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1166 <func2+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1136 <func2+0x26>
movl   $0xa,(%rax)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @func2(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32**
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = icmp eq i64 %4, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 10, i32* %5
br label %8
8: ; preds = %7, %1
ret i8* null
}
int test_imm_09int64_lowword_mem(long long *val) {
  return ((*val) & (0x09 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_09int64_lowword_mem>:
testb  $0x9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
char *getMemory1(char *p, int num) {
  p = (char *)malloc(num * sizeof(char));
  return p;
}


x86 assembly (clang, -O0):
<getMemory1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMemory1>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @getMemory1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @getMemory1(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i64 @malloc(i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void foo674(int p) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int read(int, char *, int);
int /*<<< orphan*/ writeMessageLog(struct messagelog *, char *, int);
int getWholeLog(int sd, struct messagelog *climsglog) {
  char readbuf[256];
  int readFromServer = 0;
  memset(readbuf, 0, 256);
  readFromServer = read(sd, readbuf, 256);
  writeMessageLog(climsglog, readbuf, readFromServer);
}


x86 assembly (clang, -O0):
<getWholeLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    %eax,-0x114(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
call   1050 <writeMessageLog@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWholeLog>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <writeMessageLog@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.messagelog = type { i32 }
define i32 @getWholeLog(i32 %0, %struct.messagelog* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.messagelog*
%6 = alloca [256 x i8]
%7 = alloca i32
store i32 %0, i32* %4
store %struct.messagelog* %1, %struct.messagelog** %5
store i32 0, i32* %7
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i32 0, i32 256)
%10 = load i32, i32* %4
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i32 @read(i32 %10, i8* %11, i32 256)
store i32 %12, i32* %7
%13 = load %struct.messagelog*, %struct.messagelog** %5
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%15 = load i32, i32* %7
%16 = call i32 @writeMessageLog(%struct.messagelog* %13, i8* %14, i32 %15)
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.messagelog = type { i32 }
define i32 @getWholeLog(i32 %0, %struct.messagelog* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = call i32 @read(i32 %0, i8* %4, i32 256)
%7 = call i32 @writeMessageLog(%struct.messagelog* %1, i8* %4, i32 %6)
ret i32 undef
}
int som_open(struct som *ann, const char *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.som = type opaque
define i32 @som_open(%struct.som* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int ebcdic_print_literally(void *baton, int c) {
  c &= 0xff;
  return (64 <= c && c <= 254);
}


x86 assembly (clang, -O0):
<ebcdic_print_literally>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    $0x40,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1136 <ebcdic_print_literally+0x36>
cmpl   $0xfe,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebcdic_print_literally>:
movzbl %sil,%eax
cmp    $0x40,%eax
setae  %cl
cmp    $0xff,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @ebcdic_print_literally(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 64, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 254
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ false, %2 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @ebcdic_print_literally(i8* nocapture readnone %0, i32 %1) {
%3 = and i32 %1, 255
%4 = icmp ugt i32 %3, 63
%5 = icmp ne i32 %3, 255
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
float __nv_erff(float);
float erff(float __a) { return __nv_erff(__a); }


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

x86 assembly (clang, -O2):
<erff>:
jmp    1030 <__nv_erff@plt>

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

LLVM IR (-O2):
define float @erff(float %0) {
%2 = tail call float @__nv_erff(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ schedule();
__attribute__((always_)) int bdi_sched_wait(void *word) {
  schedule();
  return 0;
}


x86 assembly (clang, -O0):
<bdi_sched_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <schedule@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bdi_sched_wait(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @schedule()
ret i32 0
}

LLVM IR (-O2):
define i32 @bdi_sched_wait(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @schedule()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int arduino_read_rtc(int, unsigned long *, int, int);
int arduino_read_time(int client, time_t *time) {
  unsigned long itime;
  int ret;
  ret = arduino_read_rtc(client, &itime, 0x00, 4);
  if (!ret)
    *time = (time_t)itime;
  return ret;
}


x86 assembly (clang, -O0):
<arduino_read_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <arduino_read_rtc@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114a <arduino_read_time+0x3a>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arduino_read_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <arduino_read_rtc@plt>
test   %eax,%eax
jne    1135 <arduino_read_time+0x25>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @arduino_read_time(i32 %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @arduino_read_rtc(i32 %0, i64* %3, i32 0, i32 4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %3
store i64 %8, i64* %1
br label %9
9: ; preds = %7, %2
ret i32 %5
}
/* Variables and functions */
size_t sas_rle_measure_copy_run(size_t copy_run) {
  if (copy_run > 64) {
    return 2 + copy_run;
  }
  if (copy_run > 0) {
    return 1 + copy_run;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sas_rle_measure_copy_run>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x40,-0x10(%rbp)
jbe    1124 <sas_rle_measure_copy_run+0x24>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <sas_rle_measure_copy_run+0x48>
cmpq   $0x0,-0x10(%rbp)
jbe    1140 <sas_rle_measure_copy_run+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <sas_rle_measure_copy_run+0x48>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_rle_measure_copy_run>:
lea    0x1(%rdi),%rax
test   %rdi,%rdi
cmove  %rdi,%rax
lea    0x2(%rdi),%rcx
cmp    $0x41,%rdi
cmovae %rcx,%rax
ret

LLVM IR (-O0):
define i64 @sas_rle_measure_copy_run(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ugt i64 %4, 64
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = add i64 2, %7
store i64 %8, i64* %2
br label %16
9: ; preds = %1
%10 = load i64, i64* %3
%11 = icmp ugt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i64, i64* %3
%14 = add i64 1, %13
store i64 %14, i64* %2
br label %16
15: ; preds = %9
store i64 0, i64* %2
br label %16
16: ; preds = %15, %12, %6
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @sas_rle_measure_copy_run(i64 %0) {
%2 = icmp ugt i64 %0, 64
%3 = add i64 %0, 2
%4 = icmp eq i64 %0, 0
%5 = add i64 %0, 1
%6 = select i1 %4, i64 0, i64 %5
%7 = select i1 %2, i64 %3, i64 %6
ret i64 %7
}
/* Variables and functions */
char *am_malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *am_strndup(const char *str, int len) {
  char *buf = NULL;
  if (str && *str) {
    buf = am_malloc(len + 1);
    memcpy(buf, str, len);
    buf[len] = '\0';
  }
  return buf;
}


x86 assembly (clang, -O0):
<am_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117d <am_strndup+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117d <am_strndup+0x5d>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <am_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_strndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1159 <am_strndup+0x39>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1159 <am_strndup+0x39>
mov    %esi,%r14d
lea    0x1(%r14),%edi
call   1040 <am_malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
movslq %r14d,%rax
movb   $0x0,(%r15,%rax,1)
jmp    115c <am_strndup+0x3c>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @am_strndup(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = add nsw i32 %1, 1
%9 = tail call i8* @am_malloc(i32 %8)
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %1)
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %7, %4, %2
%14 = phi i8* [ %9, %7 ], [ null, %4 ], [ null, %2 ]
ret i8* %14
}
/* Variables and functions */
int is_missing_seq(char *expect_buf_idx __attribute__((unused)),
                   char *expect_buf_end __attribute__((unused)),
                   char *actual_buf_idx __attribute__((unused)),
                   char *actual_buf_end __attribute__((unused)),
                   size_t *missing_len __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<is_missing_seq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_missing_seq(i8* %0, i8* %1, i8* %2, i8* %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i64* %4, i64** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @is_missing_seq(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i64* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mt_check();
scalar_t__ mt_random();
double mt_normalize(void) {
  mt_check();
  return (double)((double)mt_random() / (double)2147483648);
}


x86 assembly (clang, -O0):
<mt_normalize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mt_check@plt>
mov    $0x0,%al
call   1030 <mt_random@plt>
cvtsi2sd %rax,%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_normalize>:
push   %rax
xor    %eax,%eax
call   1040 <mt_check@plt>
xor    %eax,%eax
call   1030 <mt_random@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xec4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_normalize() {
%1 = call i32 (...) @mt_check()
%2 = call i64 (...) @mt_random()
%3 = sitofp i64 %2 to double
%4 = fdiv double %3, 0x41E0000000000000
ret double %4
}

LLVM IR (-O2):
define double @mt_normalize() {
%1 = tail call i32 (...) @mt_check()
%2 = tail call i64 (...) @mt_random()
%3 = sitofp i64 %2 to double
%4 = fmul double %3, 0x3E00000000000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ set_bridge_cfg_value(long, long);
long strtoul(char *, int /*<<< orphan*/, int);
int cli_br_maxage(int argc, char **argv) {
  long value = 20L;
  value = strtoul(argv[1], 0, 10);
  set_bridge_cfg_value(value, (1L << 2));
  return 0;
}


x86 assembly (clang, -O0):
<cli_br_maxage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x14,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1030 <set_bridge_cfg_value@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_br_maxage>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    $0x4,%esi
mov    %rax,%rdi
call   1030 <set_bridge_cfg_value@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cli_br_maxage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 20, i64* %5
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @strtoul(i8* %8, i32 0, i32 10)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i32 @set_bridge_cfg_value(i64 %10, i64 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @cli_br_maxage(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtoul(i8* %4, i32 0, i32 10)
%6 = tail call i32 @set_bridge_cfg_value(i64 %5, i64 4)
ret i32 0
}
__attribute__((always_)) unsigned int i386_get_stack_segment() {
  int x;
  asm volatile("movl	%%ss, %0" : "=r"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<i386_get_stack_segment>:
mov    %ss,%eax
ret

LLVM IR (-O0):
define i32 @i386_get_stack_segment() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl\09%ss, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @i386_get_stack_segment() {
%1 = tail call i32 asm sideeffect "movl\09%ss, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
double M_PI;
double fmod(double, double);
double sin(double);
double MAP_CIRCLE(double x_n, int iteration) {
  return (
      fmod(x_n + 0.2 - (0.5 / (2.0 * M_PI)) * (sin(2.0 * M_PI * x_n)), 1.0));
}


x86 assembly (clang, -O0):
<MAP_CIRCLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xee0(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xebe(%rip),%xmm1
mov    0x2e97(%rip),%rax
mulsd  (%rax),%xmm1
movsd  0xeb3(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9a(%rip),%xmm0
mov    0x2e73(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe49(%rip),%xmm1
call   1030 <fmod@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP_CIRCLE>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    0x2eab(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  0xeac(%rip),%xmm1
divsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0xe9c(%rip),%xmm1
add    $0x18,%rsp
jmp    1030 <fmod@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @MAP_CIRCLE(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fadd double %5, 2.000000e-01
%7 = load double, double* @M_PI
%8 = fmul double 2.000000e+00, %7
%9 = fdiv double 5.000000e-01, %8
%10 = load double, double* @M_PI
%11 = fmul double 2.000000e+00, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = call double @sin(double %13)
%15 = fneg double %9
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %6)
%17 = call double @fmod(double %16, double 1.000000e+00)
ret double %17
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @MAP_CIRCLE(double %0, i32 %1) {
%3 = fadd double %0, 2.000000e-01
%4 = load double, double* @M_PI
%5 = fmul double %4, 2.000000e+00
%6 = fmul double %5, %0
%7 = tail call double @sin(double %6)
%8 = fdiv double -5.000000e-01, %5
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %3)
%10 = tail call double @fmod(double %9, double 1.000000e+00)
ret double %10
}
void mcm_parse_shutdown(struct mcm_service_session_t *this_session) {}


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

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

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

LLVM IR (-O2):
%struct.mcm_service_session_t = type opaque
define void @mcm_parse_shutdown(%struct.mcm_service_session_t* nocapture %0) {
ret void
}