xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x2c() {
  Assert_real((isbdigit(44) == 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",
              225, ("isbdigit should be 0 for ,"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x2c>:
push   %rax
mov    $0x2c,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xe1,%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 = [27 x i8] c"isbdigit should be 0 for ,\00"
define void @t_isbdigit_0x2c() {
%1 = call i64 @isbdigit(i32 44)
%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 225, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isbdigit should be 0 for ,\00"
define void @t_isbdigit_0x2c() {
%1 = tail call i64 @isbdigit(i32 44)
%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 225, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void test() {
  int a = 0;
  printf("%d %d %d\n", a, a++, a);
  printf("%d %d %d\n", a++, a, a);
  printf("%d %d %d\n", a, a, a++);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @test() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %5)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 2)
ret void
}
int Snack_InitHandler() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Snack_InitHandler() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void log_oom_and_exit(void) {
  fprintf(stderr, "Out of memory. Exiting.");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<log_oom_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<log_oom_and_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Out of memory. Exiting.\00"
@EXIT_FAILURE = global i32 0
define void @log_oom_and_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Out of memory. Exiting.\00"
@EXIT_FAILURE = global i32 0
define void @log_oom_and_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fgetc1();
int main() {
  fgetc1();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @fgetc1()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int __attribute__((visibility("default"))) lib2fun() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lib2fun() {
ret i32 0
}
/* Type definitions */
struct intel_gt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ intel_gt_retire_requests_timeout(struct intel_gt *,
                                                    int /*<<< orphan*/,
                                                    int /*<<< orphan*/ *);
void intel_gt_retire_requests(struct intel_gt *gt) {
  intel_gt_retire_requests_timeout(gt, 0, NULL);
}


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

x86 assembly (clang, -O2):
<intel_gt_retire_requests>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <intel_gt_retire_requests_timeout@plt>

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

LLVM IR (-O2):
%struct.intel_gt = type { i32 }
define void @intel_gt_retire_requests(%struct.intel_gt* %0) {
%2 = tail call i32 @intel_gt_retire_requests_timeout(%struct.intel_gt* %0, i32 0, i32* null)
ret void
}
void ScaleRowDown38_3_Box_SSSE3() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sub_epi8(__m128i A, __m128i B) { return _mm_sub_epi8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sub_epi8>:
jmp    1030 <_mm_sub_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sub_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_epi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_spaces(char *s) {
  for (; *s != '\0' && isspace(*s); s++)
    ;
  return s;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_spaces+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_spaces+0x47>
jmp    116d <skip_spaces+0x5d>
jmp    115c <skip_spaces+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_spaces+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_spaces+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_spaces(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 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %19
15: ; preds = %13
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 = %13
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
__attribute__((no, noclone)) unsigned __int128 t101_4add(unsigned char x) {
  unsigned char y = (5);
  unsigned __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t101_4add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movb   $0x5,-0x12(%rbp)
movzbl -0x11(%rbp),%eax
mov    %eax,%ecx
movzbl -0x12(%rbp),%eax
add    %rax,%rcx
xor    %eax,%eax
mov    %rcx,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
test   $0x1,%al
jne    114a <t101_4add+0x3a>
jmp    1151 <t101_4add+0x41>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t101_4add>:
mov    %edi,%eax
add    $0x5,%rax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @t101_4add(i8 zeroext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i8
%5 = alloca i128
store i8 %0, i8* %3
store i8 5, i8* %4
%6 = load i8, i8* %3
%7 = load i8, i8* %4
%8 = zext i8 %6 to i128
%9 = zext i8 %7 to i128
%10 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %8, i128 %9)
%11 = extractvalue { i128, i1 } %10, 1
%12 = extractvalue { i128, i1 } %10, 0
store i128 %12, i128* %5
br i1 %11, label %13, label %15
13: ; preds = %1
%14 = call i32 (...) @bar()
br label %15
15: ; preds = %13, %1
%16 = load i128, i128* %5
store i128 %16, i128* %2
%17 = bitcast i128* %2 to { i64, i64 }*
%18 = load { i64, i64 }, { i64, i64 }* %17
ret { i64, i64 } %18
}

LLVM IR (-O2):
define { i64, i64 } @t101_4add(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = add nuw nsw i64 %2, 5
%4 = insertvalue { i64, i64 } poison, i64 %3, 0
%5 = insertvalue { i64, i64 } %4, i64 0, 1
ret { i64, i64 } %5
}
/* Variables and functions */
char const *bprintf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ geteuid();
const char *uid(void) { return bprintf("%d", geteuid()); }


x86 assembly (clang, -O0):
<uid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <bprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uid>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <bprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @uid() {
%1 = call i32 (...) @geteuid()
%2 = call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @uid() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M569_f(char *s) {
  debug("M569_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M569_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M569_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M569_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M569_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M569_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M569_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n;
  for (n = 0; n < 1000000; n++) {
    printf("Hello, this is iteration number: %d\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xf4240,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Hello, this is iteration number: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Hello, this is iteration number: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ errno;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int open_dev() {
  int fd;
  fd = open("/dev/xwaya", O_RDWR);
  if (fd < 0) {
    printf("/dev/xwaya open : %s\n", strerror(errno));
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1183 <open_dev+0x53>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <open_dev+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_dev>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     114c <open_dev+0x1c>
pop    %rcx
ret
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/xwaya\00"
@O_RDWR = global i32 0
@.str.1 = [22 x i8] c"/dev/xwaya open : %s\0A\00"
@errno = global i32 0
define i32 @open_dev() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 -1, i32* %1
br label %13
11: ; preds = %0
%12 = load i32, i32* %2
store i32 %12, i32* %1
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/xwaya\00"
@O_RDWR = global i32 0
@.str.1 = [22 x i8] c"/dev/xwaya open : %s\0A\00"
@errno = global i32 0
define i32 @open_dev() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ -1, %4 ], [ %2, %0 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ endian_rev32(int /*<<< orphan*/);
uint32_t endian_htonl(uint32_t data) { return endian_rev32(data); }


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

x86 assembly (clang, -O2):
<endian_htonl>:
jmp    1030 <endian_rev32@plt>

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

LLVM IR (-O2):
define i32 @endian_htonl(i32 %0) {
%2 = tail call i32 @endian_rev32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ do_cpuid(int /*<<< orphan*/, int *);
bool cpu_isintel(void) {
  uint32_t regs[4];
  do_cpuid(0, regs);
  if ((regs[1] == 0x756e6547) && (regs[2] == 0x6c65746e) &&
      (regs[3] == 0x49656e69))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<cpu_isintel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1030 <do_cpuid@plt>
cmpl   $0x756e6547,-0x1c(%rbp)
jne    1156 <cpu_isintel+0x46>
cmpl   $0x6c65746e,-0x18(%rbp)
jne    1156 <cpu_isintel+0x46>
cmpl   $0x49656e69,-0x14(%rbp)
jne    1156 <cpu_isintel+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115d <cpu_isintel+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_isintel>:
sub    $0x18,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <do_cpuid@plt>
mov    $0x756e6547,%eax
xor    0x4(%rsp),%eax
mov    $0x6c65746e,%ecx
xor    0x8(%rsp),%ecx
mov    $0x49656e69,%edx
xor    0xc(%rsp),%edx
or     %eax,%ecx
xor    %eax,%eax
or     %ecx,%edx
sete   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpu_isintel() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%4 = call i32 @do_cpuid(i32 0, i32* %3)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1970169159
br i1 %7, label %8, label %17
8: ; preds = %0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 1818588270
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 1231384169
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %1
br label %18
17: ; preds = %12, %8, %0
store i32 0, i32* %1
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @cpu_isintel() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @do_cpuid(i32 0, i32* %3)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1970169159
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1818588270
%11 = select i1 %7, i1 %10, i1 false
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 1231384169
%15 = select i1 %11, i1 %14, i1 false
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ print_instr(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void cgen_if(int num) {
  print_instr("li $t0 0");
  char str[100];
  sprintf(str, "beq $a0 $t0 END_IF%d", num);
  print_instr(str);
}


x86 assembly (clang, -O0):
<cgen_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <print_instr@plt>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <print_instr@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgen_if>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %edi,%ebx
lea    0xed0(%rip),%rdi
call   1030 <print_instr@plt>
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <print_instr@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"li $t0 0\00"
@.str.1 = [21 x i8] c"beq $a0 $t0 END_IF%d\00"
define void @cgen_if(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @print_instr(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"li $t0 0\00"
@.str.1 = [21 x i8] c"beq $a0 $t0 END_IF%d\00"
define void @cgen_if(i32 %0) {
%2 = alloca [100 x i8]
%3 = tail call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = call i32 @print_instr(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ strlwr(char *);
int main(int argc, char *argv[]) {
  puts(strlwr("ABC"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"ABC\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @strlwr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"ABC\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strlwr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i32 %3)
ret i32 0
}
int ft_toupper(int c) {
  if (c <= 122 && c >= 97)
    c -= 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <ft_toupper+0x24>
cmpl   $0x61,-0x4(%rbp)
jl     1124 <ft_toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 122
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void testfunc1(int foo6) {
  int foo7;
foo1:
foo2:
foo3:
foo4:
foo5:
foo6:
foo7:
testfunc1:
a:
i:
j:;
}


x86 assembly (clang, -O0):
<testfunc1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <testfunc1+0xc>
jmp    1111 <testfunc1+0x11>
jmp    1116 <testfunc1+0x16>
jmp    111b <testfunc1+0x1b>
jmp    1120 <testfunc1+0x20>
jmp    1125 <testfunc1+0x25>
jmp    112a <testfunc1+0x2a>
jmp    112f <testfunc1+0x2f>
jmp    1134 <testfunc1+0x34>
jmp    1139 <testfunc1+0x39>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testfunc1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @testfunc1(i32 %0) {
ret void
}
/* Type definitions */
struct plugin {
  int dummy;
};
struct command {
  int dummy;
};

/* Variables and functions */
int __id_ctrl(int, char **, struct command *, struct plugin *,
              int /*<<< orphan*/ *);
int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin) {
  return __id_ctrl(argc, argv, cmd, plugin, NULL);
}


x86 assembly (clang, -O0):
<id_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <__id_ctrl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_ctrl>:
xor    %r8d,%r8d
jmp    1030 <__id_ctrl@plt>

LLVM IR (-O0):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
define i32 @id_ctrl(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.command*
%8 = alloca %struct.plugin*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.command* %2, %struct.command** %7
store %struct.plugin* %3, %struct.plugin** %8
%9 = load i32, i32* %5
%10 = load i8**, i8*** %6
%11 = load %struct.command*, %struct.command** %7
%12 = load %struct.plugin*, %struct.plugin** %8
%13 = call i32 @__id_ctrl(i32 %9, i8** %10, %struct.command* %11, %struct.plugin* %12, i32* null)
ret i32 %13
}

LLVM IR (-O2):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
define i32 @id_ctrl(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3) {
%5 = tail call i32 @__id_ctrl(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ hash(char **);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200];
  scanf("%s", word);
  hash(&word);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [200 x i8], [200 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 = bitcast [200 x i8]* %2 to i8**
%6 = call i32 @hash(i8** %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 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 = bitcast [200 x i8]* %1 to i8**
%5 = call i32 @hash(i8** %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_20(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_20>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_20+0xb>

x86 assembly (clang, -O2):
<task_20>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_20+0x10>

LLVM IR (-O0):
define void @task_20() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_20() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void set_motors_speed(int steps_per_sec) {
  if (steps_per_sec > 0 && steps_per_sec < (500)) {
    printf("Set speed to %d\n", steps_per_sec);
  }
}


x86 assembly (clang, -O0):
<set_motors_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1141 <set_motors_speed+0x31>
cmpl   $0x1f4,-0x4(%rbp)
jge    1141 <set_motors_speed+0x31>
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_motors_speed>:
mov    %edi,%esi
lea    -0x1(%rsi),%eax
cmp    $0x1f2,%eax
ja     1128 <set_motors_speed+0x18>
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Set speed to %d\0A\00"
define void @set_motors_speed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 500
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Set speed to %d\0A\00"
define void @set_motors_speed(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 499
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strlcpy(char *, char const *, size_t);
char *xstrndup(const char *s, size_t len) {
  char *r;
  if (s == NULL)
    return NULL;
  r = (char *)malloc(len + 1);
  strlcpy(r, s, len + 1);
  return r;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <xstrndup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1176 <xstrndup+0x56>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1040 <strlcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114f <xstrndup+0x2f>
mov    %rsi,%rbx
mov    %rdi,%r15
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <strlcpy@plt>
jmp    1152 <xstrndup+0x32>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* null, i8** %3
br label %21
10: ; preds = %2
%11 = load i64, i64* %5
%12 = add i64 %11, 1
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = add i64 %17, 1
%19 = call i32 @strlcpy(i8* %15, i8* %16, i64 %18)
%20 = load i8*, i8** %6
store i8* %20, i8** %3
br label %21
21: ; preds = %10, %9
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strlcpy(i8* %7, i8* %0, i64 %5)
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
void *notnullable(const void *ptr) {
  assert(ptr);
  return (void *)ptr;
}


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

x86 assembly (clang, -O2):
<notnullable>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @notnullable(i8* returned %0) {
%2 = tail call i32 @assert(i8* %0)
ret i8* %0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *copyString(char *string) {
  int newStringLength = strlen(string) + 1;
  char *newString = malloc(newStringLength);
  memcpy(newString, string, newStringLength);
  return newString;
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @copyString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @copyString(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
void print_ldMatrix(Matrix_p, x_size, y_size) long *Matrix_p, x_size, y_size;
{
  int i;
  for (i = 0; i < y_size; ++i)
    print_ldArray(Matrix_p + (x_size * i), x_size);
  return;
}


x86 assembly (clang, -O0):
<print_ldMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1169 <print_ldMatrix+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <print_ldArray@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <print_ldMatrix+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ldMatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
jle    1146 <print_ldMatrix+0x36>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x0(,%rsi,8),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <print_ldArray@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <print_ldMatrix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_ldMatrix(i64* %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = mul nsw i64 %6, %1
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = tail call i32 (i64*, i64, ...) bitcast (i32 (...)* @print_ldArray to i32 (i64*, i64, ...)*)(i64* %8, i64 %1)
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *hotplug_basename(const char *path) {
  const char *name;
  name = strrchr(path, '/');
  if (name == NULL)
    return path;
  return &name[1];
}


x86 assembly (clang, -O0):
<hotplug_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <hotplug_basename+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <hotplug_basename+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hotplug_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hotplug_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @hotplug_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
unsigned int c_str_hash(const void *v1) {
  unsigned int hash = 0;
  char *p = (char *)v1;
  while (*p++)
    hash = (hash << 5) - (hash + *p);
  return hash;
}


x86 assembly (clang, -O0):
<c_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,(%rax)
je     114b <c_str_hash+0x4b>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rdx
movsbl (%rdx),%edx
add    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <c_str_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_str_hash>:
cmpb   $0x0,(%rdi)
je     1125 <c_str_hash+0x25>
add    $0x1,%rdi
xor    %ecx,%ecx
mov    %ecx,%eax
nopl   (%rax)
movsbl (%rdi),%edx
shl    $0x5,%eax
sub    %ecx,%eax
sub    %edx,%eax
add    $0x1,%rdi
mov    %eax,%ecx
test   %edx,%edx
jne    1110 <c_str_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @c_str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = mul i32 %6, 31
%11 = sub i32 %10, %9
%12 = icmp eq i8 %8, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %14
}