xunge/DecIR huggingface dataset:
/* Type definitions */
struct plugin_manager_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct plugin_manager_struct *);
int /*<<< orphan*/ plugin_manager_unload(struct plugin_manager_struct *,
                                         int /*<<< orphan*/ *);
void plugin_manager_destroy(struct plugin_manager_struct *manager) {
  plugin_manager_unload(manager, NULL);
  free(manager);
}


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

x86 assembly (clang, -O2):
<plugin_manager_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <plugin_manager_unload@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.plugin_manager_struct = type { i32 }
define void @plugin_manager_destroy(%struct.plugin_manager_struct* %0) {
%2 = alloca %struct.plugin_manager_struct*
store %struct.plugin_manager_struct* %0, %struct.plugin_manager_struct** %2
%3 = load %struct.plugin_manager_struct*, %struct.plugin_manager_struct** %2
%4 = call i32 @plugin_manager_unload(%struct.plugin_manager_struct* %3, i32* null)
%5 = load %struct.plugin_manager_struct*, %struct.plugin_manager_struct** %2
%6 = call i32 @free(%struct.plugin_manager_struct* %5)
ret void
}

LLVM IR (-O2):
%struct.plugin_manager_struct = type { i32 }
define void @plugin_manager_destroy(%struct.plugin_manager_struct* %0) {
%2 = tail call i32 @plugin_manager_unload(%struct.plugin_manager_struct* %0, i32* null)
%3 = tail call i32 @free(%struct.plugin_manager_struct* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sum(int);
int main() {
  int num, add;
  printf("Enter a positive integer: ");
  scanf("%d", &num);
  add = sum(num);
  printf("sum=%d", add);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <sum@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"sum=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"sum=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int readinst(int *a, int *b, FILE *numfile) {
  unsigned char nums[3];
  int x = fread(nums, sizeof(char), 2, numfile);
  *a = (int)nums[0];
  *b = (int)nums[1];
  return x;
}


x86 assembly (clang, -O0):
<readinst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1b(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    %eax,-0x20(%rbp)
movzbl -0x1b(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x1a(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readinst>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rcx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x5(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzbl 0x5(%rsp),%ecx
mov    %ecx,(%rbx)
movzbl 0x6(%rsp),%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @readinst(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = alloca [3 x i8]
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%6 = call i32 @fread(i8* %5, i32 1, i32 2, i32* %2)
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
store i32 %8, i32* %0
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
store i32 %11, i32* %1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ tblIP;

/* Variables and functions */
int /*<<< orphan*/ McbMapTrueBits(unsigned char *, int, unsigned char const *,
                                  unsigned char *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void McbCreateInitialPermutation(const unsigned char Message[8],
                                 unsigned char IP[8]) {
  static unsigned char tblIP[] = {
      57, 49, 41, 33, 25, 17, 9,  1, 59, 51, 43, 35, 27, 19, 11, 3,
      61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7,
      56, 48, 40, 32, 24, 16, 8,  0, 58, 50, 42, 34, 26, 18, 10, 2,
      60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6};
  memset(IP, 0, 8);
  McbMapTrueBits(tblIP, sizeof(tblIP), Message, IP);
}


x86 assembly (clang, -O0):
<McbCreateInitialPermutation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2ef1(%rip),%rdi
mov    $0x40,%esi
call   1040 <McbMapTrueBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McbCreateInitialPermutation>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    0x2f00(%rip),%rdi
mov    $0x40,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <McbMapTrueBits@plt>

LLVM IR (-O0):
@McbCreateInitialPermutation.tblIP = internal global [64 x i8] c"91)!\19\11\09\01;3+#\1B\13\0B\03=5-%\1D\15\0D\05?7/'\1F\17\0F\0780( \18\10\08\00:2*\22\1A\12\0A\02<4,$\1C\14\0C\04>6.&\1E\16\0E\06"
define void @McbCreateInitialPermutation(i8* %0, i8* %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 @memset(i8* %5, i32 0, i32 8)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @McbMapTrueBits(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @McbCreateInitialPermutation.tblIP, i64 0, i64 0), i32 64, i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@McbCreateInitialPermutation.tblIP = internal global [64 x i8] c"91)!\19\11\09\01;3+#\1B\13\0B\03=5-%\1D\15\0D\05?7/'\1F\17\0F\0780( \18\10\08\00:2*\22\1A\12\0A\02<4,$\1C\14\0C\04>6.&\1E\16\0E\06"
define void @McbCreateInitialPermutation(i8* %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 0, i32 8)
%4 = tail call i32 @McbMapTrueBits(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @McbCreateInitialPermutation.tblIP, i64 0, i64 0), i32 64, i8* %0, i8* %1)
ret void
}
int *b(int i, int *j) {
  int *k = 2;
  int l;
  return k;
}


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

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

LLVM IR (-O0):
define i32* @b(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32* inttoptr (i64 2 to i32*), i32** %5
%7 = load i32*, i32** %5
ret i32* %7
}

LLVM IR (-O2):
define i32* @b(i32 %0, i32* nocapture readnone %1) {
ret i32* inttoptr (i64 2 to i32*)
}
void test60() {}


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

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

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

LLVM IR (-O2):
define void @test60() {
ret void
}
/* Type definitions */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
int mtwist_next(struct mtwist_state *);
int /*<<< orphan*/ strcat(char *, char *);
void append_stuff(struct mtwist_state *mt, char *s, char *a[], int asize) {
  int e;
  e = mtwist_next(mt) % asize;
  strcat(s, a[e]);
}


x86 assembly (clang, -O0):
<append_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mtwist_next@plt>
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_stuff>:
push   %r15
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <mtwist_next@plt>
cltd
idiv   %ebx
movslq %edx,%rax
mov    (%r14,%rax,8),%rsi
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
define void @append_stuff(%struct.mtwist_state* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.mtwist_state*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store %struct.mtwist_state* %0, %struct.mtwist_state** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%10 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%11 = call i32 @mtwist_next(%struct.mtwist_state* %10)
%12 = load i32, i32* %8
%13 = srem i32 %11, %12
store i32 %13, i32* %9
%14 = load i8*, i8** %6
%15 = load i8**, i8*** %7
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @strcat(i8* %14, i8* %19)
ret void
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
define void @append_stuff(%struct.mtwist_state* %0, i8* %1, i8** nocapture %2, i32 %3) {
%5 = tail call i32 @mtwist_next(%struct.mtwist_state* %0)
%6 = srem i32 %5, %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %2, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @strcat(i8* %1, i8* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configureGenfskPatch();
int /*<<< orphan*/ enterGenfskCpePatch();
int /*<<< orphan*/ enterGenfskSysPatch();
void applyGenfskPatch(void) {
  enterGenfskSysPatch();
  enterGenfskCpePatch();
  configureGenfskPatch();
}


x86 assembly (clang, -O0):
<applyGenfskPatch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <enterGenfskSysPatch@plt>
mov    $0x0,%al
call   1050 <enterGenfskCpePatch@plt>
mov    $0x0,%al
call   1030 <configureGenfskPatch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyGenfskPatch>:
push   %rax
xor    %eax,%eax
call   1040 <enterGenfskSysPatch@plt>
xor    %eax,%eax
call   1050 <enterGenfskCpePatch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <configureGenfskPatch@plt>

LLVM IR (-O0):
define void @applyGenfskPatch() {
%1 = call i32 (...) @enterGenfskSysPatch()
%2 = call i32 (...) @enterGenfskCpePatch()
%3 = call i32 (...) @configureGenfskPatch()
ret void
}

LLVM IR (-O2):
define void @applyGenfskPatch() {
%1 = tail call i32 (...) @enterGenfskSysPatch()
%2 = tail call i32 (...) @enterGenfskCpePatch()
%3 = tail call i32 (...) @configureGenfskPatch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_and_set();
int main(void) {
  check_and_set();
  check_and_set();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_and_set()
%2 = tail call i32 (...) @check_and_set()
ret i32 0
}
void XtRegisterCaseConverter() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
void loadSourceFileName(char *name) {
  FILE *f = fopen("asmtovhd_settings.txt", "r");
  ;
  name[0] = 0;
  if (f) {
    fscanf(f, "%s", name);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<loadSourceFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     1182 <loadSourceFileName+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadSourceFileName>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
movb   $0x0,(%r14)
test   %rax,%rax
je     1177 <loadSourceFileName+0x47>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fscanf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"asmtovhd_settings.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
define void @loadSourceFileName(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8 0, i8* %0
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fscanf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %4, %1
ret void
}
int secondary_hash(int h) {
  h ^= ((unsigned)h >> 20) ^ ((unsigned)h >> 12);
  return h ^ ((unsigned)h >> 7) ^ ((unsigned)h >> 4);
}


x86 assembly (clang, -O0):
<secondary_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x14,%eax
mov    -0x4(%rbp),%ecx
shr    $0xc,%ecx
xor    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x7,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<secondary_hash>:
mov    %edi,%eax
shr    $0xc,%eax
xor    %edi,%eax
shr    $0x14,%edi
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x7,%ecx
xor    %eax,%ecx
shr    $0x4,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @secondary_hash(i32 %0) {
%2 = lshr i32 %0, 20
%3 = lshr i32 %0, 12
%4 = xor i32 %3, %0
%5 = xor i32 %4, %2
%6 = lshr i32 %5, 7
%7 = xor i32 %6, %5
%8 = lshr i32 %5, 4
%9 = xor i32 %7, %8
ret i32 %9
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    local1 = 0UL;
    while (local1 < 1UL) {
      local1++;
    }
    output[0UL] = state[0UL] + 316086328UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
mov    -0x20(%rbp),%rax
add    -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    117c <RandomFunc+0x7c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1160 <RandomFunc+0x60>
mov    -0x18(%rbp),%rcx
add    $0x12d71838,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
add    %rax,%rax
add    $0x11a32ec2,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i64, i64* %6
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %6
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = add i64 %21, %18
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 2
store i64 %24, i64* %6
br label %12
25: ; preds = %12
store i64 0, i64* %6
br label %26
26: ; preds = %29, %25
%27 = load i64, i64* %6
%28 = icmp ult i64 %27, 1
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i64, i64* %6
%31 = add i64 %30, 1
store i64 %31, i64* %6
br label %26
32: ; preds = %26
%33 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%34 = load i64, i64* %33
%35 = add i64 %34, 316086328
%36 = load i64*, i64** %4
%37 = getelementptr inbounds i64, i64* %36, i64 0
store i64 %35, i64* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 295907010
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gameLoop();
int main() {
  gameLoop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gameLoop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("test/sysinclude hello()!\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"test/sysinclude hello()!\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"test/sysinclude hello()!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t sext(int32_t value, uint8_t start, uint8_t end) {
  return ((((value) << (31 - start)) >> (31 - (start - end))));
}


x86 assembly (clang, -O0):
<sext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
sub    -0xc(%rbp),%edx
mov    $0x1f,%ecx
sub    %edx,%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sext>:
mov    %edi,%eax
mov    $0x1f,%ecx
sub    %esi,%ecx
shl    %cl,%eax
add    %edx,%ecx
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @sext(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 31, %8
%10 = shl i32 %7, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = sub nsw i32 31, %13
%15 = ashr i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @sext(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 31, %1
%5 = shl i32 %0, %4
%6 = add i32 %4, %2
%7 = ashr i32 %5, %6
ret i32 %7
}
/* Type definitions */
struct object {
  int dummy;
};
struct atom {
  int dummy;
};

/* Variables and functions */
struct atom *create_atom_from_string(char *);
struct object *map_cons(struct atom *, struct object *, struct object *);
struct object *map_cons_s(char *key, struct object *value, struct object *map) {
  struct atom *atom = create_atom_from_string(key);
  return map_cons(atom, value, map);
}


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

x86 assembly (clang, -O2):
<map_cons_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <create_atom_from_string@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <map_cons@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
%struct.atom = type { i32 }
define %struct.object* @map_cons_s(i8* %0, %struct.object* %1, %struct.object* %2) {
%4 = alloca i8*
%5 = alloca %struct.object*
%6 = alloca %struct.object*
%7 = alloca %struct.atom*
store i8* %0, i8** %4
store %struct.object* %1, %struct.object** %5
store %struct.object* %2, %struct.object** %6
%8 = load i8*, i8** %4
%9 = call %struct.atom* @create_atom_from_string(i8* %8)
store %struct.atom* %9, %struct.atom** %7
%10 = load %struct.atom*, %struct.atom** %7
%11 = load %struct.object*, %struct.object** %5
%12 = load %struct.object*, %struct.object** %6
%13 = call %struct.object* @map_cons(%struct.atom* %10, %struct.object* %11, %struct.object* %12)
ret %struct.object* %13
}

LLVM IR (-O2):
%struct.object = type { i32 }
%struct.atom = type { i32 }
define %struct.object* @map_cons_s(i8* %0, %struct.object* %1, %struct.object* %2) {
%4 = tail call %struct.atom* @create_atom_from_string(i8* %0)
%5 = tail call %struct.object* @map_cons(%struct.atom* %4, %struct.object* %1, %struct.object* %2)
ret %struct.object* %5
}
/* Variables and functions */
int Partition(int *, int, int);
void QuickSort(int *arr, int sI, int eI) {
  if (sI >= eI)
    return;
  int pI;
  pI = Partition(arr, sI, eI);
  QuickSort(arr, sI, pI - 1);
  QuickSort(arr, pI + 1, eI);
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <QuickSort+0x23>
jmp    1179 <QuickSort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <QuickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <QuickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <QuickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @QuickSort(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* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @Partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QuickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void _uart_putc(char c) {
  unsigned char lsr;
  do {
    lsr = *((volatile unsigned char *)(0x90000000 + 5));
  } while ((lsr & 0x20) != 0x20);
  *((volatile unsigned char *)(0x90000000 + 0)) = c;
  do {
    lsr = *((volatile unsigned char *)(0x90000000 + 5));
  } while ((lsr & (0x40 | 0x20)) != (0x40 | 0x20));
}


x86 assembly (clang, -O0):
<_uart_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x90000005,%eax
mov    (%rax),%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x20,%eax
cmp    $0x20,%eax
jne    110a <_uart_putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x90000000,%eax
mov    %cl,(%rax)
mov    $0x90000005,%eax
mov    (%rax),%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x60,%eax
cmp    $0x60,%eax
jne    112e <_uart_putc+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uart_putc>:
mov    $0x90000005,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x20,(%rax)
je     1110 <_uart_putc+0x10>
mov    %dil,-0x5(%rax)
nopl   0x0(%rax)
movzbl (%rax),%ecx
not    %cl
test   $0x60,%cl
jne    1120 <_uart_putc+0x20>
ret

LLVM IR (-O0):
define void @_uart_putc(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
br label %4
4: ; preds = %6, %1
%5 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
store i8 %5, i8* %3
br label %6
6: ; preds = %4
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = and i32 %8, 32
%10 = icmp ne i32 %9, 32
br i1 %10, label %4, label %11
11: ; preds = %6
%12 = load i8, i8* %2
store volatile i8 %12, i8* inttoptr (i64 2415919104 to i8*)
br label %13
13: ; preds = %15, %11
%14 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
store i8 %14, i8* %3
br label %15
15: ; preds = %13
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = and i32 %17, 96
%19 = icmp ne i32 %18, 96
br i1 %19, label %13, label %20
20: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @_uart_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
%4 = and i8 %3, 32
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2415919104 to i8*)
br label %7
7: ; preds = %7, %6
%8 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
%9 = and i8 %8, 96
%10 = icmp eq i8 %9, 96
br i1 %10, label %11, label %7
11: ; preds = %7
ret void
}
/* Variables and functions */
char *strcasestr(char const *, char const *);
char *Strcasestr(const char *s1, const char *s2) { return strcasestr(s1, s2); }


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

x86 assembly (clang, -O2):
<Strcasestr>:
jmp    1030 <strcasestr@plt>

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

LLVM IR (-O2):
define i8* @Strcasestr(i8* %0, i8* %1) {
%3 = tail call i8* @strcasestr(i8* %0, i8* %1)
ret i8* %3
}
void XdbeBeginIdiom() {}


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

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

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

LLVM IR (-O2):
define void @XdbeBeginIdiom() {
ret void
}
int how_much(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @how_much() {
ret i32 8
}

LLVM IR (-O2):
define i32 @how_much() {
ret i32 8
}
/* Type definitions */
struct context {
  int dummy;
};

/* Variables and functions */
scalar_t__ canconsume(struct context *, char *);
void skipwhite(struct context *ctxt) {
  while (canconsume(ctxt, " \t"))
    ;
}


x86 assembly (clang, -O0):
<skipwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <canconsume@plt>
cmp    $0x0,%rax
je     113b <skipwhite+0x2b>
jmp    111c <skipwhite+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhite>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <canconsume@plt>
test   %rax,%rax
jne    1120 <skipwhite+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.context = type { i32 }
@.str = [3 x i8] c" \09\00"
define void @skipwhite(%struct.context* %0) {
%2 = alloca %struct.context*
store %struct.context* %0, %struct.context** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.context*, %struct.context** %2
%5 = call i64 @canconsume(%struct.context* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.context = type { i32 }
@.str = [3 x i8] c" \09\00"
define void @skipwhite(%struct.context* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @canconsume(%struct.context* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int max(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int maxNum = max(3, 4);
  printf("Max: %d\n", maxNum);
  return maxNum != 4;
}


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    $0x3,%edi
mov    $0x4,%esi
call   1040 <max@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x4,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <max@plt>
mov    %eax,%ebx
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
cmp    $0x4,%ebx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Max: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @max(i32 3, i32 4)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 4
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"Max: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @max(i32 3, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp ne i32 %3, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ log_setup();
void sig_logrotate(int foo, siginfo_t *bar, void *baz) { log_setup(); }


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

x86 assembly (clang, -O2):
<sig_logrotate>:
xor    %eax,%eax
jmp    1030 <log_setup@plt>

LLVM IR (-O0):
define void @sig_logrotate(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @log_setup()
ret void
}

LLVM IR (-O2):
define void @sig_logrotate(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @log_setup()
ret void
}
/* Variables and functions */
int bar();
int foo();
int main() {
  int ret_foo;
  int ret_bar;
  ret_foo = foo();
  ret_bar = bar();
  return ret_foo;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <bar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @foo()
store i32 %4, i32* %2
%5 = call i32 (...) @bar()
store i32 %5, i32* %3
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
ret i32 %1
}
void RTSemEventMultiSignal(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventMultiSignal() {
ret void
}
/* Variables and functions */
int japi_getkeychar(int);
int j_getkeychar(int arg0) { return (japi_getkeychar(arg0)); }


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

x86 assembly (clang, -O2):
<j_getkeychar>:
jmp    1030 <japi_getkeychar@plt>

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

LLVM IR (-O2):
define i32 @j_getkeychar(i32 %0) {
%2 = tail call i32 @japi_getkeychar(i32 %0)
ret i32 %2
}
int main() {
  int a, b, s;
  scanf("%d%d", &a, &b), s = a - b, printf("%d\n", s > 0 ? s : -s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1163 <main+0x43>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    116b <main+0x4b>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
sub    (%rsp),%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @llvm.abs.i32(i32 %8, i1 true)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
scalar_t__ g2_ink(int /*<<< orphan*/, float, float, float);
float g2_ink_(float *dev, float *red, float *green, float *blue) {
  return (float)g2_ink(dtoi(*dev), *red, *green, *blue);
}


x86 assembly (clang, -O0):
<g2_ink_>:
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),%rax
movss  (%rax),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
call   1030 <g2_ink@plt>
cvtsi2ss %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_ink_>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1040 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r15),%xmm1
movss  (%r14),%xmm2
mov    %eax,%edi
call   1030 <g2_ink@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @g2_ink_(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float*, float** %5
%10 = load float, float* %9
%11 = call i32 @dtoi(float %10)
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = load float*, float** %8
%17 = load float, float* %16
%18 = call i64 @g2_ink(i32 %11, float %13, float %15, float %17)
%19 = sitofp i64 %18 to float
ret float %19
}

LLVM IR (-O2):
define float @g2_ink_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load float, float* %0
%6 = tail call i32 @dtoi(float %5)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = load float, float* %3
%10 = tail call i64 @g2_ink(i32 %6, float %7, float %8, float %9)
%11 = sitofp i64 %10 to float
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void practice2D7() {
  int x = 0x98FDECBA;
  printf("%x\n", x | ~0xFF);
  printf("%x\n", x ^ 0xFF);
  printf("%x\n", x & ~0xFF);
}


x86 assembly (clang, -O0):
<practice2D7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x98fdecba,-0x4(%rbp)
mov    -0x4(%rbp),%esi
or     $0xffffff00,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
xor    $0xff,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
and    $0xffffff00,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<practice2D7>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffba,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x98fdec45,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x98fdec00,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define void @practice2D7() {
%1 = alloca i32
store i32 -1728189254, i32* %1
%2 = load i32, i32* %1
%3 = or i32 %2, -256
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = xor i32 %5, 255
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = and i32 %8, -256
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define void @practice2D7() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -70)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1728189371)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1728189440)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exitMenu(void) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @exitMenu() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ assert(int);
void flip_bit(volatile uint32_t *current, uint8_t shift) {
  assert(shift <= (sizeof((*current)) * CHAR_BIT - 1));
  *current ^= (1 << shift);
}


x86 assembly (clang, -O0):
<flip_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    0x2eb6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
xor    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_bit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    0x2ebf(%rip),%rax
movslq (%rax),%rax
lea    -0x1(,%rax,4),%rax
ff
xor    %edi,%edi
cmp    %rbx,%rax
setae  %dil
call   1030 <assert@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
xor    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define void @flip_bit(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 = sext i32 %5 to i64
%7 = load i32, i32* @CHAR_BIT
%8 = sext i32 %7 to i64
%9 = mul i64 4, %8
%10 = sub i64 %9, 1
%11 = icmp ule i64 %6, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = load i32*, i32** %3
%17 = load volatile i32, i32* %16
%18 = xor i32 %17, %15
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define void @flip_bit(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 2
%7 = add nsw i64 %6, -1
%8 = icmp uge i64 %7, %3
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = shl nuw i32 1, %1
%12 = load volatile i32, i32* %0
%13 = xor i32 %12, %11
store volatile i32 %13, i32* %0
ret void
}