xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void USBLPMIntDisable(uint32_t ui32Base, uint32_t ui32Ints) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000363))) &= ~ui32Ints;
}


x86 assembly (clang, -O0):
<USBLPMIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x363(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x363(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x363(%rcx)
ret

LLVM IR (-O0):
define void @USBLPMIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 867
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @USBLPMIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 867
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
unsigned int power(int base, unsigned int esponente) {
  if (esponente > 1) {
    base = base * base;
    esponente--;
    power(base, esponente);
  }
  return base;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jbe    1146 <power+0x36>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <power@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
cmp    $0x2,%esi
mov    $0x1,%eax
cmovae %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 1
%4 = select i1 %3, i32 %0, i32 1
%5 = mul nsw i32 %4, %0
ret i32 %5
}
int getSum(int bit_tree[], int index) {
  int sum = 0;
  index = index + 1;
  while (index > 0) {
    sum += bit_tree[index];
    index -= index & (-index);
  }
  return sum;
}


x86 assembly (clang, -O0):
<getSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114d <getSum+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    -0xc(%rbp),%eax
and    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <getSum+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSum>:
test   %esi,%esi
js     111f <getSum+0x1f>
add    $0x1,%esi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %esi,%ecx
add    (%rdi,%rcx,4),%eax
lea    -0x1(%rsi),%ecx
and    %esi,%ecx
mov    %ecx,%esi
jne    1110 <getSum+0x10>
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @db_scanning() {
ret i32 0
}
int supportsPAM(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @supportsPAM() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ buffer_cleanup();
int /*<<< orphan*/ endwin();
void view_close() {
  endwin();
  buffer_cleanup();
}


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

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

LLVM IR (-O0):
define void @view_close() {
%1 = call i32 (...) @endwin()
%2 = call i32 (...) @buffer_cleanup()
ret void
}

LLVM IR (-O2):
define void @view_close() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 (...) @buffer_cleanup()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ C_VSNPRINTF(char *, int, char *, int /*<<< orphan*/);
int main() {
  char *p;
  va_list ap;
  C_VSNPRINTF(p, 1, "", ap);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
lea    0xece(%rip),%rdx
call   1030 <C_VSNPRINTF@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x1,%esi
call   1030 <C_VSNPRINTF@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = load i8*, i8** %2
%5 = load i32, i32* %3
%6 = call i32 @C_VSNPRINTF(i8* %4, i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @C_VSNPRINTF(i8* undef, i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Out(int, int, char *);
void LCD_inputs_reset() {
  Lcd_Out(1, 1, "x =     ");
  Lcd_Out(1, 9, "y =     ");
}


x86 assembly (clang, -O0):
<LCD_inputs_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %esi,%edi
call   1030 <Lcd_Out@plt>
mov    $0x1,%edi
mov    $0x9,%esi
lea    0xed1(%rip),%rdx
call   1030 <Lcd_Out@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_inputs_reset>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <Lcd_Out@plt>
lea    0xedb(%rip),%rdx
mov    $0x1,%edi
mov    $0x9,%esi
pop    %rax
jmp    1030 <Lcd_Out@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"x = \00"
@.str.1 = [9 x i8] c"y = \00"
define void @LCD_inputs_reset() {
%1 = call i32 @Lcd_Out(i32 1, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Lcd_Out(i32 1, i32 9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"x = \00"
@.str.1 = [9 x i8] c"y = \00"
define void @LCD_inputs_reset() {
%1 = tail call i32 @Lcd_Out(i32 1, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Lcd_Out(i32 1, i32 9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ssc_input_clear_history(void) {}


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

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

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

LLVM IR (-O2):
define void @ssc_input_clear_history() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
char *malloc(int);
char *read(char *filename) {
  char *buffer = malloc(10000 * sizeof(char *));
  int i = 0;
  FILE *file;
  file = fopen(filename, "r");
  if (file != NULL)
    ;
  { i = fread(buffer, sizeof(char), 10000 * sizeof(char *), file); }
  fclose(file);
  return buffer;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x13880,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1185 <read+0x45>
jmp    1185 <read+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x13880,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x13880,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
lea    0xea4(%rip),%rsi
mov    %r14,%rdi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x13880,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @read(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %2
%6 = call i8* @malloc(i32 80000)
store i8* %6, i8** %3
store i32 0, i32* %4
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %1
%13 = load i8*, i8** %3
%14 = load i32*, i32** %5
%15 = call i32 @fread(i8* %13, i32 1, i32 80000, i32* %14)
store i32 %15, i32* %4
%16 = load i32*, i32** %5
%17 = call i32 @fclose(i32* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i8* @read(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(80000) i8* @malloc(i32 80000)
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fread(i8* %2, i32 1, i32 80000, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void startTimers(time_t *wallClock, clock_t *cpuClock) {
  *wallClock = time(NULL);
  *cpuClock = clock();
}


x86 assembly (clang, -O0):
<startTimers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startTimers>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @startTimers(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @time(i32* null)
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = call i32 (...) @clock()
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @startTimers(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %0
%4 = tail call i32 (...) @clock()
store i32 %4, i32* %1
ret void
}
/* Type definitions */
struct tracecmd_input {
  int dummy;
};

/* Variables and functions */
int do_read(struct tracecmd_input *, void *, int);
int do_read_check(struct tracecmd_input *handle, void *data, int size) {
  int ret;
  ret = do_read(handle, data, size);
  if (ret < 0)
    return ret;
  if (ret != size)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<do_read_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <do_read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    114b <do_read_check+0x3b>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <do_read_check+0x5a>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1163 <do_read_check+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <do_read_check+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_read_check>:
push   %rbx
mov    %edx,%ebx
call   1030 <do_read@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
neg    %ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tracecmd_input = type { i32 }
define i32 @do_read_check(%struct.tracecmd_input* %0, i8* %1, i32 %2) {
%4 = tail call i32 @do_read(%struct.tracecmd_input* %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
%6 = icmp ne i32 %4, %2
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 %4, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *safe_realloc(void *ptr, size_t size) {
  void *data = realloc(ptr, size);
  if (!data) {
    fprintf(stderr, "error: out of memory\n");
    exit(EXIT_FAILURE);
  }
  return data;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <safe_realloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <safe_realloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"error: out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @safe_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"error: out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterIntEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000010))) = 1;
}


x86 assembly (clang, -O0):
<I2CMasterIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntEnable>:
movq   $0x1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntEnable(i64 %0) {
%2 = add nsw i64 %0, 16
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
ret void
}
int omap_mux_enable_wakeup(char *muxname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_mux_enable_wakeup(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(int);
int isalnum_(int c) { return (isalnum(c) || c == '_'); }


x86 assembly (clang, -O0):
<isalnum_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <isalnum_+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum_>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalnum_(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isalnum_(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *arr, int length) {
  for (int i = 0; i < length; i++) {
    printf(" %d ", *(arr + i));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
int episodeLength(int episodeNum, int totalEpisodes) {
  if (episodeNum == totalEpisodes)
    return 30;
  else
    return 22;
}


x86 assembly (clang, -O0):
<episodeLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <episodeLength+0x22>
movl   $0x1e,-0x4(%rbp)
jmp    1129 <episodeLength+0x29>
movl   $0x16,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<episodeLength>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
lea    0x16(,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @episodeLength(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 30, i32* %3
br label %11
10: ; preds = %2
store i32 22, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @episodeLength(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i32 30, i32 22
ret i32 %4
}
__attribute__((always_)) void pgdat_resize_lock(struct pglist_data *p,
                                                unsigned long *f) {}


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

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

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

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @pgdat_resize_lock(%struct.pglist_data* nocapture %0, i64* nocapture %1) {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ perror(char *);
int is_dir(char *path) {
  struct stat buf;
  if (lstat(path, &buf) != 0) {
    perror("Error statting file ");
    return -1;
  } else
    return S_ISDIR(buf.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
je     116b <is_dir+0x3b>
lea    0xea6(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <is_dir+0x46>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
jne    1147 <is_dir+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
lea    0xeb2(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [21 x i8] c"Error statting file \00"
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @S_ISDIR(i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [21 x i8] c"Error statting file \00"
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @S_ISDIR(i32 %10)
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ -1, %6 ], [ %11, %8 ]
ret i32 %13
}
int YYID(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @YYID(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void *emitToConsole(void *dummy, char c) {
  putchar(c);
  return dummy;
}


x86 assembly (clang, -O0):
<emitToConsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitToConsole>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @emitToConsole(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i32 @putchar(i8 signext %5)
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @emitToConsole(i8* readnone returned %0, i8 signext %1) {
%3 = tail call i32 @putchar(i8 signext %1)
ret i8* %0
}
/* Type definitions */
struct b6_deque {
  int dummy;
};

/* Variables and functions */
scalar_t__ b6_deque_head(struct b6_deque const *);
scalar_t__ b6_deque_last(struct b6_deque const *);
int b6_deque_empty(const struct b6_deque *deque) {
  return b6_deque_head(deque) == b6_deque_last(deque);
}


x86 assembly (clang, -O0):
<b6_deque_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <b6_deque_head@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <b6_deque_last@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6_deque_empty>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <b6_deque_head@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <b6_deque_last@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.b6_deque = type { i32 }
define i32 @b6_deque_empty(%struct.b6_deque* %0) {
%2 = alloca %struct.b6_deque*
store %struct.b6_deque* %0, %struct.b6_deque** %2
%3 = load %struct.b6_deque*, %struct.b6_deque** %2
%4 = call i64 @b6_deque_head(%struct.b6_deque* %3)
%5 = load %struct.b6_deque*, %struct.b6_deque** %2
%6 = call i64 @b6_deque_last(%struct.b6_deque* %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.b6_deque = type { i32 }
define i32 @b6_deque_empty(%struct.b6_deque* %0) {
%2 = tail call i64 @b6_deque_head(%struct.b6_deque* %0)
%3 = tail call i64 @b6_deque_last(%struct.b6_deque* %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  while (1)
    sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Type definitions */
struct SBSocketChannelData {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct SBSocketChannelData *);
int sbsock_destroy_fd(void *_data) {
  struct SBSocketChannelData *data = (struct SBSocketChannelData *)_data;
  if (data) {
    free(data);
  }
  return 0;
}


x86 assembly (clang, -O0):
<sbsock_destroy_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <sbsock_destroy_fd+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbsock_destroy_fd>:
test   %rdi,%rdi
je     111f <sbsock_destroy_fd+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.SBSocketChannelData = type { i32 }
define i32 @sbsock_destroy_fd(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.SBSocketChannelData*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.SBSocketChannelData*
store %struct.SBSocketChannelData* %5, %struct.SBSocketChannelData** %3
%6 = load %struct.SBSocketChannelData*, %struct.SBSocketChannelData** %3
%7 = icmp ne %struct.SBSocketChannelData* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.SBSocketChannelData*, %struct.SBSocketChannelData** %3
%10 = call i32 @free(%struct.SBSocketChannelData* %9)
br label %11
11: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
%struct.SBSocketChannelData = type { i32 }
define i32 @sbsock_destroy_fd(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to %struct.SBSocketChannelData*
%5 = tail call i32 @free(%struct.SBSocketChannelData* %4)
br label %6
6: ; preds = %3, %1
ret i32 0
}
int __attribute__((no)) StackGrowthDirection(int *dummy1addr) {
  int dummy2;
  return (&dummy2 < dummy1addr) ? -1 : 1;
}


x86 assembly (clang, -O0):
<StackGrowthDirection>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StackGrowthDirection>:
lea    -0x4(%rsp),%rax
xor    %ecx,%ecx
cmp    %rdi,%rax
setae  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @StackGrowthDirection(i32* readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp ult i32* %2, %0
%5 = select i1 %4, i32 -1, i32 1
ret i32 %5
}
void crasher(void) {
  int *x = (int *)0x1234;
  *x = 12;
}


x86 assembly (clang, -O0):
<crasher>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crasher>:
movl   $0xc,0x1234
ret

LLVM IR (-O0):
define void @crasher() {
%1 = alloca i32*
store i32* inttoptr (i64 4660 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 12, i32* %2
ret void
}

LLVM IR (-O2):
define void @crasher() {
store i32 12, i32* inttoptr (i64 4660 to i32*)
ret void
}
double safe_div(double x, double y) { return y > 0 ? x / y : 0; }


x86 assembly (clang, -O0):
<safe_div>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1134 <safe_div+0x34>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1141 <safe_div+0x41>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1141 <safe_div+0x41>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_div>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    1112 <safe_div+0x12>
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @safe_div(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fdiv double %8, %9
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
%13 = phi double [ %10, %7 ], [ 0.000000e+00, %11 ]
ret double %13
}

LLVM IR (-O2):
define double @safe_div(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
%4 = fdiv double %0, %1
%5 = select i1 %3, double %4, double 0.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const, double const, double const);
void print_vec3(const double *v3) {
  printf("v3 = {%f, %f, %f}\n", v3[0], v3[1], v3[2]);
}


x86 assembly (clang, -O0):
<print_vec3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vec3>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"v3 = {%f, %f, %f}\0A\00"
define void @print_vec3(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %5, double %8, double %11)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"v3 = {%f, %f, %f}\0A\00"
define void @print_vec3(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6)
ret void
}
void foo206() {}


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

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

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

LLVM IR (-O2):
define void @foo206() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ ucase(char *);
int strUcmp(char *s1, char *s2) {
  char zwi1[32768];
  char zwi2[32768];
  strcpy(zwi1, s1);
  strcpy(zwi2, s2);
  ucase(zwi1);
  ucase(zwi2);
  return (strcmp(zwi1, zwi2));
}


x86 assembly (clang, -O0):
<strUcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x8010(%rbp),%rdi
call   1050 <ucase@plt>
lea    -0x10010(%rbp),%rdi
call   1050 <ucase@plt>
lea    -0x8010(%rbp),%rdi
lea    -0x10010(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strUcmp>:
push   %r15
push   %r14
push   %rbx
sub    $0x10000,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x8000(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <ucase@plt>
mov    %r15,%rdi
call   1050 <ucase@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
add    $0x10000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @strUcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [32768 x i8]
%6 = alloca [32768 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [32768 x i8], [32768 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [32768 x i8], [32768 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [32768 x i8], [32768 x i8]* %5, i64 0, i64 0
%14 = call i32 @ucase(i8* %13)
%15 = getelementptr inbounds [32768 x i8], [32768 x i8]* %6, i64 0, i64 0
%16 = call i32 @ucase(i8* %15)
%17 = getelementptr inbounds [32768 x i8], [32768 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [32768 x i8], [32768 x i8]* %6, i64 0, i64 0
%19 = call i32 @strcmp(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @strUcmp(i8* %0, i8* %1) {
%3 = alloca [32768 x i8]
%4 = alloca [32768 x i8]
%5 = getelementptr inbounds [32768 x i8], [32768 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [32768 x i8], [32768 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %0)
%8 = call i32 @strcpy(i8* %6, i8* %1)
%9 = call i32 @ucase(i8* %5)
%10 = call i32 @ucase(i8* %6)
%11 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %11
}
void output_dyn(code, pos) unsigned int code;
unsigned int pos;
{
  encode_c_dyn(code);
  if (code >= 0x100) {
    encode_p_st0(pos);
  }
}


x86 assembly (clang, -O0):
<output_dyn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <encode_c_dyn@plt>
cmpl   $0x100,-0x4(%rbp)
jb     114f <output_dyn+0x2f>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <encode_p_st0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_dyn>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <encode_c_dyn@plt>
cmp    $0x100,%ebp
jb     1145 <output_dyn+0x25>
mov    %ebx,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <encode_p_st0@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @output_dyn(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 = call i32 (i32, ...) bitcast (i32 (...)* @encode_c_dyn to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %3
%8 = icmp uge i32 %7, 256
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 (i32, ...) bitcast (i32 (...)* @encode_p_st0 to i32 (i32, ...)*)(i32 %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @output_dyn(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @encode_c_dyn to i32 (i32, ...)*)(i32 %0)
%4 = icmp ugt i32 %0, 255
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @encode_p_st0 to i32 (i32, ...)*)(i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
int cparse_str_empty(const char *str) { return !str || !*str; }


x86 assembly (clang, -O0):
<cparse_str_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1127 <cparse_str_empty+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cparse_str_empty>:
test   %rdi,%rdi
je     110e <cparse_str_empty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cparse_str_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cparse_str_empty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char const *, char);
int is_ipv6(const char *ip) { return !!strchr(ip, ':'); }


x86 assembly (clang, -O0):
<is_ipv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ipv6>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_ipv6(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strchr(i8* %3, i8 signext 58)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_ipv6(i8* %0) {
%2 = tail call i32 @strchr(i8* %0, i8 signext 58)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double ceil(double);
double Melder_roundUp(double x) { return ceil(x); }


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

x86 assembly (clang, -O2):
<Melder_roundUp>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @Melder_roundUp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @Melder_roundUp(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
bool fileExists(const char *filePath) {
  int r = access(filePath, F_OK);
  return (r != -1);
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @F_OK
%6 = call i32 @access(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @fileExists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
int maxFlow() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @maxFlow() {
ret i32 0
}