xunge/DecIR huggingface dataset:
/* Variables and functions */
void fill_buf(char *buf, size_t size) {
  static char value = '0';
  size_t i = 0;
  for (i = 0; i < size; i++) {
    buf[i] = value;
  }
  value++;
}


x86 assembly (clang, -O0):
<fill_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114c <fill_buf+0x4c>
mov    0x2ef0(%rip),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <fill_buf+0x1c>
mov    0x2ece(%rip),%al
add    $0x1,%al
mov    %al,0x2ec6(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buf>:
push   %rbx
mov    0x2f11(%rip),%bl
test   %rsi,%rsi
je     1127 <fill_buf+0x17>
mov    %rsi,%rdx
movzbl %bl,%esi
call   1030 <memset@plt>
add    $0x1,%bl
mov    %bl,0x2ef8(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@fill_buf.value = internal global i8 48
define void @fill_buf(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8, i8* @fill_buf.value
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 %11, i8* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %6
18: ; preds = %6
%19 = load i8, i8* @fill_buf.value
%20 = add i8 %19, 1
store i8 %20, i8* @fill_buf.value
ret void
}

LLVM IR (-O2):
@fill_buf.value = internal unnamed_addr global i8 48
define void @fill_buf(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = load i8, i8* @fill_buf.value
br i1 %3, label %6, label %5
5: ; preds = %2
br label %6
6: ; preds = %2, %5
%7 = add i8 %4, 1
store i8 %7, i8* @fill_buf.value
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_slice_buffer_adjust_tail_space() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_slice_buffer_adjust_tail_space>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_adjust_tail_space() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_adjust_tail_space() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void hDpVectFree(double *arr, int len) {
  int i;
  free(arr);
}


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

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

LLVM IR (-O0):
define void @hDpVectFree(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = call i32 @free(double* %6)
ret void
}

LLVM IR (-O2):
define void @hDpVectFree(double* nocapture %0, i32 %1) {
%3 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ change(int **);
int /*<<< orphan*/ derefI(int *);
void changeBefore(int *y) {
  change(&y);
  derefI(y);
}


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

x86 assembly (clang, -O2):
<changeBefore>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <change@plt>
mov    (%rsp),%rdi
call   1040 <derefI@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @changeBefore(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @change(i32** %2)
%4 = load i32*, i32** %2
%5 = call i32 @derefI(i32* %4)
ret void
}
void SPUabout(void) {}


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

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

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

LLVM IR (-O2):
define void @SPUabout() {
ret void
}
int condition_hyphen(char c) { return c == '-'; }


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

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

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

LLVM IR (-O2):
define i32 @condition_hyphen(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x05() {
  Assert_real((isalnum(5) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              30, ("isalnum should be 0 for 0x05"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x05\00"
define void @t_isalnum_0x05() {
%1 = call i64 @isalnum(i32 5)
%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 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x05\00"
define void @t_isalnum_0x05() {
%1 = tail call i64 @isalnum(i32 5)
%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 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void const *be2ne(void *, size_t);
void *memscan(void *, void const *, size_t);
const void *swapped_memscan(void *dest, const void *src, size_t n) {
  const void *ret = memscan(dest, src, n);
  return be2ne(dest, n), ret;
}


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

x86 assembly (clang, -O2):
<swapped_memscan>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memscan@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <be2ne@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @swapped_memscan(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @memscan(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i8* @be2ne(i8* %12, i64 %13)
%15 = load i8*, i8** %7
ret i8* %15
}

LLVM IR (-O2):
define i8* @swapped_memscan(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @memscan(i8* %0, i8* %1, i64 %2)
%5 = tail call i8* @be2ne(i8* %0, i64 %2)
ret i8* %4
}
void delay_tick(int count) {
  int i;
  while (count > 0) {
    for (i = 0; i < 100; i++)
      ;
    count--;
  };
}


x86 assembly (clang, -O0):
<delay_tick>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <delay_tick+0x43>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1135 <delay_tick+0x35>
jmp    1127 <delay_tick+0x27>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <delay_tick+0x18>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay_tick+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_tick(i32 %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int embed_standard_system(int d) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc(66, &d, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<embed_standard_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x42,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @embed_standard_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 66, i32* %2, i32* undef, double* undef)
ret i32 %3
}
void XMapRaised() {}


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

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

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

LLVM IR (-O2):
define void @XMapRaised() {
ret void
}
void ifcounts_destroy(struct ifcounts *ifcounts __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
%struct.ifcounts = type opaque
define void @ifcounts_destroy(%struct.ifcounts* nocapture %0) {
ret void
}
int function(void) {
  static int i, state = 0;
  switch (state) {
  case 0:
    for (i = 0; i < 10; i++) {
      state = 1;
      return i;
    case 1:;
    }
  }
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <function+0x2b>
jmp    111a <function+0x1a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     115a <function+0x5a>
jmp    1178 <function+0x78>
movl   $0x0,0x2eef(%rip)
cmpl   $0xa,0x2ee8(%rip)
jge    1173 <function+0x73>
movl   $0x1,0x2edc(%rip)
mov    0x2ed2(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <function+0x78>
jmp    115f <function+0x5f>
mov    0x2ebf(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eb6(%rip)
jmp    1135 <function+0x35>
jmp    1178 <function+0x78>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    0x2f1e(%rip),%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmpb   $0x0,0x2f16(%rip)
cmovne %ecx,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x9,%eax
jg     1127 <function+0x27>
movb   $0x1,0x2f01(%rip)
ret

LLVM IR (-O0):
@function.i = internal global i32 0
@function.state = internal global i32 0
define i32 @function() {
%1 = alloca i32
%2 = load i32, i32* @function.state
switch i32 %2, label %14 [
i32 0, label %3
i32 1, label %9
]
3: ; preds = %0
store i32 0, i32* @function.i
br label %4
4: ; preds = %10, %3
%5 = load i32, i32* @function.i
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
store i32 1, i32* @function.state
%8 = load i32, i32* @function.i
store i32 %8, i32* %1
br label %14
9: ; preds = %0
br label %10
10: ; preds = %9
%11 = load i32, i32* @function.i
%12 = add nsw i32 %11, 1
store i32 %12, i32* @function.i
br label %4
13: ; preds = %4
br label %14
14: ; preds = %7, %13, %0
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@function.i = internal unnamed_addr global i32 0
@function.state = internal unnamed_addr global i1 false
define i32 @function() {
%1 = load i1, i1* @function.state
%2 = load i32, i32* @function.i
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @function.i
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @function.state
br label %7
7: ; preds = %0, %6
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int /*<<< orphan*/, int, int /*<<< orphan*/);
void write_bus(uint8_t address, uint16_t value) {
  write_word_data(address, 0x12, value);
}


x86 assembly (clang, -O0):
<write_bus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x12,%esi
call   1030 <write_word_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bus>:
mov    %esi,%edx
mov    $0x12,%esi
jmp    1030 <write_word_data@plt>

LLVM IR (-O0):
define void @write_bus(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 @write_word_data(i32 %5, i32 18, i32 %6)
ret void
}

LLVM IR (-O2):
define void @write_bus(i32 %0, i32 %1) {
%3 = tail call i32 @write_word_data(i32 %0, i32 18, i32 %1)
ret void
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_edge(struct graph *, int, int);
void remove_edge_triple(struct graph *g, int a, int b) {
  remove_edge(g, a, b);
  remove_edge(g, a, b);
  remove_edge(g, a, b);
}


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

x86 assembly (clang, -O2):
<remove_edge_triple>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <remove_edge@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <remove_edge@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <remove_edge@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @remove_edge_triple(%struct.graph* %0, i32 %1, i32 %2) {
%4 = alloca %struct.graph*
%5 = alloca i32
%6 = alloca i32
store %struct.graph* %0, %struct.graph** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.graph*, %struct.graph** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @remove_edge(%struct.graph* %7, i32 %8, i32 %9)
%11 = load %struct.graph*, %struct.graph** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @remove_edge(%struct.graph* %11, i32 %12, i32 %13)
%15 = load %struct.graph*, %struct.graph** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @remove_edge(%struct.graph* %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @remove_edge_triple(%struct.graph* %0, i32 %1, i32 %2) {
%4 = tail call i32 @remove_edge(%struct.graph* %0, i32 %1, i32 %2)
%5 = tail call i32 @remove_edge(%struct.graph* %0, i32 %1, i32 %2)
%6 = tail call i32 @remove_edge(%struct.graph* %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *dc_localtime_r(const time_t *t, struct tm *tm) {
  struct tm *p = localtime(t);
  if (p == NULL)
    return NULL;
  if (tm)
    *tm = *p;
  return tm;
}


x86 assembly (clang, -O0):
<dc_localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <dc_localtime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1164 <dc_localtime_r+0x54>
cmpq   $0x0,-0x18(%rbp)
je     115c <dc_localtime_r+0x4c>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rbx,%rbx
je     112f <dc_localtime_r+0x1f>
test   %rcx,%rcx
je     112f <dc_localtime_r+0x1f>
mov    (%rcx),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @dc_localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @localtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = icmp eq %struct.tm* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.tm* null, %struct.tm** %3
br label %22
12: ; preds = %2
%13 = load %struct.tm*, %struct.tm** %5
%14 = icmp ne %struct.tm* %13, null
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load %struct.tm*, %struct.tm** %5
%17 = load %struct.tm*, %struct.tm** %6
%18 = bitcast %struct.tm* %16 to i8*
%19 = bitcast %struct.tm* %17 to i8*
br label %20
20: ; preds = %15, %12
%21 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %21, %struct.tm** %3
br label %22
22: ; preds = %20, %11
%23 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %23
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @dc_localtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
%5 = icmp eq %struct.tm* %1, null
%6 = or i1 %5, %4
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%9 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
br label %11
11: ; preds = %7, %2
%12 = phi %struct.tm* [ null, %2 ], [ %1, %7 ]
ret %struct.tm* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("Hello from foo!"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from foo!\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from foo!\00"
define void @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ in;

/* Variables and functions */
uint32_t swap32_a(uint32_t in) {
  return ((uint32_t)((((uint32_t)(in) & (uint32_t)0x000000ffUL) << 24) |
                     (((uint32_t)(in) & (uint32_t)0x0000ff00UL) << 8) |
                     (((uint32_t)(in) & (uint32_t)0x00ff0000UL) >> 8) |
                     (((uint32_t)(in) & (uint32_t)0xff000000UL) >> 24)));
}


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

x86 assembly (clang, -O2):
<swap32_a>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @swap32_a(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, int);
void pushpointer8_(char *ppp) { pushNarray(ppp, 8); }


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

x86 assembly (clang, -O2):
<pushpointer8_>:
mov    $0x8,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushpointer8_(i8* %0) {
%2 = tail call i32 @pushNarray(i8* %0, i32 8)
ret void
}
unsigned int get_ushort_m(const unsigned char *buf_ptr) {
  return ((unsigned int)buf_ptr[0] << 8) + ((unsigned int)buf_ptr[1]);
}


x86 assembly (clang, -O0):
<get_ushort_m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ushort_m>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get_ushort_m(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_ushort_m(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ formatWriteRead();
int main() {
  formatWriteRead();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @formatWriteRead()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __CONST_SOCKADDR_ARG;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int __libc_connect(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
int __attribute__((weak))
connect(int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) {
  int result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_connect(fd, addr, len);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x14(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <__libc_connect@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <__libc_connect@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @connect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @__libc_connect(i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @connect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_connect(i32 %0, i32 %1, i32 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
int foo(int a, int b) {
  if (a)
    return 1;
  {
    int s[b];
    return 0;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1124 <foo+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1140 <foo+0x40>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void WatchdogResetDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<WatchdogResetDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogResetDisable>:
andq   $0xfffffffffffffffd,0x8(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogResetDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogResetDisable(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -3
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x60() {
  Assert_real((isodigit(96) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              485, ("isodigit should be 0 for `"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for `\00"
define void @t_isodigit_0x60() {
%1 = call i64 @isodigit(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for `\00"
define void @t_isodigit_0x60() {
%1 = tail call i64 @isodigit(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t __attribute__((weak)) _sbrk(int incr) {
  extern char _end;
  static char *heap_end = 0;
  char *prev_heap_end;
  if (heap_end == 0)
    heap_end = &_end;
  prev_heap_end = heap_end;
  heap_end += incr;
  return (caddr_t)prev_heap_end;
}


x86 assembly (clang, -O0):
<_sbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpq   $0x0,0x2f19(%rip)
jne    1123 <_sbrk+0x23>
mov    0x2ecc(%rip),%rax
mov    %rax,0x2f05(%rip)
mov    0x2efe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ef0(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2ee3(%rip)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sbrk>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
jne    1113 <_sbrk+0x13>
mov    0x2ed5(%rip),%rax
movslq %edi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f08(%rip)
ret

LLVM IR (-O0):
@_sbrk.heap_end = internal global i8* null
@_end = external global i8
define weak i32 @_sbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i8*, i8** @_sbrk.heap_end
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* @_end, i8** @_sbrk.heap_end
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** @_sbrk.heap_end
store i8* %8, i8** %3
%9 = load i32, i32* %2
%10 = load i8*, i8** @_sbrk.heap_end
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** @_sbrk.heap_end
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@_sbrk.heap_end = internal unnamed_addr global i8* null
@_end = external global i8
define weak i32 @_sbrk(i32 %0) {
%2 = load i8*, i8** @_sbrk.heap_end
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* @_end, i8* %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8* %6, i8** @_sbrk.heap_end
%7 = ptrtoint i8* %4 to i64
%8 = trunc i64 %7 to i32
ret i32 %8
}
int mem_is_zero(const void *mem, int size) {
  const char *p = mem;
  int i;
  for (i = 0; i < size; i++) {
    if (p[i] != 0x00)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<mem_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <mem_is_zero+0x5a>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1147 <mem_is_zero+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1161 <mem_is_zero+0x61>
jmp    114c <mem_is_zero+0x4c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111a <mem_is_zero+0x1a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_is_zero>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <mem_is_zero+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,(%rdi,%rdx,1)
jne    1120 <mem_is_zero+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <mem_is_zero+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mem_is_zero(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
void gtk_toggle_button_get_mode() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_button_get_mode() {
ret void
}
/* Variables and functions */
int close(int);
int stx_queue_close(int queue) { return close(queue); }


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

x86 assembly (clang, -O2):
<stx_queue_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @stx_queue_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int pointers_to_pointers(int **ipp, int **ipp2) {
  int *p = *ipp;
  int *p2 = *ipp2;
  *p = 5;
  *p2 = 10;
  return **ipp;
}


x86 assembly (clang, -O0):
<pointers_to_pointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointers_to_pointers>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
movl   $0x5,(%rax)
movl   $0xa,(%rcx)
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @pointers_to_pointers(i32** %0, i32** %1) {
%3 = alloca i32**
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i32*
store i32** %0, i32*** %3
store i32** %1, i32*** %4
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
store i32* %8, i32** %5
%9 = load i32**, i32*** %4
%10 = load i32*, i32** %9
store i32* %10, i32** %6
%11 = load i32*, i32** %5
store i32 5, i32* %11
%12 = load i32*, i32** %6
store i32 10, i32* %12
%13 = load i32**, i32*** %3
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @pointers_to_pointers(i32** nocapture %0, i32** nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32*, i32** %1
store i32 5, i32* %3
store i32 10, i32* %4
%5 = load i32, i32* %3
ret i32 %5
}
void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
                                  const struct b43legacy_txstatus *status) {}


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

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

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

LLVM IR (-O2):
%struct.b43legacy_wldev = type opaque
%struct.b43legacy_txstatus = type opaque
define void @b43legacy_debugfs_log_txstat(%struct.b43legacy_wldev* nocapture %0, %struct.b43legacy_txstatus* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ usleep(int);
void end(int status) {
  usleep(100000);
  exit(status);
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x186a0,%edi
call   1040 <usleep@plt>
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<end>:
push   %rbx
mov    %edi,%ebx
mov    $0x186a0,%edi
call   1040 <usleep@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @usleep(i32 100000)
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @end(i32 %0) {
%2 = tail call i32 @usleep(i32 100000)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
unsigned int getpid();
int /*<<< orphan*/ srand(unsigned int);
unsigned int time(int /*<<< orphan*/ *);
void init_rand(void) {
  unsigned int init_v;
  init_v = time(NULL) + getpid();
  srand(init_v);
}


x86 assembly (clang, -O0):
<init_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rand>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <srand@plt>

LLVM IR (-O0):
define void @init_rand() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 (...) @getpid()
%4 = add i32 %2, %3
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @srand(i32 %5)
ret void
}

LLVM IR (-O2):
define void @init_rand() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @getpid()
%3 = add i32 %2, %1
%4 = tail call i32 @srand(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
int main() {
  char *str1 = "Hello World";
  char *str2 = "Hello Dave";
  return !memcmp(str1, str2, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [11 x i8] c"Hello Dave\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @memcmp(i8* %4, i8* %5, i32 5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [11 x i8] c"Hello Dave\00"
define i32 @main() {
%1 = tail call i32 @memcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putc(char const);
void terminal_write(const char *data, size_t size) {
  for (size_t i = 0; i < size; i++)
    putc(data[i]);
}


x86 assembly (clang, -O0):
<terminal_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <terminal_write+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <terminal_write+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_write>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <terminal_write+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putc@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <terminal_write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @terminal_write(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putc(i8 signext %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @terminal_write(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @putc(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
int emac2_aalignmenterrors_set(unsigned int dev_id,
                               union emac2_aalignmenterrors_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac2_aalignmenterrors_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac2_aalignmenterrors_u = type opaque
define i32 @emac2_aalignmenterrors_set(i32 %0, %union.emac2_aalignmenterrors_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_aalignmenterrors_u*
store i32 %0, i32* %3
store %union.emac2_aalignmenterrors_u* %1, %union.emac2_aalignmenterrors_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_aalignmenterrors_u = type opaque
define i32 @emac2_aalignmenterrors_set(i32 %0, %union.emac2_aalignmenterrors_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ popAdd();
int /*<<< orphan*/ term();
void add() {
  match('+');
  term();
  popAdd();
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1030 <term@plt>
mov    $0x0,%al
call   1050 <popAdd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rax
mov    $0x2b,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1030 <term@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <popAdd@plt>

LLVM IR (-O0):
define void @add() {
%1 = call i32 @match(i8 signext 43)
%2 = call i32 (...) @term()
%3 = call i32 (...) @popAdd()
ret void
}

LLVM IR (-O2):
define void @add() {
%1 = tail call i32 @match(i8 signext 43)
%2 = tail call i32 (...) @term()
%3 = tail call i32 (...) @popAdd()
ret void
}