xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncat(char *, char const *, size_t);
size_t strlcat(char *dst, const char *src, size_t size) {
  strncat(dst, src, size);
  dst[size - 1] = '\0';
  return strlen(dst);
}


x86 assembly (clang, -O0):
<strlcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strncat@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1040 <strncat@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @strlcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncat(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
%16 = call i64 @strlen(i8* %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @strlcat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncat(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncasecmp(char *, char *, int /*<<< orphan*/);
int is_unsupported_url_type(char *line) {
  return (strncasecmp("data:", line, strlen("data:")) == 0);
}


x86 assembly (clang, -O0):
<is_unsupported_url_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb3(%rip),%rdi
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unsupported_url_type>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"data:\00"
define i32 @is_unsupported_url_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i64 @strncasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"data:\00"
define i32 @is_unsupported_url_type(i8* nocapture %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strncasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int count(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", count(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @count(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ vmadd(int, int, int);
void power_drop() {
  int id;
  scanf("%d", &id);
  vmadd(1, id, id);
  printf("ok\n");
}


x86 assembly (clang, -O0):
<power_drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
call   1050 <vmadd@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_drop>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    $0x1,%edi
mov    %edx,%esi
call   1050 <vmadd@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"ok\0A\00"
define void @power_drop() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @vmadd(i32 1, i32 %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"ok\00"
define void @power_drop() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @vmadd(i32 1, i32 %4, i32 %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
int fl_indentation(const char *line) {
  int i = 0;
  while (line[i] == '\t')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<fl_indentation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jne    1132 <fl_indentation+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <fl_indentation+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fl_indentation>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x9,(%rdi)
lea    0x1(%rdi),%rdi
je     1110 <fl_indentation+0x10>
ret

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

LLVM IR (-O2):
define i32 @fl_indentation(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 9
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SetTitleW52(short const *);
void settitlew(const short int *s) { SetTitleW52(s); }


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

x86 assembly (clang, -O2):
<settitlew>:
jmp    1030 <SetTitleW52@plt>

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

LLVM IR (-O2):
define void @settitlew(i16* %0) {
%2 = tail call i32 @SetTitleW52(i16* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setFilename(char *, int /*<<< orphan*/);
void setDefaultFilename(void) { setFilename("default.profraw", 0); }


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

x86 assembly (clang, -O2):
<setDefaultFilename>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <setFilename@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"default.profraw\00"
define void @setDefaultFilename() {
%1 = call i32 @setFilename(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"default.profraw\00"
define void @setDefaultFilename() {
%1 = tail call i32 @setFilename(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmTimer(int);
void IERmTimer(int timerid) { rmTimer(timerid); }


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

x86 assembly (clang, -O2):
<IERmTimer>:
jmp    1030 <rmTimer@plt>

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

LLVM IR (-O2):
define void @IERmTimer(i32 %0) {
%2 = tail call i32 @rmTimer(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main(void) {
  fork();
  printf("Novo processo criado!\n");
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Novo processo criado!\0A\00"
define i32 @main() {
%1 = call i32 (...) @fork()
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Novo processo criado!\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int minval(int val1, int val2) { return val1 < val2 ? val1 : val2; }


x86 assembly (clang, -O0):
<minval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <minval+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <minval+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @minval(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void teletype_wr_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @teletype_wr_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_logb();
scalar_t__ logb(double);
void test_logb(double d) {
  if (logb(d) != logb(d))
    link_failure_logb();
}


x86 assembly (clang, -O0):
<test_logb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <logb@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <logb@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_logb+0x3c>
mov    $0x0,%al
call   1040 <link_failure_logb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logb>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <logb@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <logb@plt>
cmp    %rax,%rbx
jne    1149 <test_logb+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_logb@plt>

LLVM IR (-O0):
define void @test_logb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @logb(double %3)
%5 = load double, double* %2
%6 = call i64 @logb(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_logb()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_logb(double %0) {
%2 = tail call i64 @logb(double %0)
%3 = tail call i64 @logb(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_logb()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_eiffel_comments() {
  test_parser_verify_parse(test_parser_sourcefile("eiffel", " --comment"),
                           "eiffel", "", "--comment", 0);
}


x86 assembly (clang, -O0):
<test_eiffel_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eiffel_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"eiffel\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"--comment\00"
define void @test_eiffel_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"eiffel\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"--comment\00"
define void @test_eiffel_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
short test_53_2(short *mem) { return __atomic_or_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_53_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    0x8(%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
or     %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1165 <test_53_2+0x65>
jmp    112d <test_53_2+0x2d>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
or     %cx,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_53_2>:
movzwl 0x8(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
or     $0x1,%ecx
lock cmpxchg %cx,0x8(%rdi)
jne    1110 <test_53_2+0x10>
or     $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @test_53_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw or i16* %6, i16 %7 acq_rel
%9 = or i16 %8, %7
store i16 %9, i16* %4
%10 = load i16, i16* %4
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @test_53_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw or i16* %2, i16 1 acq_rel
%4 = or i16 %3, 1
ret i16 %4
}
void setBit(unsigned char *c, unsigned index) { *c |= 1 << index; }


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %al,(%rdi)
ret

LLVM IR (-O0):
define void @setBit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = or i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @setBit(i8* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i8, i8* %0
%5 = trunc i32 %3 to i8
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int romanToInt(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[32];
  scanf("%s", s);
  printf("%d\n", romanToInt(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <romanToInt@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <romanToInt@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%6 = call i32 @romanToInt(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @romanToInt(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
size_t align(size_t offset, size_t alignment, bool ceil) {
  return (offset / alignment + (ceil && offset % alignment != 0)) * alignment;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     1144 <align+0x44>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    $0x0,%rdx
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x15(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
mov    %edx,%ecx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1118 <align+0x18>
xor    %edx,%edx
div    %rsi
jmp    111c <align+0x1c>
xor    %edx,%edx
div    %esi
xor    %edi,%edi
test   %rdx,%rdx
setne  %dil
xor    %edx,%edx
test   %ecx,%ecx
cmovne %rdi,%rdx
add    %rax,%rdx
imul   %rsi,%rdx
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @align(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = udiv i64 %7, %8
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = urem i64 %13, %14
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %12, %3
%18 = phi i1 [ false, %3 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
%20 = sext i32 %19 to i64
%21 = add i64 %9, %20
%22 = load i64, i64* %5
%23 = mul i64 %21, %22
ret i64 %23
}

LLVM IR (-O2):
define i64 @align(i64 %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = udiv i64 %0, %1
%6 = urem i64 %0, %1
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %4, i64 0, i64 %8
%10 = add i64 %5, %9
%11 = mul i64 %10, %1
ret i64 %11
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRAE_set(void) { return U_WMRCORENONE_set("U_WMRAE"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRAE\00"
define i8* @U_WMRAE_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRAE\00"
define i8* @U_WMRAE_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void RTFileReadAllByHandle(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileReadAllByHandle() {
ret void
}
/* Variables and functions */
int atol(char const *);
int atoi(const char *num) { return atol(num); }


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

x86 assembly (clang, -O2):
<atoi>:
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @atol(i8* %0)
ret i32 %2
}
void tgl_exists_release(void *ptr, int size) {}


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

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

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

LLVM IR (-O2):
define void @tgl_exists_release(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double cos(double);
double vertical_component(double comp, double angle) {
  return comp * cos(angle);
}


x86 assembly (clang, -O0):
<vertical_component>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vertical_component>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @vertical_component(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @cos(double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @vertical_component(double %0, double %1) {
%3 = tail call double @cos(double %1)
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ close_pipe(int, int /*<<< orphan*/ *);
int open_pipe(char const *, int /*<<< orphan*/ *);
int reopen_pipe(const char *p_path, int curr_fd, fd_set *p_rset) {
  int fifod;
  close_pipe(curr_fd, p_rset);
  fifod = open_pipe(p_path, p_rset);
}


x86 assembly (clang, -O0):
<reopen_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <close_pipe@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <open_pipe@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @reopen_pipe(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @close_pipe(i32 %1, i32* %2)
%5 = tail call i32 @open_pipe(i8* %0, i32* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_double(double x) { printf("%f", x); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @print_double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
void spacetounderscore(char *s) {
  for (; '\0' != *s; s++)
    if (' ' == *s)
      *s = '_';
}


x86 assembly (clang, -O0):
<spacetounderscore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     114a <spacetounderscore+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
jne    1134 <spacetounderscore+0x34>
mov    -0x8(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1139 <spacetounderscore+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <spacetounderscore+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spacetounderscore>:
jmp    1117 <spacetounderscore+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x20,%al
je     1110 <spacetounderscore+0x10>
test   %al,%al
jne    1113 <spacetounderscore+0x13>
ret

LLVM IR (-O0):
define void @spacetounderscore(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 0, %6
br i1 %7, label %8, label %19
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 32, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %2
store i8 95, i8* %14
br label %15
15: ; preds = %13, %8
br label %16
16: ; preds = %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @spacetounderscore(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 32, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ finish();
GS_EXCEPTION() { finish(); }


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

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

LLVM IR (-O0):
define i32 @GS_EXCEPTION() {
%1 = alloca i32
%2 = call i32 (...) @finish()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @GS_EXCEPTION() {
%1 = tail call i32 (...) @finish()
ret i32 undef
}
/* Type definitions */
struct compat_semaphore {
  int dummy;
};

/* Variables and functions */
int compat_down_trylock(struct compat_semaphore *);
int down_trylock(struct compat_semaphore *sem) {
  return compat_down_trylock(sem);
}


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

x86 assembly (clang, -O2):
<down_trylock>:
jmp    1030 <compat_down_trylock@plt>

LLVM IR (-O0):
%struct.compat_semaphore = type { i32 }
define i32 @down_trylock(%struct.compat_semaphore* %0) {
%2 = alloca %struct.compat_semaphore*
store %struct.compat_semaphore* %0, %struct.compat_semaphore** %2
%3 = load %struct.compat_semaphore*, %struct.compat_semaphore** %2
%4 = call i32 @compat_down_trylock(%struct.compat_semaphore* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.compat_semaphore = type { i32 }
define i32 @down_trylock(%struct.compat_semaphore* %0) {
%2 = tail call i32 @compat_down_trylock(%struct.compat_semaphore* %0)
ret i32 %2
}
/* Variables and functions */
unsigned long compress(int /*<<< orphan*/, short);
int /*<<< orphan*/ hash_string(char *);
unsigned long hash_variable_raw_info(char *name, short num_bits) {
  return compress(hash_string(name), num_bits);
}


x86 assembly (clang, -O0):
<hash_variable_raw_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hash_string@plt>
mov    %eax,%edi
movswl -0xa(%rbp),%esi
call   1030 <compress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_variable_raw_info>:
push   %rbx
mov    %esi,%ebx
call   1040 <hash_string@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <compress@plt>

LLVM IR (-O0):
define i64 @hash_variable_raw_info(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = call i32 @hash_string(i8* %5)
%7 = load i16, i16* %4
%8 = call i64 @compress(i32 %6, i16 signext %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @hash_variable_raw_info(i8* %0, i16 signext %1) {
%3 = tail call i32 @hash_string(i8* %0)
%4 = tail call i64 @compress(i32 %3, i16 signext %1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned long long *);
void destroySizeArr(unsigned long long *sizeArr) { free(sizeArr); }


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

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

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

LLVM IR (-O2):
define void @destroySizeArr(i64* nocapture %0) {
%2 = tail call i32 @free(i64* %0)
ret void
}
int isPrimeNumber(unsigned long int n) {
  int i;
  for (i = 2; i <= (n >> 1); i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isPrimeNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
cmp    %rcx,%rax
ja     115a <isPrimeNumber+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1147 <isPrimeNumber+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1161 <isPrimeNumber+0x61>
jmp    114c <isPrimeNumber+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <isPrimeNumber+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrimeNumber>:
mov    $0x1,%r8d
cmp    $0x4,%rdi
jb     115d <isPrimeNumber+0x5d>
mov    %rdi,%rax
shr    %rax
mov    $0x1,%esi
sub    %rax,%rsi
mov    $0x2,%ecx
nop
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1140 <isPrimeNumber+0x40>
mov    %rdi,%rax
xor    %edx,%edx
div    %rcx
test   %rdx,%rdx
jne    114b <isPrimeNumber+0x4b>
jmp    1161 <isPrimeNumber+0x61>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
test   %rdx,%rdx
je     1161 <isPrimeNumber+0x61>
lea    (%rsi,%rcx,1),%rax
add    $0x1,%rax
add    $0x1,%rcx
cmp    $0x2,%rax
jne    1120 <isPrimeNumber+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrimeNumber(i64 %0) {
%2 = icmp ult i64 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i64 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw i64 %9, 1
%7 = icmp eq i64 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i64 [ 2, %3 ], [ %6, %5 ]
%10 = urem i64 %0, %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
void hal_adc_process(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_adc_process() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testEqualTo() { printf("%d == %d = %d\n", 10, 4, 10 == 4); }


x86 assembly (clang, -O0):
<testEqualTo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testEqualTo>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d == %d = %d\0A\00"
define void @testEqualTo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d == %d = %d\0A\00"
define void @testEqualTo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SysTick_Wait(int);
void SysTick_Wait10ms(unsigned long delay) {
  unsigned long i;
  for (i = 0; i < delay; i++) {
    SysTick_Wait(800000);
  }
}


x86 assembly (clang, -O0):
<SysTick_Wait10ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    114d <SysTick_Wait10ms+0x3d>
mov    $0xc3500,%edi
call   1030 <SysTick_Wait@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <SysTick_Wait10ms+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTick_Wait10ms>:
push   %rbx
test   %rdi,%rdi
je     1130 <SysTick_Wait10ms+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0xc3500,%edi
call   1030 <SysTick_Wait@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <SysTick_Wait10ms+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @SysTick_Wait10ms(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @SysTick_Wait(i32 800000)
%6 = add nuw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ grille_ok(int, int **, int, int);
scalar_t__ xy_ok(int, int **, int, int);
int ft_pos_ok(int k, int **tab, int x, int y) {
  return (xy_ok(k, tab, x, y) && grille_ok(k, tab, x, y));
}


x86 assembly (clang, -O0):
<ft_pos_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <xy_ok@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1175 <ft_pos_ok+0x55>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <grille_ok@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_pos_ok>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <xy_ok@plt>
test   %rax,%rax
je     1159 <ft_pos_ok+0x39>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <grille_ok@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    115b <ft_pos_ok+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_pos_ok(i32 %0, i32** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32**
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32** %1, i32*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32**, i32*** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i64 @xy_ok(i32 %9, i32** %10, i32 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %4
%16 = load i32, i32* %5
%17 = load i32**, i32*** %6
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = call i64 @grille_ok(i32 %16, i32** %17, i32 %18, i32 %19)
%21 = icmp ne i64 %20, 0
br label %22
22: ; preds = %15, %4
%23 = phi i1 [ false, %4 ], [ %21, %15 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_pos_ok(i32 %0, i32** %1, i32 %2, i32 %3) {
%5 = tail call i64 @xy_ok(i32 %0, i32** %1, i32 %2, i32 %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i64 @grille_ok(i32 %0, i32** %1, i32 %2, i32 %3)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ profil(int /*<<< orphan*/ *, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ write_gmon();
void _stop_monitor(void) {
  profil(NULL, 0, 0, 0);
  write_gmon();
}


x86 assembly (clang, -O0):
<_stop_monitor>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <profil@plt>
mov    $0x0,%al
call   1030 <write_gmon@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stop_monitor>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <profil@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <write_gmon@plt>

LLVM IR (-O0):
define void @_stop_monitor() {
%1 = call i32 @profil(i32* null, i32 0, i32 0, i32 0)
%2 = call i32 (...) @write_gmon()
ret void
}

LLVM IR (-O2):
define void @_stop_monitor() {
%1 = tail call i32 @profil(i32* null, i32 0, i32 0, i32 0)
%2 = tail call i32 (...) @write_gmon()
ret void
}
void func() {
  int a = 10;
  int a1 = 20;
  int *b = &a;
  int *b1 = &a1;
  int **c;
  if (a > a1) {
    c = &b1;
  } else {
    c = &b;
  }
  int *d = *c;
  int e = *d;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113b <func+0x3b>
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1143 <func+0x43>
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a() { printf("main.c\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"main.c\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
void peripheral_clocks_on() {
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x10) =
      (1 << (2)) | (1 << (8));
}


x86 assembly (clang, -O0):
<peripheral_clocks_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc00,%eax
movq   $0x104,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<peripheral_clocks_on>:
mov    $0xfffffc10,%eax
movq   $0x104,(%rax)
ret

LLVM IR (-O0):
define void @peripheral_clocks_on() {
store volatile i64 260, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 16) to i64*)
ret void
}

LLVM IR (-O2):
define void @peripheral_clocks_on() {
store volatile i64 260, i64* inttoptr (i64 4294966288 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hell");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"Hell\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getMinAvailableFreq(int /*<<< orphan*/);
int /*<<< orphan*/ setAllFreq(int /*<<< orphan*/);
int /*<<< orphan*/ waitCurFreq(int /*<<< orphan*/, int /*<<< orphan*/);
void setMinFreqForAll() {
  setAllFreq(getMinAvailableFreq(0));
  waitCurFreq(0, getMinAvailableFreq(0));
}


x86 assembly (clang, -O0):
<setMinFreqForAll>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <getMinAvailableFreq@plt>
mov    %eax,%edi
call   1050 <setAllFreq@plt>
xor    %edi,%edi
call   1040 <getMinAvailableFreq@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <waitCurFreq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMinFreqForAll>:
push   %rax
xor    %edi,%edi
call   1040 <getMinAvailableFreq@plt>
mov    %eax,%edi
call   1050 <setAllFreq@plt>
xor    %edi,%edi
call   1040 <getMinAvailableFreq@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <waitCurFreq@plt>

LLVM IR (-O0):
define void @setMinFreqForAll() {
%1 = call i32 @getMinAvailableFreq(i32 0)
%2 = call i32 @setAllFreq(i32 %1)
%3 = call i32 @getMinAvailableFreq(i32 0)
%4 = call i32 @waitCurFreq(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @setMinFreqForAll() {
%1 = tail call i32 @getMinAvailableFreq(i32 0)
%2 = tail call i32 @setAllFreq(i32 %1)
%3 = tail call i32 @getMinAvailableFreq(i32 0)
%4 = tail call i32 @waitCurFreq(i32 0, i32 %3)
ret void
}