xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ addch(char);
void ushell_putc(char c) { addch(c); }


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

x86 assembly (clang, -O2):
<ushell_putc>:
jmp    1030 <addch@plt>

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

LLVM IR (-O2):
define void @ushell_putc(i8 signext %0) {
%2 = tail call i32 @addch(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ counting_sort(int *, int *, int, int);
int *malloc(int);
int *radix_sort(int A[], int d, int n) {
  int *B = malloc(sizeof(int) * 1000);
  for (int i = 1; i <= d; i++) {
    counting_sort(A, B, 100, n);
  }
  return B;
}


x86 assembly (clang, -O0):
<radix_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xfa0,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1176 <radix_sort+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%ecx
mov    $0x64,%edx
call   1030 <counting_sort@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1147 <radix_sort+0x27>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
mov    $0xfa0,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    1158 <radix_sort+0x38>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
mov    %r14d,%ecx
call   1030 <counting_sort@plt>
add    $0xffffffff,%ebp
jne    1140 <radix_sort+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @radix_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i32* @malloc(i32 4000)
store i32* %9, i32** %7
store i32 1, i32* %8
br label %10
10: ; preds = %19, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %5
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32*, i32** %4
%16 = load i32*, i32** %7
%17 = load i32, i32* %6
%18 = call i32 @counting_sort(i32* %15, i32* %16, i32 100, i32 %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %10
22: ; preds = %10
%23 = load i32*, i32** %7
ret i32* %23
}

LLVM IR (-O2):
define i32* @radix_sort(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32* @malloc(i32 4000)
%5 = icmp slt i32 %1, 1
br i1 %5, label %6, label %7
6: ; preds = %7, %3
ret i32* %4
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 1, %3 ]
%9 = tail call i32 @counting_sort(i32* %0, i32* %4, i32 100, i32 %2)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %8, %1
br i1 %11, label %6, label %7
}
/* Variables and functions */
bool san_is_rank(char chr) { return '1' <= chr && chr <= '8'; }


x86 assembly (clang, -O0):
<san_is_rank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x31,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <san_is_rank+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x38,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<san_is_rank>:
add    $0xcf,%dil
xor    %eax,%eax
cmp    $0x8,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @san_is_rank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 49, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 56
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @san_is_rank(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 8
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void gcgfree(void *ptr) { free((char *)ptr); }


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

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

LLVM IR (-O2):
define void @gcgfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bcm2835_gpio_clr_multi(int /*<<< orphan*/);
int /*<<< orphan*/ bcm2835_gpio_set_multi(int /*<<< orphan*/);
void bcm2835_gpio_write_multi(uint32_t mask, uint8_t on) {
  if (on)
    bcm2835_gpio_set_multi(mask);
  else
    bcm2835_gpio_clr_multi(mask);
}


x86 assembly (clang, -O0):
<bcm2835_gpio_write_multi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <bcm2835_gpio_write_multi+0x27>
mov    -0x4(%rbp),%edi
call   1030 <bcm2835_gpio_set_multi@plt>
jmp    114f <bcm2835_gpio_write_multi+0x2f>
mov    -0x4(%rbp),%edi
call   1040 <bcm2835_gpio_clr_multi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm2835_gpio_write_multi>:
test   %rsi,%rsi
je     112a <bcm2835_gpio_write_multi+0xa>
jmp    1030 <bcm2835_gpio_set_multi@plt>
jmp    1040 <bcm2835_gpio_clr_multi@plt>

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

LLVM IR (-O2):
define void @bcm2835_gpio_write_multi(i32 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @bcm2835_gpio_set_multi(i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @bcm2835_gpio_clr_multi(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_output(char *);
char *mstring_find_before(int /*<<< orphan*/, char);
char *palloc(int);
char *agmd5_generate(void) {
  char *buff = palloc(sizeof(char) * 32);
  buff = mstring_find_before(get_output("date | md5sum"), ' ');
  return buff;
}


x86 assembly (clang, -O0):
<agmd5_generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <palloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <get_output@plt>
mov    %eax,%edi
mov    $0x20,%esi
call   1050 <mstring_find_before@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agmd5_generate>:
push   %rax
mov    $0x20,%edi
call   1030 <palloc@plt>
lea    0xebe(%rip),%rdi
call   1040 <get_output@plt>
mov    %eax,%edi
mov    $0x20,%esi
pop    %rax
jmp    1050 <mstring_find_before@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"date | md5sum\00"
define i8* @agmd5_generate() {
%1 = alloca i8*
%2 = call i8* @palloc(i32 32)
store i8* %2, i8** %1
%3 = call i32 @get_output(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @mstring_find_before(i32 %3, i8 signext 32)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [14 x i8] c"date | md5sum\00"
define i8* @agmd5_generate() {
%1 = tail call i8* @palloc(i32 32)
%2 = tail call i32 @get_output(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @mstring_find_before(i32 %2, i8 signext 32)
ret i8* %3
}
/* Type definitions */
struct uwsgi_legion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *uwsgi_concat2(char *, char *);
int /*<<< orphan*/ uwsgi_log(char *);
int legion_action_log(struct uwsgi_legion *ul, char *arg) {
  char *logline = uwsgi_concat2(arg, "\n");
  uwsgi_log(logline);
  free(logline);
  return 0;
}


x86 assembly (clang, -O0):
<legion_action_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <uwsgi_concat2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <uwsgi_log@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<legion_action_log>:
push   %rbx
mov    %rsi,%rdi
lea    0xec5(%rip),%rsi
call   1050 <uwsgi_concat2@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <uwsgi_log@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.uwsgi_legion = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @legion_action_log(%struct.uwsgi_legion* %0, i8* %1) {
%3 = alloca %struct.uwsgi_legion*
%4 = alloca i8*
%5 = alloca i8*
store %struct.uwsgi_legion* %0, %struct.uwsgi_legion** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i8* @uwsgi_concat2(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @uwsgi_log(i8* %8)
%10 = load i8*, i8** %5
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.uwsgi_legion = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @legion_action_log(%struct.uwsgi_legion* nocapture readnone %0, i8* %1) {
%3 = tail call i8* @uwsgi_concat2(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @uwsgi_log(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
int execute_migrate_pages() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_migrate_pages() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t ip_get_cksum(const uint8_t *p_ip) {
  return (p_ip[10] << 8) | p_ip[11];
}


x86 assembly (clang, -O0):
<ip_get_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x2c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_cksum>:
mov    0x28(%rdi),%eax
shl    $0x8,%eax
or     0x2c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ip_get_cksum(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 10
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 11
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ip_get_cksum(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 11
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *i) { printf("'%s' ", i); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"'%s' \00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ip;
  printf("\n enter the alphabet");
  scanf("%c", &ip);
  if (ip == 65 && 90 || 97 && 122)
    printf("\n the given thing is alphabet");
  else
    printf("\n the given thing is not alphabet");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
je     1167 <main+0x47>
mov    $0x1,%al
test   $0x1,%al
jne    1167 <main+0x47>
jmp    1178 <main+0x58>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x64>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0A enter the alphabet\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [30 x i8] c"\0A the given thing is alphabet\00"
@.str.3 = [34 x i8] c"\0A the given thing is not alphabet\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 65
br i1 %7, label %9, label %8
8: ; preds = %0
br i1 true, label %9, label %11
9: ; preds = %8, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0A enter the alphabet\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [30 x i8] c"\0A the given thing is alphabet\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void free_array(double **m) {
  free(m[0]);
  free(m);
}


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

x86 assembly (clang, -O2):
<free_array>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_array(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_array(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void http_write_content_length(char *buffer, unsigned int content_length) {
  strcat(buffer, "Content-Length: ");
  strcat(buffer, "\r\n");
}


x86 assembly (clang, -O0):
<http_write_content_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_write_content_length>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcat@plt>
lea    0xeea(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Content-Length: \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @http_write_content_length(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Content-Length: \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @http_write_content_length(i8* %0, i32 %1) {
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_4Fuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x4f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fuint64_lowword_reg>:
test   $0x4f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 79
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_4Fuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 79
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ setLDriveBase(int, int);
int /*<<< orphan*/ setRDriveBase(int, int);
void move(int time, int left, int right) {
  setLDriveBase(left, time);
  setRDriveBase(right, time);
  setLDriveBase(left, 0);
  setRDriveBase(right, 0);
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <setLDriveBase@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <setRDriveBase@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <setLDriveBase@plt>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1040 <setRDriveBase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %esi,%edi
mov    %ebx,%esi
call   1030 <setLDriveBase@plt>
mov    %r14d,%edi
mov    %ebx,%esi
call   1040 <setRDriveBase@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <setLDriveBase@plt>
mov    %r14d,%edi
xor    %esi,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <setRDriveBase@plt>

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

LLVM IR (-O2):
define void @move(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @setLDriveBase(i32 %1, i32 %0)
%5 = tail call i32 @setRDriveBase(i32 %2, i32 %0)
%6 = tail call i32 @setLDriveBase(i32 %1, i32 0)
%7 = tail call i32 @setRDriveBase(i32 %2, i32 0)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int mDepth(struct TreeNode *);
int minDepth(struct TreeNode *root) {
  if (!root) {
    return 0;
  }
  return mDepth(root);
}


x86 assembly (clang, -O0):
<minDepth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <minDepth+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <minDepth+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <mDepth@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minDepth>:
test   %rdi,%rdi
je     111a <minDepth+0xa>
jmp    1030 <mDepth@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @minDepth(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca %struct.TreeNode*
store %struct.TreeNode* %0, %struct.TreeNode** %3
%4 = load %struct.TreeNode*, %struct.TreeNode** %3
%5 = icmp ne %struct.TreeNode* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load %struct.TreeNode*, %struct.TreeNode** %3
%9 = call i32 @mDepth(%struct.TreeNode* %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @minDepth(%struct.TreeNode* %0) {
%2 = icmp eq %struct.TreeNode* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @mDepth(%struct.TreeNode* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int register_module_notifier(struct notifier_block *nb) { return 0; }


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @register_module_notifier(%struct.notifier_block* %0) {
%2 = alloca %struct.notifier_block*
store %struct.notifier_block* %0, %struct.notifier_block** %2
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @register_module_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ toggle_mptcp();
int main(void) {
  toggle_mptcp();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @toggle_mptcp()
ret i32 0
}
AR0AX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (((unsigned short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114b <AR0AX1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <AR0AX1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AX1>:
movzwl 0x1312d00(%r8),%edx
01
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setbe  %al
ret

LLVM IR (-O0):
define i32 @AR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = zext i16 %18 to i32
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %21
%23 = load i16, i16* %22
%24 = zext i16 %23 to i32
%25 = icmp sle i32 %19, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @AR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %9
%11 = load i16, i16* %10
%12 = icmp ule i16 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int get_byte();
short get_short(void) {
  short sword;
  sword = (get_byte() << 8) + get_byte();
  return sword;
}


x86 assembly (clang, -O0):
<get_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_byte@plt>
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_byte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_short>:
push   %rbx
xor    %eax,%eax
call   1030 <get_byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <get_byte@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @get_short() {
%1 = alloca i16
%2 = call i32 (...) @get_byte()
%3 = shl i32 %2, 8
%4 = call i32 (...) @get_byte()
%5 = add nsw i32 %3, %4
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @get_short() {
%1 = tail call i32 (...) @get_byte()
%2 = shl i32 %1, 8
%3 = tail call i32 (...) @get_byte()
%4 = add nsw i32 %2, %3
%5 = trunc i32 %4 to i16
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n)) {
    printf("%d\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     115d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     117c <main+0x5c>
lea    0xebd(%rip),%r14
lea    0xeb3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
double cosh(double);
double sech(double x) {
  double temp;
  temp = cosh(x);
  return (1.0 / temp);
}


x86 assembly (clang, -O0):
<sech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cosh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sech>:
push   %rax
call   1030 <cosh@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sech(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @cosh(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fdiv double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @sech(double %0) {
%2 = tail call double @cosh(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ print_error(char *);
bool interrupt_gigabit(void) {
  errno = 0;
  return ({
    print_error("Interrupt not suppported for gigabit");
    false;
  });
}


x86 assembly (clang, -O0):
<interrupt_gigabit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
movq   $0x0,(%rax)
lea    0xed3(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_gigabit>:
push   %rax
mov    0x2ec8(%rip),%rax
movq   $0x0,(%rax)
lea    0xeda(%rip),%rdi
call   1030 <print_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [37 x i8] c"Interrupt not suppported for gigabit\00"
define i32 @interrupt_gigabit() {
%1 = alloca i32
store i64 0, i64* @errno
%2 = call i32 @print_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [37 x i8] c"Interrupt not suppported for gigabit\00"
define i32 @interrupt_gigabit() {
store i64 0, i64* @errno
%1 = tail call i32 @print_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct RNAfold_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAfold_args_info *);
int /*<<< orphan*/ clear_given(struct RNAfold_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAfold_args_info *);
void RNAfold_cmdline_parser_init(struct RNAfold_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAfold_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAfold_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAfold_args_info = type { i32 }
define void @RNAfold_cmdline_parser_init(%struct.RNAfold_args_info* %0) {
%2 = alloca %struct.RNAfold_args_info*
store %struct.RNAfold_args_info* %0, %struct.RNAfold_args_info** %2
%3 = load %struct.RNAfold_args_info*, %struct.RNAfold_args_info** %2
%4 = call i32 @clear_given(%struct.RNAfold_args_info* %3)
%5 = load %struct.RNAfold_args_info*, %struct.RNAfold_args_info** %2
%6 = call i32 @clear_args(%struct.RNAfold_args_info* %5)
%7 = load %struct.RNAfold_args_info*, %struct.RNAfold_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAfold_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAfold_args_info = type { i32 }
define void @RNAfold_cmdline_parser_init(%struct.RNAfold_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAfold_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAfold_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAfold_args_info* %0)
ret void
}
void GlutMouse(int a, int b, int c, int d) {}


x86 assembly (clang, -O0):
<GlutMouse>:
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):
<GlutMouse>:
ret

LLVM IR (-O0):
define void @GlutMouse(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 @GlutMouse(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int memcmp(char const *, char const *, int);
int memcmp_fake(const char *s1, const char *s2, int n) {
  int x = memcmp(s1, s2, n);
  return x < 0 ? n - 1 : n + 1;
}


x86 assembly (clang, -O0):
<memcmp_fake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    114e <memcmp_fake+0x3e>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <memcmp_fake+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp_fake>:
push   %rbx
mov    %edx,%ebx
call   1030 <memcmp@plt>
sar    $0x1f,%eax
or     $0x1,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @memcmp_fake(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @memcmp(i8* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 1
br label %20
17: ; preds = %3
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
br label %20
20: ; preds = %17, %14
%21 = phi i32 [ %16, %14 ], [ %19, %17 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @memcmp_fake(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 1, i32 -1
%7 = add nsw i32 %6, %2
ret i32 %7
}
void sig_int(int x) { return; }


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

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

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

LLVM IR (-O2):
define void @sig_int(i32 %0) {
ret void
}
int block_read(int dev, long *pos, int cnt, char *buf) {
  int blk = *pos / 1024;
  int offs = *pos % 1024;
}


x86 assembly (clang, -O0):
<block_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @block_read(i32 %0, i64* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i64* %1, i64** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%12 = load i64*, i64** %7
%13 = load i64, i64* %12
%14 = sdiv i64 %13, 1024
%15 = trunc i64 %14 to i32
store i32 %15, i32* %10
%16 = load i64*, i64** %7
%17 = load i64, i64* %16
%18 = srem i64 %17, 1024
%19 = trunc i64 %18 to i32
store i32 %19, i32* %11
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @block_read(i32 %0, i64* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 undef
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int val1 = 229;
  int val2 = 281;
  int result = val1 ^ ((val1 ^ val2) & -(val1 < val2));
  printf("The maximum of %d and %d is: %d\n", val1, val2, result);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe5,-0x8(%rbp)
movl   $0x119,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%edx
cmp    -0xc(%rbp),%edx
setl   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xe5,%esi
mov    $0x119,%edx
mov    $0x119,%ecx
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"The maximum of %d and %d is: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 229, i32* %2
store i32 281, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
store i32 %15, i32* %4
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [33 x i8] c"The maximum of %d and %d is: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 229, i32 281, i32 281)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int c();
int d() { return c() + 1; }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
push   %rax
xor    %eax,%eax
call   1030 <c@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @d() {
%1 = call i32 (...) @c()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @d() {
%1 = tail call i32 (...) @c()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ ft_memcpy(void *, void const *, int /*<<< orphan*/);
int /*<<< orphan*/ ft_strlen(char const *);
char *ft_strcpy(char *dest, const char *src) {
  return ((char *)ft_memcpy((void *)dest, (const void *)src, ft_strlen(src)));
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <ft_memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <ft_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_memcpy@plt>

LLVM IR (-O0):
define i8* @ft_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i64 @ft_memcpy(i8* %5, i8* %6, i32 %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @ft_strcpy(i8* %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %1)
%4 = tail call i64 @ft_memcpy(i8* %0, i8* %1, i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *);
int /*<<< orphan*/ halt(int /*<<< orphan*/, int /*<<< orphan*/ *);
char *macrunerror(char *arg) {
  halt(get_string(arg), NULL);
  return (arg);
}


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

x86 assembly (clang, -O2):
<macrunerror>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_string@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <halt@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @macrunerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_string(i8* %3)
%5 = call i32 @halt(i32 %4, i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define i8* @macrunerror(i8* returned %0) {
%2 = tail call i32 @get_string(i8* %0)
%3 = tail call i32 @halt(i32 %2, i32* null)
ret i8* %0
}
/* Variables and functions */
int __internal_syscall(int, long, long, long, long);
int _faccessat(int dirfd, const char *file, int mode, int flags) {
  return __internal_syscall(48, (long)(dirfd), (long)(file), (long)(mode),
                            (long)(flags));
}


x86 assembly (clang, -O0):
<_faccessat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rcx
movslq -0x18(%rbp),%r8
mov    $0x30,%edi
call   1030 <__internal_syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_faccessat>:
mov    %rsi,%r9
movslq %edi,%rsi
movslq %edx,%rax
movslq %ecx,%r8
mov    $0x30,%edi
mov    %r9,%rdx
mov    %rax,%rcx
jmp    1030 <__internal_syscall@plt>

LLVM IR (-O0):
define i32 @_faccessat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = call i32 @__internal_syscall(i32 48, i64 %10, i64 %12, i64 %14, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @_faccessat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = sext i32 %0 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sext i32 %2 to i64
%8 = sext i32 %3 to i64
%9 = tail call i32 @__internal_syscall(i32 48, i64 %5, i64 %6, i64 %7, i64 %8)
ret i32 %9
}
/* Variables and functions */
int rand();
int randomNumberGenerator(int treeDepth) {
  int counter, randomNumber;
  for (counter = 1; counter <= treeDepth; counter++) {
    randomNumber = rand() % 100 + 1;
  }
  return randomNumber;
}


x86 assembly (clang, -O0):
<randomNumberGenerator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1151 <randomNumberGenerator+0x41>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <randomNumberGenerator+0x12>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumberGenerator>:
test   %edi,%edi
jle    114e <randomNumberGenerator+0x3e>
push   %rbx
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
add    $0xffffffff,%ebx
jne    1120 <randomNumberGenerator+0x10>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbx
ret
ret

LLVM IR (-O0):
define i32 @randomNumberGenerator(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @randomNumberGenerator(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 (...) @rand()
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = srem i32 %5, 100
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %8, %1
%12 = phi i32 [ %10, %8 ], [ undef, %1 ]
ret i32 %12
}
void DMA2_Channel2_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA2_Channel2_IRQHandler() {
ret void
}