xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void cliprint_version(void) { printf("%s version %s\n", "omping", "0.0.5"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [7 x i8] c"omping\00"
@.str.2 = [6 x i8] c"0.0.5\00"
define void @cliprint_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [7 x i8] c"omping\00"
@.str.2 = [6 x i8] c"0.0.5\00"
define void @cliprint_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void directory_make(char *parent, char *name, int mode, int panic) {
  parent = parent;
  name = name;
  mode = mode;
  panic = panic;
}


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

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

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

LLVM IR (-O2):
define void @directory_make(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2(double);
void func1(int x) {
  int i = 1;
  float z = 0.1;
  float y = 0.2;
  func2(0.1);
  func2(0.2);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
call   1030 <func2@plt>
movsd  0xeaf(%rip),%xmm0
call   1030 <func2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <func2@plt>
movsd  0xee2(%rip),%xmm0
pop    %rax
jmp    1030 <func2@plt>

LLVM IR (-O0):
define void @func1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 %0, i32* %2
store i32 1, i32* %3
store float 0x3FB99999A0000000, float* %4
store float 0x3FC99999A0000000, float* %5
%6 = call i32 @func2(double 1.000000e-01)
%7 = call i32 @func2(double 2.000000e-01)
ret void
}

LLVM IR (-O2):
define void @func1(i32 %0) {
%2 = tail call i32 @func2(double 1.000000e-01)
%3 = tail call i32 @func2(double 2.000000e-01)
ret void
}
int sn3218_remove(struct i2c_client *client) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.i2c_client = type opaque
define i32 @sn3218_remove(%struct.i2c_client* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ OSSwapConstInt64(int /*<<< orphan*/);
uint64_t _OSSwapInt64(uint64_t data) { return OSSwapConstInt64(data); }


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

x86 assembly (clang, -O2):
<_OSSwapInt64>:
jmp    1030 <OSSwapConstInt64@plt>

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

LLVM IR (-O2):
define i32 @_OSSwapInt64(i32 %0) {
%2 = tail call i32 @OSSwapConstInt64(i32 %0)
ret i32 %2
}
extern double n1d1(int n1, double d1) { return n1 + d1; }


x86 assembly (clang, -O0):
<n1d1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n1d1>:
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @n1d1(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %4
%8 = fadd double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @n1d1(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, %1
ret double %4
}
void ADCResolutionSet(unsigned long ulBase, unsigned long ulResolution) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000038))) =
      ((*((volatile unsigned long *)(ulBase + 0x00000038))) & ~0x00000010) |
      ulResolution;
}


x86 assembly (clang, -O0):
<ADCResolutionSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rcx
and    $0xffffffffffffffef,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCResolutionSet>:
mov    0x38(%rdi),%rax
and    $0xffffffffffffffef,%rax
or     %rsi,%rax
mov    %rax,0x38(%rdi)
ret

LLVM IR (-O0):
define void @ADCResolutionSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 56
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -17
%10 = load i64, i64* %4
%11 = or i64 %9, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 56
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @ADCResolutionSet(i64 %0, i64 %1) {
%3 = add i64 %0, 56
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -17
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
void dispatch_atfork_prepare(void) {}


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

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

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

LLVM IR (-O2):
define void @dispatch_atfork_prepare() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(scalar_t__ *, int /*<<< orphan*/, size_t);
void mulrc2(uint8_t *region, uint8_t constant, size_t length) {
  if (constant == 0)
    memset(region, 0, length);
}


x86 assembly (clang, -O0):
<mulrc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <mulrc2+0x2e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulrc2>:
test   %rsi,%rsi
je     1116 <mulrc2+0x6>
ret
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @mulrc2(i64* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @memset(i64* %0, i32 0, i64 %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x69() {
  Assert_real((isascii(105)),
              "/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_isascii.c",
              530, ("isascii should be 1 for i"));
}


x86 assembly (clang, -O0):
<t_isascii_0x69>:
push   %rbp
mov    %rsp,%rbp
mov    $0x69,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x212,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x69>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x212,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for i\00"
define void @t_isascii_0x69() {
%1 = call i32 @isascii(i32 105)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 530, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for i\00"
define void @t_isascii_0x69() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
long filelength(FILE *fp) {
  long ende;
  fseek(fp, 0L, SEEK_END);
  ende = ftell(fp);
  rewind(fp);
  return ende;
}


x86 assembly (clang, -O0):
<filelength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelength>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @filelength(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @filelength(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i64 %4
}
int isin(char *arr, int size, int elem) {
  while (--size >= 0) {
    if (arr[size] == elem)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1146 <isin+0x46>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <isin+0x41>
movl   $0x1,-0x4(%rbp)
jmp    114d <isin+0x4d>
jmp    110e <isin+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isin>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1127 <isin+0x27>
movsbl -0x1(%rdi,%rax,1),%ecx
add    $0xffffffffffffffff,%rax
cmp    %edx,%ecx
jne    1110 <isin+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isin(i8* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
br label %5
5: ; preds = %10, %3
%6 = phi i64 [ %7, %10 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %0, i64 %7
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %5, %10
%16 = phi i32 [ 1, %10 ], [ 0, %5 ]
ret i32 %16
}
void led_out(unsigned int led_data) {
  *((volatile unsigned int *)0xfffff434) = 0x0000000f;
  led_data = led_data & 0x0000000f;
  *((volatile unsigned int *)0xfffff430) = led_data;
}


x86 assembly (clang, -O0):
<led_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xfffff434,%eax
movl   $0xf,(%rax)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xfffff430,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_out>:
mov    $0xfffff430,%eax
movl   $0xf,0x4(%rax)
and    $0xf,%edi
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @led_out(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i32 15, i32* inttoptr (i64 4294964276 to i32*)
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
store volatile i32 %5, i32* inttoptr (i64 4294964272 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_out(i32 %0) {
store volatile i32 15, i32* inttoptr (i64 4294964276 to i32*)
%2 = and i32 %0, 15
store volatile i32 %2, i32* inttoptr (i64 4294964272 to i32*)
ret void
}
char *xstrdup(const char *str) {
  void *p;
  p = xmalloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
void init_idt(void) {}


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

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

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

LLVM IR (-O2):
define void @init_idt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eval(int /*<<< orphan*/);
int /*<<< orphan*/ print(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void repl() {
  printf("\n>>> ");
  print(eval(read(stdin)));
  repl();
}


x86 assembly (clang, -O0):
<repl>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1060 <read@plt>
mov    %eax,%edi
call   1070 <eval@plt>
mov    %eax,%edi
call   1050 <print@plt>
call   1030 <repl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<repl>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
mov    0x2e96(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1050 <read@plt>
mov    %eax,%edi
call   1060 <eval@plt>
mov    %eax,%edi
call   1040 <print@plt>
jmp    1160 <repl+0x20>

LLVM IR (-O0):
@.str = [6 x i8] c"\0A>>> \00"
@stdin = global i32 0
define void @repl() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = call i32 @read(i32 %2)
%4 = call i32 @eval(i32 %3)
%5 = call i32 @print(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A>>> \00"
@stdin = global i32 0
define void @repl() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32 @read(i32 %3)
%5 = tail call i32 @eval(i32 %4)
%6 = tail call i32 @print(i32 %5)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int /*<<< orphan*/ *ASN1_item_d2i_fp(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
int /*<<< orphan*/ RSAPublicKey;
RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa) {
  return ASN1_item_d2i_fp(ASN1_ITEM_rptr(RSAPublicKey), fp, rsa);
}


x86 assembly (clang, -O0):
<d2i_RSAPublicKey_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ASN1_item_d2i_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_RSAPublicKey_fp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_item_d2i_fp@plt>

LLVM IR (-O0):
@RSAPublicKey = global i32 0
define i32* @d2i_RSAPublicKey_fp(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32, i32* @RSAPublicKey
%6 = call i32 @ASN1_ITEM_rptr(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32**, i32*** %4
%9 = call i32* @ASN1_item_d2i_fp(i32 %6, i32* %7, i32** %8)
ret i32* %9
}

LLVM IR (-O2):
@RSAPublicKey = global i32 0
define i32* @d2i_RSAPublicKey_fp(i32* %0, i32** %1) {
%3 = load i32, i32* @RSAPublicKey
%4 = tail call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = tail call i32* @ASN1_item_d2i_fp(i32 %4, i32* %0, i32** %1)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ xshutdown(int, int);
__attribute__((unused)) void xshutdown_if_not_broken(int socket, int how) {
  xshutdown(socket, how);
}


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

x86 assembly (clang, -O2):
<xshutdown_if_not_broken>:
jmp    1030 <xshutdown@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ reiserfs_warning(char *);
void errcatch_print_vi(struct virtual_item *vi) {
  reiserfs_warning("green-16011: Invalid item type observed, run fsck ASAP\n");
}


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

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

LLVM IR (-O0):
%struct.virtual_item = type { i32 }
@.str = [56 x i8] c"green-16011: Invalid item type observed, run fsck ASAP\0A\00"
define void @errcatch_print_vi(%struct.virtual_item* %0) {
%2 = alloca %struct.virtual_item*
store %struct.virtual_item* %0, %struct.virtual_item** %2
%3 = call i32 @reiserfs_warning(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.virtual_item = type { i32 }
@.str = [56 x i8] c"green-16011: Invalid item type observed, run fsck ASAP\0A\00"
define void @errcatch_print_vi(%struct.virtual_item* nocapture readnone %0) {
%2 = tail call i32 @reiserfs_warning(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
unsigned long get_XPropertyEvent_serial(void *_p) {
  return (unsigned long)((XPropertyEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XPropertyEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *,
                          char const *, unsigned int);
void log_watchtab_invalid_delay(const char *filename, unsigned line_no,
                                const char *field) {
  report(LOG_ERR, "Invalid delay field \"%s\" at %s:%u", field, filename,
         line_no);
}


x86 assembly (clang, -O0):
<log_watchtab_invalid_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xec1(%rip),%rsi
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_watchtab_invalid_delay>:
mov    %esi,%r8d
mov    %rdi,%rcx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Invalid delay field \22%s\22 at %s:%u\00"
define void @log_watchtab_invalid_delay(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @LOG_ERR
%8 = load i8*, i8** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @report(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Invalid delay field \22%s\22 at %s:%u\00"
define void @log_watchtab_invalid_delay(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @LOG_ERR
%5 = tail call i32 @report(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
char *ErrorWithCode(char *, int /*<<< orphan*/);
int /*<<< orphan*/ GetLastError();
char *ErrorWin(char *where) { return (ErrorWithCode(where, GetLastError())); }


x86 assembly (clang, -O0):
<ErrorWin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <GetLastError@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <ErrorWithCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorWin>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <GetLastError@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <ErrorWithCode@plt>

LLVM IR (-O0):
define i8* @ErrorWin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @GetLastError()
%5 = call i8* @ErrorWithCode(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @ErrorWin(i8* %0) {
%2 = tail call i32 (...) @GetLastError()
%3 = tail call i8* @ErrorWithCode(i8* %0, i32 %2)
ret i8* %3
}
__attribute__((always_)) unsigned int blksize_bits(unsigned int size) {
  unsigned int bits = 8;
  do {
    bits++;
    size >>= 1;
  } while (size > 256);
  return bits;
}


x86 assembly (clang, -O0):
<blksize_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
ja     110e <blksize_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blksize_bits>:
mov    $0x8,%eax
mov    %edi,%ecx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x201,%edi
mov    %ecx,%edi
ja     1110 <blksize_bits+0x10>
ret

LLVM IR (-O0):
define i32 @blksize_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 8, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = add i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = lshr i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %4
%10 = load i32, i32* %2
%11 = icmp ugt i32 %10, 256
br i1 %11, label %4, label %12
12: ; preds = %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @blksize_bits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 8, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = lshr i32 %3, 1
%7 = icmp ugt i32 %3, 513
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %5
}
double get_local_improvement(double original_function_time,
                             double improved_function_time) {
  return original_function_time / improved_function_time;
}


x86 assembly (clang, -O0):
<get_local_improvement>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_local_improvement>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @get_local_improvement(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @get_local_improvement(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void term_left(int n) { printf("\033[%dD", n); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dD\00"
define void @term_left(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FLT_EPSILON;
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ secant(double *, int /*<<< orphan*/, int);
int main(int argc, const char *argv[]) {
  double x[2] = {0, 1};
  secant(x, FLT_EPSILON, 1000);
  printf("%0.15f\n", x[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    $0x3e8,%edx
call   1040 <secant@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
mov    $0x3e8,%edx
call   1040 <secant@plt>
movsd  0x8(%rsp),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [2 x double] [double 0.000000e+00, double 1.000000e+00]
@FLT_EPSILON = global i32 0
@.str = [8 x i8] c"%0.15f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x double]* %6 to i8*
%8 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%9 = load i32, i32* @FLT_EPSILON
%10 = call i32 @secant(double* %8, i32 %9, i32 1000)
%11 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 1
%12 = load double, double* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [2 x double] [double 0.000000e+00, double 1.000000e+00]
@FLT_EPSILON = global i32 0
@.str = [8 x i8] c"%0.15f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = load i32, i32* @FLT_EPSILON
%7 = call i32 @secant(double* %5, i32 %6, i32 1000)
%8 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%9 = load double, double* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
unsigned char *flag_table_3_3_location(unsigned char **);
int flag_table_3_3(unsigned char **sec) {
  unsigned char *p;
  p = flag_table_3_3_location(sec);
  if (p == NULL)
    return -1;
  return (int)*p;
}


x86 assembly (clang, -O0):
<flag_table_3_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <flag_table_3_3_location@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <flag_table_3_3+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <flag_table_3_3+0x3a>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_table_3_3>:
push   %rax
call   1030 <flag_table_3_3_location@plt>
test   %rax,%rax
je     1120 <flag_table_3_3+0x10>
movzbl (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @flag_table_3_3(i8** %0) {
%2 = tail call i8* @flag_table_3_3_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void KheTestTimeOfDayBegin(struct timeval *tv) { gettimeofday(tv, NULL); }


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

x86 assembly (clang, -O2):
<KheTestTimeOfDayBegin>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @KheTestTimeOfDayBegin(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @KheTestTimeOfDayBegin(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_selectznz(uintptr_t, uintptr_t,
                                                 uintptr_t, uintptr_t);
void fiat_25519_selectznz(uint64_t out1[5], uint8_t arg1,
                          const uint64_t arg2[5], const uint64_t arg3[5]) {
  internal_fiat_25519_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                                (uintptr_t)arg2, (uintptr_t)arg3);
}


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

x86 assembly (clang, -O2):
<fiat_25519_selectznz>:
jmp    1030 <internal_fiat_25519_selectznz@plt>

LLVM IR (-O0):
define void @fiat_25519_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_25519_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_25519_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
int Max(int a, int b, int c) {
  int res;
  res = a;
  if (a < b)
    res = b;
  if (res < c)
    res = c;
  return res;
}


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1125 <Max+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1137 <Max+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void ADC_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_intr() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t SysCtlFlashSectorSizeGet(void) {
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x000A0000))) {
    return (1 << (10 + (((*((volatile uint32_t *)(0x400FDFC0))) & 0x00070000) >>
                        16)));
  } else {
    return (1024);
  }
}


x86 assembly (clang, -O0):
<SysCtlFlashSectorSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x100a0000,%eax
jne    113d <SysCtlFlashSectorSizeGet+0x3d>
mov    $0x400fdfc0,%eax
mov    (%rax),%ecx
and    $0x70000,%ecx
sar    $0x10,%ecx
add    $0xa,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <SysCtlFlashSectorSizeGet+0x44>
movl   $0x400,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlFlashSectorSizeGet>:
mov    $0x70ff0000,%ecx
and    0x400fe000,%ecx
mov    $0x400,%eax
cmp    $0x100a0000,%ecx
jne    112d <SysCtlFlashSectorSizeGet+0x2d>
mov    0x400fdfc0,%ecx
shr    $0x10,%ecx
and    $0x7,%cl
mov    $0x400,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlFlashSectorSizeGet() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%3 = and i32 %2, 1895759872
%4 = icmp eq i32 %3, 269090816
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load volatile i32, i32* inttoptr (i64 1074782144 to i32*)
%7 = and i32 %6, 458752
%8 = ashr i32 %7, 16
%9 = add nsw i32 10, %8
%10 = shl i32 1, %9
store i32 %10, i32* %1
br label %12
11: ; preds = %0
store i32 1024, i32* %1
br label %12
12: ; preds = %11, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @SysCtlFlashSectorSizeGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%2 = and i32 %1, 1895759872
%3 = icmp eq i32 %2, 269090816
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 1074782144 to i32*)
%6 = lshr i32 %5, 16
%7 = and i32 %6, 7
%8 = shl nuw nsw i32 1024, %7
br label %9
9: ; preds = %0, %4
%10 = phi i32 [ %8, %4 ], [ 1024, %0 ]
ret i32 %10
}
void copy(char *dst, char *src) {
  char *a = dst;
  char *b = src;
  for (; (b - src) < sizeof(src); *a = *b, a++, b++)
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x8,%rax
jae    115f <copy+0x5f>
jmp    1136 <copy+0x36>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <copy+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rsi),%al
mov    %al,(%rdi)
mov    0x1(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x2(%rsi),%al
mov    %al,0x2(%rdi)
mov    0x3(%rsi),%al
mov    %al,0x3(%rdi)
mov    0x4(%rsi),%al
mov    %al,0x4(%rdi)
mov    0x5(%rsi),%al
mov    %al,0x5(%rdi)
mov    0x6(%rsi),%al
mov    %al,0x6(%rdi)
mov    0x7(%rsi),%al
mov    %al,0x7(%rdi)
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = load i8, i8* %5
store i8 %6, i8* %4
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = getelementptr inbounds i8, i8* %1, i64 2
%9 = load i8, i8* %8
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = getelementptr inbounds i8, i8* %1, i64 3
%12 = load i8, i8* %11
store i8 %12, i8* %10
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = getelementptr inbounds i8, i8* %1, i64 4
%15 = load i8, i8* %14
store i8 %15, i8* %13
%16 = getelementptr inbounds i8, i8* %0, i64 5
%17 = getelementptr inbounds i8, i8* %1, i64 5
%18 = load i8, i8* %17
store i8 %18, i8* %16
%19 = getelementptr inbounds i8, i8* %0, i64 6
%20 = getelementptr inbounds i8, i8* %1, i64 6
%21 = load i8, i8* %20
store i8 %21, i8* %19
%22 = getelementptr inbounds i8, i8* %0, i64 7
%23 = getelementptr inbounds i8, i8* %1, i64 7
%24 = load i8, i8* %23
store i8 %24, i8* %22
ret void
}
/* Variables and functions */
scalar_t__ can_use_intel_core_4th_gen_features();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (can_use_intel_core_4th_gen_features())
    printf("This CPU supports ISA extensions introduced in Haswell\n");
  else
    printf(
        "This CPU does not support all ISA extensions introduced in Haswell\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <can_use_intel_core_4th_gen_features@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <main+0x44>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <can_use_intel_core_4th_gen_features@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xf0a(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"This CPU supports ISA extensions introduced in Haswell\0A\00"
@.str.1 = [68 x i8] c"This CPU does not support all ISA extensions introduced in Haswell\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @can_use_intel_core_4th_gen_features()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 1
}

LLVM IR (-O2):
@str = [67 x i8] c"This CPU does not support all ISA extensions introduced in Haswell\00"
@str.2 = [55 x i8] c"This CPU supports ISA extensions introduced in Haswell\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @can_use_intel_core_4th_gen_features()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @str.2, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 1
}
void esperar(int tiempo) {
  while (tiempo-- > 0)
    ;
}


x86 assembly (clang, -O0):
<esperar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1120 <esperar+0x20>
jmp    1107 <esperar+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @esperar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @esperar(i32 %0) {
ret void
}
void _M2_Selective_init() {}


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

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

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

LLVM IR (-O2):
define void @_M2_Selective_init() {
ret void
}
void can_detect_both_c_and_cpp_files() {}


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

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

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

LLVM IR (-O2):
define void @can_detect_both_c_and_cpp_files() {
ret void
}