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

/* Variables and functions */
int /*<<< orphan*/ glIsList(int /*<<< orphan*/);
GLboolean IsList(GLuint list) { return glIsList(list); }


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

x86 assembly (clang, -O2):
<IsList>:
jmp    1030 <glIsList@plt>

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

LLVM IR (-O2):
define i32 @IsList(i32 %0) {
%2 = tail call i32 @glIsList(i32 %0)
ret i32 %2
}
int g_oper_or(int s, int d) { return (s || d); }


x86 assembly (clang, -O0):
<g_oper_or>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <g_oper_or+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_oper_or>:
xor    %eax,%eax
or     %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @g_oper_or(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_oper_or(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int *foo(int *vector) { return vector; }


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

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

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

LLVM IR (-O2):
define i32* @foo(i32* readnone returned %0) {
ret i32* %0
}
long signed_im5(i)
unsigned long i;
{ return ((i & 1) ? 0xfffffff0 : 0) | ((i >> 1) & 0xf); }


x86 assembly (clang, -O0):
<signed_im5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x1,%rdx
xor    %eax,%eax
mov    $0xfffffff0,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,%eax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
and    $0xf,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_im5>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
and    $0xfffffff0,%eax
shr    %edi
and    $0xf,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signed_im5(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -16, i32 0
%8 = zext i32 %7 to i64
%9 = load i64, i64* %2
%10 = lshr i64 %9, 1
%11 = and i64 %10, 15
%12 = or i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @signed_im5(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 0, i64 4294967280
%5 = lshr i64 %0, 1
%6 = and i64 %5, 15
%7 = or i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello world\n");
  1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strstr(char *, char *);
int htmly_detect_tag(char *line, char *tag) {
  int header = 0;
  char detectstr[(1024 * 256)];
  sprintf(detectstr, "<!--%s ", tag);
  if (strstr(line, detectstr) != 0) {
    header = 1;
  }
  return header;
}


x86 assembly (clang, -O0):
<htmly_detect_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x40020(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40020(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1172 <htmly_detect_tag+0x52>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x40020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htmly_detect_tag>:
push   %r14
push   %rbx
sub    $0x40008,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec9(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x40008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"<!--%s \00"
define i32 @htmly_detect_tag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [262144 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%7 = getelementptr inbounds [262144 x i8], [262144 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [262144 x i8], [262144 x i8]* %6, i64 0, i64 0
%12 = call i64 @strstr(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %5
br label %15
15: ; preds = %14, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"<!--%s \00"
define i32 @htmly_detect_tag(i8* %0, i8* %1) {
%3 = alloca [262144 x i8]
%4 = getelementptr inbounds [262144 x i8], [262144 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i64 @strstr(i8* %0, i8* %4)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void mixedComparisons9(signed char a) {
  int max = ((~0U) & ((~0U) >> 1));
  clang_analyzer_eval((a + 2) <= (max - 5LL));
  clang_analyzer_eval(a == 0);
  clang_analyzer_eval(a == 0x7F);
  clang_analyzer_eval(a == -0x80);
}


x86 assembly (clang, -O0):
<mixedComparisons9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x2,%eax
cltq
movslq -0x8(%rbp),%rcx
sub    $0x5,%rcx
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xffffff80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedComparisons9>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
test   %bl,%bl
sete   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x7f,%bl
sete   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x80,%bl
sete   %dil
pop    %rbx
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @mixedComparisons9(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 2147483647, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 2
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = sub nsw i64 %9, 5
%11 = icmp sle i64 %7, %10
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 127
%22 = zext i1 %21 to i32
%23 = call i32 @clang_analyzer_eval(i32 %22)
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, -128
%27 = zext i1 %26 to i32
%28 = call i32 @clang_analyzer_eval(i32 %27)
ret void
}

LLVM IR (-O2):
define void @mixedComparisons9(i8 signext %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 1)
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
%6 = icmp eq i8 %0, 127
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
%9 = icmp eq i8 %0, -128
%10 = zext i1 %9 to i32
%11 = tail call i32 @clang_analyzer_eval(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ settable(unsigned int, unsigned int, unsigned int,
                            unsigned int, unsigned int, unsigned int);
void COM_SRand(unsigned seed) {
  settable(12345 + seed, 65435 + seed, 34221 + seed, 12345 + seed,
           9983651 + seed, 95746118 + seed);
}


x86 assembly (clang, -O0):
<COM_SRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3039,%edi
mov    -0x4(%rbp),%esi
add    $0xff9b,%esi
mov    -0x4(%rbp),%edx
add    $0x85ad,%edx
mov    -0x4(%rbp),%ecx
add    $0x3039,%ecx
mov    -0x4(%rbp),%r8d
add    $0x9856a3,%r8d
mov    -0x4(%rbp),%r9d
add    $0x5b4f846,%r9d
call   1030 <settable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_SRand>:
lea    0x3039(%rdi),%ecx
lea    0xff9b(%rdi),%esi
lea    0x85ad(%rdi),%edx
lea    0x9856a3(%rdi),%r8d
lea    0x5b4f846(%rdi),%r9d
mov    %ecx,%edi
jmp    1030 <settable@plt>

LLVM IR (-O0):
define void @COM_SRand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 12345, %3
%5 = load i32, i32* %2
%6 = add i32 65435, %5
%7 = load i32, i32* %2
%8 = add i32 34221, %7
%9 = load i32, i32* %2
%10 = add i32 12345, %9
%11 = load i32, i32* %2
%12 = add i32 9983651, %11
%13 = load i32, i32* %2
%14 = add i32 95746118, %13
%15 = call i32 @settable(i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @COM_SRand(i32 %0) {
%2 = add i32 %0, 12345
%3 = add i32 %0, 65435
%4 = add i32 %0, 34221
%5 = add i32 %0, 9983651
%6 = add i32 %0, 95746118
%7 = tail call i32 @settable(i32 %2, i32 %3, i32 %4, i32 %2, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toScalar(int);
void IF_toScalar(void) { toScalar(1); }


x86 assembly (clang, -O0):
<IF_toScalar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <toScalar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_toScalar>:
mov    $0x1,%edi
jmp    1030 <toScalar@plt>

LLVM IR (-O0):
define void @IF_toScalar() {
%1 = call i32 @toScalar(i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_toScalar() {
%1 = tail call i32 @toScalar(i32 1)
ret void
}
/* Variables and functions */
int __send_to_ppe(int, int, int *);
int fchdir(int fd) { return __send_to_ppe(0x2101, 34, &fd); }


x86 assembly (clang, -O0):
<fchdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2101,%edi
mov    $0x22,%esi
lea    -0x4(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchdir>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x2101,%edi
mov    $0x22,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fchdir(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 34, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @fchdir(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 34, i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENET_1588_Timer_DriverIRQHandler();
__attribute__((weak)) void ENET_1588_Timer_IRQHandler(void) {
  ENET_1588_Timer_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @ENET_1588_Timer_IRQHandler() {
%1 = call i32 (...) @ENET_1588_Timer_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ENET_1588_Timer_IRQHandler() {
%1 = tail call i32 (...) @ENET_1588_Timer_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_stc2(int, int, void *);
void stc2(void *i) { __builtin_arm_stc2(1, 2, i); }


x86 assembly (clang, -O0):
<stc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <__builtin_arm_stc2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stc2>:
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <__builtin_arm_stc2@plt>

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

LLVM IR (-O2):
define void @stc2(i8* %0) {
%2 = tail call i32 @__builtin_arm_stc2(i32 1, i32 2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int read_bmp(const char *filename, int *width, int *height,
             unsigned char *rgb) {
  fprintf(stderr, "Sorry, reading of .bmp files isn't supported yet.\n");
  return (0);
}


x86 assembly (clang, -O0):
<read_bmp>:
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    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bmp>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Sorry, reading of .bmp files isn't supported yet.\0A\00"
define i32 @read_bmp(i8* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Sorry, reading of .bmp files isn't supported yet.\0A\00"
define i32 @read_bmp(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int func(int num) { return num + 5; }


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

x86 assembly (clang, -O2):
<func>:
lea    0x5(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = add nsw i32 %0, 5
ret i32 %2
}
void USBD_USR_DeviceSuspended(void) {}


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

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

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

LLVM IR (-O2):
define void @USBD_USR_DeviceSuspended() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ minfo();
int main(void) {
  char *p;
  minfo();
  p = malloc(10);
  free(p);
  minfo();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <minfo@plt>
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <minfo@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <minfo@plt>
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <minfo@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @minfo()
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = call i32 (...) @minfo()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @minfo()
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @free(i8* %2)
%4 = tail call i32 (...) @minfo()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int sub(int x, int y) { return 24 + x - y; }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
sub    %esi,%edi
lea    0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sub(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 = add nsw i32 24, %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 24
%4 = sub i32 %3, %1
ret i32 %4
}
int get_operator_precedense(char op) {
  switch (op) {
  case '^':
    return 4;
  case '*':
  case '/':
    return 3;
  case '+':
  case '-':
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_operator_precedense>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     116f <get_operator_precedense+0x6f>
jmp    111f <get_operator_precedense+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     117b <get_operator_precedense+0x7b>
jmp    1130 <get_operator_precedense+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     117b <get_operator_precedense+0x7b>
jmp    1141 <get_operator_precedense+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     116f <get_operator_precedense+0x6f>
jmp    1152 <get_operator_precedense+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    1187 <get_operator_precedense+0x87>
jmp    1163 <get_operator_precedense+0x63>
movl   $0x4,-0x4(%rbp)
jmp    118e <get_operator_precedense+0x8e>
movl   $0x3,-0x4(%rbp)
jmp    118e <get_operator_precedense+0x8e>
movl   $0x2,-0x4(%rbp)
jmp    118e <get_operator_precedense+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_operator_precedense>:
lea    -0x2a(%rdi),%eax
cmp    $0x5,%eax
ja     1125 <get_operator_precedense+0x25>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3,%eax
ret
mov    $0x2,%eax
jmp    112f <get_operator_precedense+0x2f>
mov    $0x4,%eax
cmp    $0x5e,%edi
jne    1130 <get_operator_precedense+0x30>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_operator_precedense(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 94, label %6
i32 42, label %7
i32 47, label %7
i32 43, label %8
i32 45, label %8
]
6: ; preds = %1
store i32 4, i32* %2
br label %10
7: ; preds = %1, %1
store i32 3, i32* %2
br label %10
8: ; preds = %1, %1
store i32 2, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_operator_precedense(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 94, label %6
i32 42, label %3
i32 47, label %3
i32 43, label %4
i32 45, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 2, %4 ], [ 3, %3 ], [ 4, %1 ]
ret i32 %7
}
/* Variables and functions */
int gethostid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("hostid=%d\n", gethostid());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gethostid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hostid=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gethostid()
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hostid=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @gethostid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *filename) {
  int result = 0;
  FILE *file = fopen(filename, "r");
  if (file) {
    result = 1;
    fclose(file);
  }
  return result;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <file_exists+0x42>
movl   $0x1,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
int _test_song_position_pointer(void *buffer) {
  return ((unsigned char *)buffer)[0] == 0xf2;
}


x86 assembly (clang, -O0):
<_test_song_position_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xf2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_song_position_pointer>:
xor    %eax,%eax
cmpb   $0xf2,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @_test_song_position_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 242
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_test_song_position_pointer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -14
%4 = zext i1 %3 to i32
ret i32 %4
}
double fn(float f, int i) { return 0; }


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @fn(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @fn(float %0, i32 %1) {
ret double 0.000000e+00
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_fire4() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_FIRE4"
                                             : "INPUT_KEYB_FIRE4");
}


x86 assembly (clang, -O0):
<f_input_fire4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_fire4>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"INPUT_JOY_FIRE4\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE4\00"
define i8* @f_input_fire4() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"INPUT_JOY_FIRE4\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE4\00"
define i8* @f_input_fire4() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Type definitions */
struct matrix {
  int dummy;
};

/* Variables and functions */
int matrix_add_sub_common(struct matrix **, struct matrix **, int);
int matrix_add(struct matrix *matrixs[], struct matrix **result) {
  return matrix_add_sub_common(matrixs, result, 1);
}


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

x86 assembly (clang, -O2):
<matrix_add>:
mov    $0x1,%edx
jmp    1030 <matrix_add_sub_common@plt>

LLVM IR (-O0):
%struct.matrix = type { i32 }
define i32 @matrix_add(%struct.matrix** %0, %struct.matrix** %1) {
%3 = alloca %struct.matrix**
%4 = alloca %struct.matrix**
store %struct.matrix** %0, %struct.matrix*** %3
store %struct.matrix** %1, %struct.matrix*** %4
%5 = load %struct.matrix**, %struct.matrix*** %3
%6 = load %struct.matrix**, %struct.matrix*** %4
%7 = call i32 @matrix_add_sub_common(%struct.matrix** %5, %struct.matrix** %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.matrix = type { i32 }
define i32 @matrix_add(%struct.matrix** %0, %struct.matrix** %1) {
%3 = tail call i32 @matrix_add_sub_common(%struct.matrix** %0, %struct.matrix** %1, i32 1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ icon_mask;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
unsigned long get_XWMHints_icon_mask(void *_p) {
  return (unsigned long)((XWMHints *)_p)->icon_mask;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XWMHints_icon_mask(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_XWMHints_icon_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x1f() {
  Assert_real((isbdigit(31) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              160, ("isbdigit should be 0 for 0x1f"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1f\00"
define void @t_isbdigit_0x1f() {
%1 = tail call i64 @isbdigit(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo(int x) { ; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 undef
}
unsigned int hash_func(const void *key) {
  const unsigned char *p = key;
  unsigned int h = 2166136261;
  if (!p)
    return 0;
  while (*p) {
    h = (h * 16777619) ^ *p;
    ++p;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x811c9dc5,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112e <hash_func+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    116a <hash_func+0x6a>
jmp    1133 <hash_func+0x33>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <hash_func+0x64>
imul   $0x1000193,-0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1133 <hash_func+0x33>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
test   %rdi,%rdi
je     1137 <hash_func+0x37>
mov    (%rdi),%cl
test   %cl,%cl
je     113a <hash_func+0x3a>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
imul   $0x1000193,%eax,%edx
movzbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <hash_func+0x20>
ret
xor    %eax,%eax
ret
mov    $0x811c9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_func(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ -2128831035, %3 ]
%9 = phi i8* [ %13, %6 ], [ %0, %3 ]
%10 = mul i32 %8, 16777619
%11 = zext i8 %7 to i32
%12 = xor i32 %10, %11
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3, %1
%17 = phi i32 [ 0, %1 ], [ -2128831035, %3 ], [ %12, %6 ]
ret i32 %17
}
/* Variables and functions */
int rnd_uniform_d();
int rnd_uniform_rng_i(int low, int high) {
  return (int)(low + rnd_uniform_d() * (high - low + 1));
}


x86 assembly (clang, -O0):
<rnd_uniform_rng_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rnd_uniform_d@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_uniform_rng_i>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rnd_uniform_d@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rnd_uniform_rng_i(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (...) @rnd_uniform_d()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rnd_uniform_rng_i(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rnd_uniform_d()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ write_i2c_message(int, int, int);
int main() {
  while (1) {
    write_i2c_message(0x98, 4, 0xefbeadde);
    delay(1000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x98,%edi
mov    $0x4,%esi
mov    $0xefbeadde,%edx
call   1040 <write_i2c_message@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x98,%edi
mov    $0x4,%esi
mov    $0xefbeadde,%edx
call   1040 <write_i2c_message@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @write_i2c_message(i32 152, i32 4, i32 -272716322)
%3 = tail call i32 @delay(i32 1000)
br label %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
int get_XConfigureEvent_send_event(void *_p) {
  return (int)((XConfigureEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XConfigureEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureEvent_send_event(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double RAND_MAX;
double rand();
double Func_Rand(double *oplist, unsigned int numops) {
  return rand() * (oplist[1] - oplist[0]) / (RAND_MAX + 1.0) + oplist[0];
}


x86 assembly (clang, -O0):
<Func_Rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
mov    0x2e9e(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Func_Rand>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm2
addsd  0xec1(%rip),%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @Func_Rand(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = call double (...) @rand()
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fsub double %8, %11
%13 = fmul double %5, %12
%14 = load double, double* @RAND_MAX
%15 = fadd double %14, 1.000000e+00
%16 = fdiv double %13, %15
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fadd double %16, %19
ret double %20
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @Func_Rand(double* nocapture %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = load double, double* %0
%7 = fsub double %5, %6
%8 = fmul double %3, %7
%9 = load double, double* @RAND_MAX
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %8, %10
%12 = fadd double %6, %11
ret double %12
}
void g_object_thaw_notify() {}


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

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

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

LLVM IR (-O2):
define void @g_object_thaw_notify() {
ret void
}
/* Variables and functions */
double drand48();
__attribute__((__visibility__("default"))) double hts_drand48(void) {
  return drand48();
}


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

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

LLVM IR (-O0):
define double @hts_drand48() {
%1 = call double (...) @drand48()
ret double %1
}

LLVM IR (-O2):
define double @hts_drand48() {
%1 = tail call double (...) @drand48()
ret double %1
}
/* Variables and functions */
scalar_t__ floorf(float);
long float_to_money(float x) { return (long)floorf(x * 100.0f); }


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

x86 assembly (clang, -O2):
<float_to_money>:
mulss  0xee8(%rip),%xmm0
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define i64 @float_to_money(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+02
%5 = call i64 @floorf(float %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @float_to_money(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = tail call i64 @floorf(float %2)
ret i64 %3
}
void foo779() {}


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

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

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

LLVM IR (-O2):
define void @foo779() {
ret void
}
int fun1161() { return 1161; }


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

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

LLVM IR (-O0):
define i32 @fun1161() {
ret i32 1161
}

LLVM IR (-O2):
define i32 @fun1161() {
ret i32 1161
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __rsyscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setregid(gid_t rgid, gid_t egid) {
  return __rsyscall(204, rgid, egid, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<setregid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0xcc,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__rsyscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setregid>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0xcc,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__rsyscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @setregid(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 @__rsyscall(i32 204, i32 %5, i32 %6, i32 0, i32 0, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @setregid(i32 %0, i32 %1) {
%3 = tail call i32 @__rsyscall(i32 204, i32 %0, i32 %1, i32 0, i32 0, i32 0, i32 0)
ret i32 %3
}
void CL_Frame(int realmsec, int gamemsec) {}


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

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

LLVM IR (-O0):
define void @CL_Frame(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @CL_Frame(i32 %0, i32 %1) {
ret void
}
int int_size(int i) {
  int size;
  size = 0;
  while (i != 0) {
    i /= 10;
    ++size;
  }
  return size;
}


x86 assembly (clang, -O0):
<int_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <int_size+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <int_size+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_size>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <int_size+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <int_size+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_size(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
int acc_i2c_select_gpio(int clock, int data) { return (0); }


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

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

LLVM IR (-O0):
define i32 @acc_i2c_select_gpio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @acc_i2c_select_gpio(i32 %0, i32 %1) {
ret i32 0
}
char am_pm(int hour) {
  if (hour > 12) {
    return 'P';
  } else {
    return 'A';
  }
}


x86 assembly (clang, -O0):
<am_pm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jle    111a <am_pm+0x1a>
movb   $0x50,-0x1(%rbp)
jmp    111e <am_pm+0x1e>
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_pm>:
cmp    $0xd,%edi
mov    $0x50,%ecx
mov    $0x41,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @am_pm(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 12
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 80, i8* %2
br label %8
7: ; preds = %1
store i8 65, i8* %2
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @am_pm(i32 %0) {
%2 = icmp sgt i32 %0, 12
%3 = select i1 %2, i8 80, i8 65
ret i8 %3
}
/* Variables and functions */
int verifstrformat(char *, char *);
int verifnumcompte(char *chaine) {
  return verifstrformat("BE## #### #### ####", chaine);
}


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

x86 assembly (clang, -O2):
<verifnumcompte>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <verifstrformat@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"BE## #### #### ####\00"
define i32 @verifnumcompte(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @verifstrformat(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [20 x i8] c"BE## #### #### ####\00"
define i32 @verifnumcompte(i8* %0) {
%2 = tail call i32 @verifstrformat(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}