xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_header(void) { puts("{\"version\":1}\n["); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"{\22version\22:1}\0A[\00"
define void @print_header() {
%1 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"{\22version\22:1}\0A[\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  int window_size = (sizeof(int) <= 2 ? (unsigned)512 : 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x400,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int pop_int();
int /*<<< orphan*/ stderr;
bool pop_bool() {
  int i = pop_int();
  if (i == 0 || i == 1) {
    return i;
  }
  fprintf(stderr, "pop_bool: not 0 or 1\n");
  exit(0);
}


x86 assembly (clang, -O0):
<pop_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pop_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1156 <pop_bool+0x26>
cmpl   $0x1,-0x4(%rbp)
jne    115f <pop_bool+0x2f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<pop_bool>:
push   %rax
xor    %eax,%eax
call   1040 <pop_int@plt>
cmp    $0x1,%eax
ja     113f <pop_bool+0xf>
pop    %rcx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"pop_bool: not 0 or 1\0A\00"
define i32 @pop_bool() {
%1 = alloca i32
%2 = call i32 (...) @pop_int()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5, %0
%9 = load i32, i32* %1
ret i32 %9
10: ; preds = %5
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"pop_bool: not 0 or 1\0A\00"
define i32 @pop_bool() {
%1 = tail call i32 (...) @pop_int()
%2 = icmp ult i32 %1, 2
br i1 %2, label %3, label %4
3: ; preds = %0
ret i32 %1
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double log(double);
double log_wrapper(double *arg_list) { return (log(arg_list[0])); }


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

x86 assembly (clang, -O2):
<log_wrapper>:
movsd  (%rdi),%xmm0
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @log_wrapper(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 = call double @log(double %5)
ret double %6
}

LLVM IR (-O2):
define double @log_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @log(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int);
void f_variadic_unp_inv(void) {
  int t;
  int v = 3;
  int *tp = &t;
  doStuff_variadic(tp, v);
}


x86 assembly (clang, -O0):
<f_variadic_unp_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <doStuff_variadic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_variadic_unp_inv>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f_variadic_unp_inv() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 3, i32* %2
store i32* %1, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %2
%6 = call i32 @doStuff_variadic(i32* %4, i32 %5)
ret void
}

LLVM IR (-O2):
define void @f_variadic_unp_inv() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @doStuff_variadic(i32* %1, i32 3)
ret void
}
/* Variables and functions */
unsigned int advance_peek();
unsigned int peek();
unsigned skip_space_peek(void) {
  unsigned b = peek();
  while (b == ' ')
    b = advance_peek();
  return b;
}


x86 assembly (clang, -O0):
<skip_space_peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <peek@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jne    114b <skip_space_peek+0x2b>
mov    $0x0,%al
call   1040 <advance_peek@plt>
mov    %eax,-0x4(%rbp)
jmp    1132 <skip_space_peek+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space_peek>:
push   %rax
xor    %eax,%eax
call   1030 <peek@plt>
cmp    $0x20,%eax
jne    113c <skip_space_peek+0x1c>
nopl   (%rax)
xor    %eax,%eax
call   1040 <advance_peek@plt>
cmp    $0x20,%eax
je     1130 <skip_space_peek+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @skip_space_peek() {
%1 = alloca i32
%2 = call i32 (...) @peek()
store i32 %2, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 (...) @advance_peek()
store i32 %7, i32* %1
br label %3
8: ; preds = %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @skip_space_peek() {
%1 = tail call i32 (...) @peek()
%2 = icmp eq i32 %1, 32
br i1 %2, label %3, label %6
3: ; preds = %0, %3
%4 = tail call i32 (...) @advance_peek()
%5 = icmp eq i32 %4, 32
br i1 %5, label %3, label %6
6: ; preds = %3, %0
%7 = phi i32 [ %1, %0 ], [ %4, %3 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __socket(int domain, int type, int protocol) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__socket>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__socket(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* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__socket(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x40() {
  Assert_real((isspace(64) == 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_isspace.c",
              325, ("isspace should be 0 for @"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x40>:
push   %rax
mov    $0x40,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x145,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for @\00"
define void @t_isspace_0x40() {
%1 = call i64 @isspace(i32 64)
%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 325, i8* getelementptr inbounds ([26 x i8], [26 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for @\00"
define void @t_isspace_0x40() {
%1 = tail call i64 @isspace(i32 64)
%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 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_ContentDirectory_DestroyObject(struct UPnPService *Service,
                                                    int ErrorCode, void *User) {
  printf(
      "RND Invoke Response: ContentDirectory/DestroyObject[ErrorCode:%d]()\r\n",
      ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_DestroyObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: ContentDirectory/DestroyObject[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_DestroyObject(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: ContentDirectory/DestroyObject[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_DestroyObject(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/ *);
int main() {
  foo(NULL);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32* null)
ret i32 0
}
/* Type definitions */
union sigval {
  int sival_int;
};

/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ perror(char *);
int sigqueue(int, int /*<<< orphan*/, union sigval);
int main(void) {
  union sigval value;
  int ret;
  value.sival_int = 404;
  ret = sigqueue(5186, SIGUSR2, value);
  if (ret) {
    perror("sigqueue");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x194,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x1442,%edi
call   1030 <sigqueue@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1165 <main+0x45>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    $0x1442,%edi
mov    $0x194,%edx
call   1030 <sigqueue@plt>
test   %eax,%eax
jne    1141 <main+0x21>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
jmp    113d <main+0x1d>

LLVM IR (-O0):
%union.sigval = type { i32 }
@SIGUSR2 = global i32 0
@.str = [9 x i8] c"sigqueue\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.sigval
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast %union.sigval* %2 to i32*
store i32 404, i32* %4
%5 = load i32, i32* @SIGUSR2
%6 = getelementptr inbounds %union.sigval, %union.sigval* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @sigqueue(i32 5186, i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
ret i32 0
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
@.str = [9 x i8] c"sigqueue\00"
define i32 @main() {
%1 = load i32, i32* @SIGUSR2
%2 = tail call i32 @sigqueue(i32 5186, i32 %1, i32 404)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_pop_front(struct genlist *);
void fc_sockaddr_list_pop_front(struct fc_sockaddr_list *tthis) {
  genlist_pop_front((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_pop_front>:
jmp    1030 <genlist_pop_front@plt>

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

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_pop_front(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_pop_front(%struct.genlist* %2)
ret void
}
void lh_free(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_2_1_1_2() {
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int16_t n;
  scanf("%d", &n);
  printf("%d minutos\n", 150 / 60 * n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
lea    0xebe(%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
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    %esi,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d minutos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int test_imm_1Fuint16_reg(unsigned short val) {
  return ((val) & (-0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffe1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Fuint16_reg>:
test   $0xffe1,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -31
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __attribute__((thiscall)) test4(int a, ...) {}


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

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

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

LLVM IR (-O2):
define void @test4(i32 %0, ...) {
ret void
}
/* Variables and functions */
int neumann_bc(int x, int nx, bool *out) {
  if (x < 0) {
    x = 0;
    *out = true;
  } else if (x >= nx) {
    x = nx - 1;
    *out = true;
  }
  return x;
}


x86 assembly (clang, -O0):
<neumann_bc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112e <neumann_bc+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1152 <neumann_bc+0x52>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     114d <neumann_bc+0x4d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1152 <neumann_bc+0x52>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neumann_bc>:
test   %edi,%edi
js     1111 <neumann_bc+0x11>
mov    %edi,%eax
cmp    %esi,%edi
jl     1119 <neumann_bc+0x19>
add    $0xffffffff,%esi
mov    %esi,%eax
jmp    1113 <neumann_bc+0x13>
xor    %eax,%eax
movl   $0x1,(%rdx)
ret

LLVM IR (-O0):
define i32 @neumann_bc(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* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
store i32 0, i32* %4
%10 = load i32*, i32** %6
store i32 1, i32* %10
br label %20
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %4
%18 = load i32*, i32** %6
store i32 1, i32* %18
br label %19
19: ; preds = %15, %11
br label %20
20: ; preds = %19, %9
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @neumann_bc(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp slt i32 %0, %1
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = add nsw i32 %1, -1
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ 0, %3 ]
store i32 1, i32* %2
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %0, %5 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int factorial(unsigned int);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int a;
  printf("Input a number: ");
  scanf("%i", &a);
  printf("Factorial of %i is %i", a, factorial(a));
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
lea    0xe9b(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Input a number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [22 x i8] c"Factorial of %i is %i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 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), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @factorial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
%9 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Input a number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [22 x i8] c"Factorial of %i is %i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @getch()
ret i32 0
}
int putchar(c) { return putc(c); }


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

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

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergeSort(int arr[], int l, int r) {
  if (l < r) {
    int m = (l + r) / 2;
    mergeSort(arr, l, m);
    mergeSort(arr, m + 1, r);
    merge(arr, l, m, r);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
int f(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 1
}

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
/* Variables and functions */
void *bfc_realloc(int /*<<< orphan*/, size_t);
void *bfc_malloc(size_t nbytes) { return bfc_realloc(0, nbytes); }


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

x86 assembly (clang, -O2):
<bfc_malloc>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <bfc_realloc@plt>

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

LLVM IR (-O2):
define i8* @bfc_malloc(i64 %0) {
%2 = tail call i8* @bfc_realloc(i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ truclient_step(char *, char *, char *);
Script_View_Init() {
  truclient_step("1", "Evaluate JavaScript code var jActionIterations = 0;",
                 "snapshot=Init_1.inf");
}


x86 assembly (clang, -O0):
<Script_View_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xf09(%rip),%rdx
call   1030 <truclient_step@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Script_View_Init>:
lea    0xee9(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xf11(%rip),%rdx
jmp    1030 <truclient_step@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [52 x i8] c"Evaluate JavaScript code var jActionIterations = 0;\00"
@.str.2 = [20 x i8] c"snapshot=Init_1.inf\00"
define i32 @Script_View_Init() {
%1 = alloca i32
%2 = call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [52 x i8] c"Evaluate JavaScript code var jActionIterations = 0;\00"
@.str.2 = [20 x i8] c"snapshot=Init_1.inf\00"
define i32 @Script_View_Init() {
%1 = tail call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
int memcmp(const void *cs, const void *ct, int count) {
  register int __res;
  __asm__("cld\n\t"
          "repe\n\t"
          "cmpsb\n\t"
          "je 1f\n\t"
          "movl $1,%%eax\n\t"
          "jl 1f\n\t"
          "negl %%eax\n"
          "1:"
          : "=a"(__res)
          : "0"(0), "D"(cs), "S"(ct), "c"(count));
  return __res;
}


x86 assembly (clang, -O0):
<memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cld
repz cmpsb %es:(%rdi),%ds:(%rsi)
je     1132 <memcmp+0x32>
mov    $0x1,%eax
jl     1132 <memcmp+0x32>
neg    %eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp>:
mov    %edx,%ecx
xor    %eax,%eax
cld
repz cmpsb %es:(%rdi),%ds:(%rsi)
je     1112 <memcmp+0x12>
mov    $0x1,%eax
jl     1112 <memcmp+0x12>
neg    %eax
ret

LLVM IR (-O0):
define i32 @memcmp(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 asm "cld\0A\09repe\0A\09cmpsb\0A\09je 1f\0A\09movl $$1,%eax\0A\09jl 1f\0A\09negl %eax\0A1:", "={ax},0,{di},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i8* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @memcmp(i8* readnone %0, i8* readnone %1, i32 %2) {
%4 = tail call i32 asm "cld\0A\09repe\0A\09cmpsb\0A\09je 1f\0A\09movl $$1,%eax\0A\09jl 1f\0A\09negl %eax\0A1:", "={ax},0,{di},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ this_comparison_is_true();
void bla1ne(int var) {
  if (var + 10 != INT_MIN + 9)
    this_comparison_is_true();
}


x86 assembly (clang, -O0):
<bla1ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
add    $0x9,%ecx
cmp    %ecx,%eax
je     113c <bla1ne+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla1ne>:
mov    0x2ed1(%rip),%rax
add    $0x1,%edi
cmp    (%rax),%edi
jne    111f <bla1ne+0xf>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_true@plt>

LLVM IR (-O0):
@INT_MIN = global i32 0
define void @bla1ne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = load i32, i32* @INT_MIN
%6 = add nsw i32 %5, 9
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_true()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define void @bla1ne(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = add nsw i32 %0, 1
%4 = icmp eq i32 %3, %2
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @this_comparison_is_true()
br label %7
7: ; preds = %5, %1
ret void
}
void swconfig_destroy_led_trigger(struct switch_dev *swdev) {}


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

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

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

LLVM IR (-O2):
%struct.switch_dev = type opaque
define void @swconfig_destroy_led_trigger(%struct.switch_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int binary_search(int);
int main(void) {
  int res = binary_search(8);
  return res;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%edi
jmp    1030 <binary_search@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @binary_search(i32 8)
ret i32 %1
}
int input_device_ack(void) { return 0xffffffff; }


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

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

LLVM IR (-O0):
define i32 @input_device_ack() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @input_device_ack() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int scanf(char *, int *);
int read_int() {
  int x;
  int scanf_result = scanf("%i", &x);
  if (scanf_result < 1)
    abort();
  return x;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    114c <read_int+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
test   %eax,%eax
jle    113c <read_int+0x1c>
mov    0x4(%rsp),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @read_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
ret i32 %8
}
extern int __attribute__((no, noclone, used)) stuff(int i) { return 0; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @stuff to i8*)], section "llvm.metadata"
define i32 @stuff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @stuff to i8*)], section "llvm.metadata"
define i32 @stuff(i32 %0) {
ret i32 0
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add1_buffer(struct buffer *, int);
int inchar();
int add_then_next(struct buffer *b, int ch) {
  add1_buffer(b, ch);
  return inchar();
}


x86 assembly (clang, -O0):
<add_then_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <add1_buffer@plt>
mov    $0x0,%al
call   1030 <inchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_then_next>:
push   %rax
call   1040 <add1_buffer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <inchar@plt>

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_then_next(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @add1_buffer(%struct.buffer* %0, i32 %1)
%4 = tail call i32 (...) @inchar()
ret i32 %4
}
const char *Concat_Brief(void) { return "Concatenate Objects"; }


x86 assembly (clang, -O0):
<Concat_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Concat_Brief>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Concatenate Objects\00"
define i8* @Concat_Brief() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [20 x i8] c"Concatenate Objects\00"
define i8* @Concat_Brief() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int is_le();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", is_le());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @is_le()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
const char *X509_get_default_cert_file(void) {
  return ("/etc/ssl"
          "/cert.pem");
}


x86 assembly (clang, -O0):
<X509_get_default_cert_file>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_get_default_cert_file>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/etc/ssl/cert.pem\00"
define i8* @X509_get_default_cert_file() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"/etc/ssl/cert.pem\00"
define i8* @X509_get_default_cert_file() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
long syscall3(long nr, long a1, long a2, long a3) {
  register long r0 asm("rax") = nr;
  register long r1 asm("rdi") = a1;
  register long r2 asm("rsi") = a2;
  register long r3 asm("rdx") = a3;
  asm volatile("syscall"
               : "=r"(r0)
               : "r"(r0), "r"(r1), "r"(r2), "r"(r3)
               : "rcx", "r11", "memory");
  return r0;
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
syscall
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
syscall
ret

LLVM IR (-O0):
define i64 @syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%13 = load i64, i64* %5
store i64 %13, i64* %9
%14 = load i64, i64* %6
store i64 %14, i64* %10
%15 = load i64, i64* %7
store i64 %15, i64* %11
%16 = load i64, i64* %8
store i64 %16, i64* %12
%17 = load i64, i64* %9
%18 = load i64, i64* %10
%19 = load i64, i64* %11
%20 = load i64, i64* %12
%21 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %17, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %9
%22 = load i64, i64* %9
ret i64 %22
}

LLVM IR (-O2):
define i64 @syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
void handle_54(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_54(i32 %0) {
ret void
}
extern int _lseek(int file_UNUSED __attribute__((__unused__)),
                  int ptr_UNUSED __attribute__((__unused__)),
                  int dir_UNUSED __attribute__((__unused__))) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @_lseek(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
ret i32 0
}

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_head(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++) {
    write_head(argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <write_head@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <write_head@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @write_head(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
pthread_mutex_t *f() { return malloc(sizeof(pthread_mutex_t)); }


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

x86 assembly (clang, -O2):
<f>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @f() {
%1 = call i32* @malloc(i32 4)
ret i32* %1
}

LLVM IR (-O2):
define noalias i32* @f() {
%1 = tail call i32* @malloc(i32 4)
ret i32* %1
}