xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_cdda_url(char const *);
scalar_t__ is_cue_url(char const *);
scalar_t__ is_http_url(char const *);
int is_url(const char *name) {
  return is_http_url(name) || is_cdda_url(name) || is_cue_url(name);
}


x86 assembly (clang, -O0):
<is_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_http_url@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1185 <is_url+0x55>
mov    -0x8(%rbp),%rdi
call   1050 <is_cdda_url@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1185 <is_url+0x55>
mov    -0x8(%rbp),%rdi
call   1030 <is_cue_url@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_url>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <is_http_url@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1163 <is_url+0x33>
mov    %rbx,%rdi
call   1050 <is_cdda_url@plt>
test   %rax,%rax
jne    1163 <is_url+0x33>
mov    %rbx,%rdi
call   1030 <is_cue_url@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_url(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @is_http_url(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @is_cdda_url(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i64 @is_cue_url(i8* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_url(i8* %0) {
%2 = tail call i64 @is_http_url(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @is_cdda_url(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @is_cue_url(i8* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void set_8_pixel(uint8_t *buf, unsigned row_bytes, unsigned x, unsigned y,
                 unsigned value) {
  buf[row_bytes * y + x] = (uint8_t)value;
}


x86 assembly (clang, -O0):
<set_8_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    %ecx,%ecx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_8_pixel>:
mov    %r8d,%eax
imul   %ecx,%esi
add    %edx,%esi
mov    %rax,(%rdi,%rsi,8)
ret

LLVM IR (-O0):
define void @set_8_pixel(i64* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i64* %0, i64** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
%12 = zext i32 %11 to i64
%13 = load i64*, i64** %6
%14 = load i32, i32* %7
%15 = load i32, i32* %9
%16 = mul i32 %14, %15
%17 = load i32, i32* %8
%18 = add i32 %16, %17
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i64, i64* %13, i64 %19
store i64 %12, i64* %20
ret void
}

LLVM IR (-O2):
define void @set_8_pixel(i64* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = zext i32 %4 to i64
%7 = mul i32 %3, %1
%8 = add i32 %7, %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %0, i64 %9
store i64 %6, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int /*<<< orphan*/ f1(int **);
void g() {
  int b[100];
  f(b);
  int b1[100][200];
  f1(b1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13a10,%rsp
lea    -0x190(%rbp),%rdi
call   1030 <f@plt>
lea    -0x13a10(%rbp),%rdi
call   1040 <f1@plt>
add    $0x13a10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
sub    $0x13a18,%rsp
mov    %rsp,%rdi
call   1030 <f@plt>
lea    0x190(%rsp),%rdi
call   1040 <f1@plt>
add    $0x13a18,%rsp
ret

LLVM IR (-O0):
define void @g() {
%1 = alloca [100 x i32]
%2 = alloca [100 x [200 x i32]]
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
%5 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 0
%6 = bitcast [200 x i32]* %5 to i32**
%7 = call i32 @f1(i32** %6)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = alloca [100 x i32]
%2 = alloca [100 x [200 x i32]]
%3 = bitcast [100 x i32]* %1 to i8*
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%5 = call i32 @f(i32* %4)
%6 = bitcast [100 x [200 x i32]]* %2 to i8*
%7 = bitcast [100 x [200 x i32]]* %2 to i32**
%8 = call i32 @f1(i32** %7)
ret void
}
/* Variables and functions */
scalar_t__ gidtb_start();
scalar_t__ uidtb_start();
int ustar_stwr(void) {
  if ((uidtb_start() < 0) || (gidtb_start() < 0))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<ustar_stwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <uidtb_start@plt>
cmp    $0x0,%rax
jl     114a <ustar_stwr+0x2a>
mov    $0x0,%al
call   1040 <gidtb_start@plt>
cmp    $0x0,%rax
jge    1156 <ustar_stwr+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <ustar_stwr+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustar_stwr>:
push   %rax
xor    %eax,%eax
call   1030 <uidtb_start@plt>
test   %rax,%rax
js     113a <ustar_stwr+0x1a>
xor    %eax,%eax
call   1040 <gidtb_start@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ustar_stwr() {
%1 = tail call i64 (...) @uidtb_start()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @gidtb_start()
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct rx_possible_future {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void rx_free_possible_future(struct rx_possible_future *pf) {
  free((char *)pf);
}


x86 assembly (clang, -O0):
<rx_free_possible_future>:
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):
<rx_free_possible_future>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rx_possible_future = type { i32 }
define void @rx_free_possible_future(%struct.rx_possible_future* %0) {
%2 = alloca %struct.rx_possible_future*
store %struct.rx_possible_future* %0, %struct.rx_possible_future** %2
%3 = load %struct.rx_possible_future*, %struct.rx_possible_future** %2
%4 = bitcast %struct.rx_possible_future* %3 to i8*
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.rx_possible_future = type { i32 }
define void @rx_free_possible_future(%struct.rx_possible_future* nocapture %0) {
%2 = bitcast %struct.rx_possible_future* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
float floor(float);
float f_round(float x) { return floor(x + 0.5f); }


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

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

LLVM IR (-O0):
define float @f_round(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 5.000000e-01
%5 = call float @floor(float %4)
ret float %5
}

LLVM IR (-O2):
define float @f_round(float %0) {
%2 = fadd float %0, 5.000000e-01
%3 = tail call float @llvm.floor.f32(float %2)
ret float %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/
test_string_to_timespec_should_be_able_to_parse_all_regular_time_units();
int /*<<< orphan*/
test_string_to_timespec_should_be_able_to_parse_more_exotic_time_representations();
int /*<<< orphan*/
test_timespec_to_string_should_be_able_to_output_all_time_units();
int main() {
  test_timespec_to_string_should_be_able_to_output_all_time_units();
  test_string_to_timespec_should_be_able_to_parse_all_regular_time_units();
  test_string_to_timespec_should_be_able_to_parse_more_exotic_time_representations();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_timespec_to_string_should_be_able_to_output_all_time_units@plt>
xor    %eax,%eax
call   1030 <test_string_to_timespec_should_be_able_to_parse_all_regular_time_units@plt>
xor    %eax,%eax
call   1050 <test_string_to_timespec_should_be_able_to_parse_more_exotic_time_representations@plt>
mov    0x2e93(%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 (...) @test_timespec_to_string_should_be_able_to_output_all_time_units()
%3 = call i32 (...) @test_string_to_timespec_should_be_able_to_parse_all_regular_time_units()
%4 = call i32 (...) @test_string_to_timespec_should_be_able_to_parse_more_exotic_time_representations()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_timespec_to_string_should_be_able_to_output_all_time_units()
%2 = tail call i32 (...) @test_string_to_timespec_should_be_able_to_parse_all_regular_time_units()
%3 = tail call i32 (...) @test_string_to_timespec_should_be_able_to_parse_more_exotic_time_representations()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_shufflehi_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_shufflehi_epi16(__m128i A) { return _mm_shufflehi_epi16(A, 0); }


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

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

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

LLVM IR (-O2):
define i32 @test_mm_shufflehi_epi16(i32 %0) {
%2 = tail call i32 @_mm_shufflehi_epi16(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int /*<<< orphan*/);
int read(int, char *, int);
int read_data(int pfd, char *buf, int size) {
  int len = 0;
  memset(buf, size, '0');
  len = read(pfd, buf, size);
  return len;
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x30,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
mov    %edx,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <read@plt>

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

LLVM IR (-O2):
define i32 @read_data(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @memset(i8* %1, i32 %2, i32 48)
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcspn(char *, char *);
int strspn(char *, char *);
int main() {
  char bf[25] = "you shall not pass";
  char *s = "yous";
  printf("s %d\n", strspn(bf, s));
  printf("cs %d\n", strcspn(bf, s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x8(%rbp)
lea    0xea9(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strspn@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcspn@plt>
mov    %eax,%esi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.bf = [25 x i8] c"you shall not pass\00\00\00\00\00\00\00"
@.str = [5 x i8] c"yous\00"
@.str.1 = [6 x i8] c"s %d\0A\00"
@.str.2 = [7 x i8] c"cs %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [25 x i8]* %2 to i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @strspn(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @strcspn(i8* %9, i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"s %d\0A\00"
@.str.2 = [7 x i8] c"cs %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int close(int);
int netsock_close(int sock) { return close(sock); }


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

x86 assembly (clang, -O2):
<netsock_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @netsock_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x17() {
  Assert_real((isupper(23) == 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_isupper.c",
              120, ("isupper should be 0 for 0x17"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x17>:
push   %rax
mov    $0x17,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x78,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x17\00"
define void @t_isupper_0x17() {
%1 = tail call i64 @isupper(i32 23)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int *, int, int, struct timespec const *, int *,
            int);
int futex(int *uaddr, int futex_op, int val, const struct timespec *timeout,
          int *uaddr2, int val3) {
  return syscall(SYS_futex, uaddr, futex_op, val, timeout, uaddr, val3);
}


x86 assembly (clang, -O0):
<futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex>:
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    %r9d,(%rsp)
mov    %rsi,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i32*, i32** %7
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i32* %14, i32 %15, i32 %16, %struct.timespec* %17, i32* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* nocapture readnone %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %0, i32 %5)
ret i32 %8
}
void rlSetExperimentConnection(int connection) {}


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

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

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

LLVM IR (-O2):
define void @rlSetExperimentConnection(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
char *malloc(unsigned int);
char *alloc(unsigned int nb) {
  char *rp = malloc(nb);
  if (rp == NULL)
    errx(1, "out of memory");
  return rp;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <alloc+0x33>
mov    $0x1,%edi
lea    0xeb2(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <alloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void ErrMsg(const char *str) { fprintf(stderr, "%s", str); }


x86 assembly (clang, -O0):
<ErrMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrMsg>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @ErrMsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @ErrMsg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int most_significant_bit_pos_uchar(unsigned char);
int most_significant_bit_pos_schar(signed char num) {
  return most_significant_bit_pos_uchar((unsigned char)(int)num);
}


x86 assembly (clang, -O0):
<most_significant_bit_pos_schar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movzbl %al,%edi
call   1030 <most_significant_bit_pos_uchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<most_significant_bit_pos_schar>:
movzbl %dil,%edi
jmp    1030 <most_significant_bit_pos_uchar@plt>

LLVM IR (-O0):
define i32 @most_significant_bit_pos_schar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = trunc i32 %4 to i8
%6 = call i32 @most_significant_bit_pos_uchar(i8 zeroext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @most_significant_bit_pos_schar(i8 signext %0) {
%2 = tail call i32 @most_significant_bit_pos_uchar(i8 zeroext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ addFirst(char);
char getFirst();
int /*<<< orphan*/ removeFirst();
scalar_t__ size();
void left(char ch) {
  if (size() > 0) {
    if (getFirst() == ch) {
      removeFirst();
    } else {
      addFirst(ch);
    }
  } else {
    addFirst(ch);
  }
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <size@plt>
cmp    $0x0,%rax
jle    118f <left+0x4f>
mov    $0x0,%al
call   1050 <getFirst@plt>
movsbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1181 <left+0x41>
mov    $0x0,%al
call   1040 <removeFirst@plt>
jmp    118a <left+0x4a>
movsbl -0x1(%rbp),%edi
call   1060 <addFirst@plt>
jmp    1198 <left+0x58>
movsbl -0x1(%rbp),%edi
call   1060 <addFirst@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <size@plt>
test   %rax,%rax
jle    1162 <left+0x22>
xor    %eax,%eax
call   1050 <getFirst@plt>
cmp    %bl,%al
jne    1162 <left+0x22>
xor    %eax,%eax
pop    %rbx
jmp    1040 <removeFirst@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1060 <addFirst@plt>

LLVM IR (-O0):
define void @left(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 (...) @size()
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = call signext i8 (...) @getFirst()
%7 = sext i8 %6 to i32
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 (...) @removeFirst()
br label %16
13: ; preds = %5
%14 = load i8, i8* %2
%15 = call i32 @addFirst(i8 signext %14)
br label %16
16: ; preds = %13, %11
br label %20
17: ; preds = %1
%18 = load i8, i8* %2
%19 = call i32 @addFirst(i8 signext %18)
br label %20
20: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
define void @left(i8 signext %0) {
%2 = tail call i64 (...) @size()
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call signext i8 (...) @getFirst()
%6 = icmp eq i8 %5, %0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @removeFirst()
br label %13
9: ; preds = %4
%10 = tail call i32 @addFirst(i8 signext %0)
br label %13
11: ; preds = %1
%12 = tail call i32 @addFirst(i8 signext %0)
br label %13
13: ; preds = %7, %9, %11
ret void
}
void trim_whitespace(char *ptr) {
  while ((*ptr != ' ') && (*ptr != '\t') && (*ptr != '\r') && (*ptr != '\n'))
    ++ptr;
  *ptr = '\0';
}


x86 assembly (clang, -O0):
<trim_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <trim_whitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <trim_whitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     1157 <trim_whitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <trim_whitespace+0x67>
jmp    1178 <trim_whitespace+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trim_whitespace+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_whitespace>:
movabs $0x100002600,%rax
jmp    1114 <trim_whitespace+0x14>
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%rcx
ja     1110 <trim_whitespace+0x10>
bt     %rcx,%rax
jae    1110 <trim_whitespace+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @trim_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 32
br i1 %7, label %8, label %23
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 9
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 13
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 10
br label %23
23: ; preds = %18, %13, %8, %3
%24 = phi i1 [ false, %13 ], [ false, %8 ], [ false, %3 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
28: ; preds = %23
%29 = load i8*, i8** %2
store i8 0, i8* %29
ret void
}

LLVM IR (-O2):
define void @trim_whitespace(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 32, label %7
i8 9, label %7
i8 13, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  fprintf(stdout, "Hello\n");
  system("pause");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <system@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [6 x i8] c"pause\00"
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [6 x i8] c"pause\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int labs(long);
long randm(int);
long expr_wpn_add_dam(long lev) { return (randm(labs(lev) / 20 + 1)); }


x86 assembly (clang, -O0):
<expr_wpn_add_dam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x1,%edi
call   1040 <randm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr_wpn_add_dam>:
push   %rax
call   1030 <labs@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x23,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%edi
add    $0x1,%edi
pop    %rax
jmp    1040 <randm@plt>

LLVM IR (-O0):
define i64 @expr_wpn_add_dam(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @labs(i64 %3)
%5 = sdiv i32 %4, 20
%6 = add nsw i32 %5, 1
%7 = call i64 @randm(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @expr_wpn_add_dam(i64 %0) {
%2 = tail call i32 @labs(i64 %0)
%3 = sdiv i32 %2, 20
%4 = add nsw i32 %3, 1
%5 = tail call i64 @randm(i32 %4)
ret i64 %5
}
void i2d_X509_SIG(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_SIG() {
ret void
}
/* Type definitions */
struct termios {
  int c_oflag;
};

/* Variables and functions */
int INLCR;
int OPOST;
int /*<<< orphan*/ TCSADRAIN;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void newlines_on(void) {
  struct termios t;
  tcgetattr(0, &t);
  t.c_oflag |= (INLCR | OPOST);
  tcsetattr(0, TCSADRAIN, &t);
}


x86 assembly (clang, -O0):
<newlines_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    0x2e9d(%rip),%rcx
or     (%rcx),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newlines_on>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <tcgetattr@plt>
mov    0x2ead(%rip),%rax
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
or     %ecx,0x8(%rsp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@INLCR = global i32 0
@OPOST = global i32 0
@TCSADRAIN = global i32 0
define void @newlines_on() {
%1 = alloca %struct.termios
%2 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%3 = load i32, i32* @INLCR
%4 = load i32, i32* @OPOST
%5 = or i32 %3, %4
%6 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = or i32 %7, %5
store i32 %8, i32* %6
%9 = load i32, i32* @TCSADRAIN
%10 = call i32 @tcsetattr(i32 0, i32 %9, %struct.termios* %1)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@INLCR = global i32 0
@OPOST = global i32 0
@TCSADRAIN = global i32 0
define void @newlines_on() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%4 = load i32, i32* @INLCR
%5 = load i32, i32* @OPOST
%6 = or i32 %5, %4
%7 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = or i32 %6, %8
store i32 %9, i32* %7
%10 = load i32, i32* @TCSADRAIN
%11 = call i32 @tcsetattr(i32 0, i32 %10, %struct.termios* %1)
ret void
}
/* Variables and functions */
int muspcm_getpos(int);
int mus_wav_get_playposition(int ch) { return muspcm_getpos(ch + 1); }


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

x86 assembly (clang, -O2):
<mus_wav_get_playposition>:
add    $0x1,%edi
jmp    1030 <muspcm_getpos@plt>

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

LLVM IR (-O2):
define i32 @mus_wav_get_playposition(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @muspcm_getpos(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("Hello, World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stacks {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stacks *);
void destroy_stacks(struct stacks *s) { free(s); }


x86 assembly (clang, -O0):
<destroy_stacks>:
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):
<destroy_stacks>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.stacks = type { i32 }
define void @destroy_stacks(%struct.stacks* nocapture %0) {
%2 = tail call i32 @free(%struct.stacks* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void myexit(void) { pr_info("hello2 exit\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello2 exit\0A\00"
define void @myexit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello2 exit\0A\00"
define void @myexit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void glutVideoResize(int x, int y, int w, int h) {}


x86 assembly (clang, -O0):
<glutVideoResize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glutVideoResize(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
ret void
}

LLVM IR (-O2):
define void @glutVideoResize(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EightFunction();
int /*<<< orphan*/ FiveFunction();
int /*<<< orphan*/ printf(char *);
int main() {
  FiveFunction();
  EightFunction();
  printf("Dependency test executable ran successfully.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"Dependency test executable ran successfully.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @FiveFunction()
%3 = call i32 (...) @EightFunction()
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [45 x i8] c"Dependency test executable ran successfully.\00"
define i32 @main() {
%1 = tail call i32 (...) @FiveFunction()
%2 = tail call i32 (...) @EightFunction()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool is_file(const char *path) {
  struct stat test;
  if (stat(path, &test) == 0 && S_ISDIR(test.st_mode)) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    1161 <is_file+0x41>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1161 <is_file+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_file+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1142 <is_file+0x22>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1142 <is_file+0x22>
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISDIR(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 0, i32* %2
br label %15
14: ; preds = %8, %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %1
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 1, %11 ], [ 0, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
int __gnat_florist_open(const char *path, int oflag, mode_t mode) {
  return open(path, oflag, mode);
}


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

x86 assembly (clang, -O2):
<__gnat_florist_open>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @__gnat_florist_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @open(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__gnat_florist_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int svm_check_intercept_param(unsigned int, int /*<<< orphan*/);
int svm_check_intercept(unsigned int type) {
  return svm_check_intercept_param(type, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @svm_check_intercept(i32 %0) {
%2 = tail call i32 @svm_check_intercept_param(i32 %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct icom {
  int dummy;
};

/* Variables and functions */
int imc_scale_WCS2(struct icom *, float, float);
int imc_scale_WCS(struct icom *icom, float scale) {
  return imc_scale_WCS2(icom, scale, scale);
}


x86 assembly (clang, -O0):
<imc_scale_WCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <imc_scale_WCS2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imc_scale_WCS>:
movaps %xmm0,%xmm1
jmp    1030 <imc_scale_WCS2@plt>

LLVM IR (-O0):
%struct.icom = type { i32 }
define i32 @imc_scale_WCS(%struct.icom* %0, float %1) {
%3 = alloca %struct.icom*
%4 = alloca float
store %struct.icom* %0, %struct.icom** %3
store float %1, float* %4
%5 = load %struct.icom*, %struct.icom** %3
%6 = load float, float* %4
%7 = load float, float* %4
%8 = call i32 @imc_scale_WCS2(%struct.icom* %5, float %6, float %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.icom = type { i32 }
define i32 @imc_scale_WCS(%struct.icom* %0, float %1) {
%3 = tail call i32 @imc_scale_WCS2(%struct.icom* %0, float %1, float %1)
ret i32 %3
}
long long f_int_3(long long x) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @f_int_3(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ xwrite(int, char *, int);
void my_putfd(int fd, char c) { xwrite(fd, &c, 1); }


x86 assembly (clang, -O0):
<my_putfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <xwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putfd>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <xwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @my_putfd(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @xwrite(i32 %5, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @my_putfd(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @xwrite(i32 %0, i8* %3, i32 1)
ret void
}