xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int16_t smod16(int16_t a, int16_t b) {
  int16_t r;
  if (b == 0) {
    fprintf(stderr, "Should not happen\n");
    exit(EXIT_FAILURE);
  }
  r = a % b;
  return r;
}


x86 assembly (clang, -O0):
<smod16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <smod16+0x3b>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smod16>:
test   %esi,%esi
je     112c <smod16+0xc>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret
push   %rax
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @smod16(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = srem i32 %0, %1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b, c;
  a = 5;
  b = 7;
  c = a < b ? a : b;
  printf("%d", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1144 <main+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114a <main+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int mlx5e_arfs_create_tables(struct mlx5e_priv *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mlx5e_priv = type opaque
define i32 @mlx5e_arfs_create_tables(%struct.mlx5e_priv* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *__malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<__malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void writeerr(a) const char *const a;
{}


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

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

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

LLVM IR (-O2):
define void @writeerr(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CONS_Printf(char *);
int /*<<< orphan*/ G_CheckDemoStatus();
void Command_Stopdemo_f(void) {
  G_CheckDemoStatus();
  CONS_Printf(("Stopped demo.\n"));
}


x86 assembly (clang, -O0):
<Command_Stopdemo_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <G_CheckDemoStatus@plt>
lea    0xece(%rip),%rdi
call   1030 <CONS_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_Stopdemo_f>:
push   %rax
xor    %eax,%eax
call   1040 <G_CheckDemoStatus@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <CONS_Printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Stopped demo.\0A\00"
define void @Command_Stopdemo_f() {
%1 = call i32 (...) @G_CheckDemoStatus()
%2 = call i32 @CONS_Printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Stopped demo.\0A\00"
define void @Command_Stopdemo_f() {
%1 = tail call i32 (...) @G_CheckDemoStatus()
%2 = tail call i32 @CONS_Printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void clearVector(double *v) { v[0] = v[1] = v[2] = 0.0; }


x86 assembly (clang, -O0):
<clearVector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearVector>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
movq   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @clearVector(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 2
store double 0.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0.000000e+00, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 0
store double 0.000000e+00, double* %8
ret void
}

LLVM IR (-O2):
define void @clearVector(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to i8*
ret void
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
extern char *str_user() {
  struct passwd *pw = getpwuid(getuid());
  return pw->pw_name;
}


x86 assembly (clang, -O0):
<str_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_user>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @str_user() {
%1 = alloca %struct.passwd*
%2 = call i32 (...) @getuid()
%3 = call %struct.passwd* @getpwuid(i32 %2)
store %struct.passwd* %3, %struct.passwd** %1
%4 = load %struct.passwd*, %struct.passwd** %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %4, i32 0, i32 0
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @str_user() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i8*, i8** %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int main(void) {
  int i;
  initialise_board();
  start_trigger();
  for (i = 0; i < (4096 >> 10); i++)
    benchmark();
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1183 <main+0x43>
mov    $0x0,%al
call   1050 <benchmark@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initialise_board()
%4 = call i32 (...) @start_trigger()
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 (...) @benchmark()
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %5
13: ; preds = %5
%14 = call i32 (...) @stop_trigger()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
%3 = tail call i32 (...) @benchmark()
%4 = tail call i32 (...) @benchmark()
%5 = tail call i32 (...) @benchmark()
%6 = tail call i32 (...) @benchmark()
%7 = tail call i32 (...) @stop_trigger()
ret i32 0
}
/* Type definitions */
struct jvm_interface {
  int dummy;
};

/* Variables and functions */
struct jvm_interface **malloc(int);
struct jvm_interface **alloc_pointer_array() {
  struct jvm_interface **p = malloc(sizeof(struct jvm_interface *) * 10);
  return p;
}


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

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

LLVM IR (-O0):
%struct.jvm_interface = type { i32 }
define %struct.jvm_interface** @alloc_pointer_array() {
%1 = alloca %struct.jvm_interface**
%2 = call %struct.jvm_interface** @malloc(i32 80)
store %struct.jvm_interface** %2, %struct.jvm_interface*** %1
%3 = load %struct.jvm_interface**, %struct.jvm_interface*** %1
ret %struct.jvm_interface** %3
}

LLVM IR (-O2):
%struct.jvm_interface = type { i32 }
define noalias %struct.jvm_interface** @alloc_pointer_array() {
%1 = tail call %struct.jvm_interface** @malloc(i32 80)
ret %struct.jvm_interface** %1
}
void sys_setmidiprefix(const char *prefix) {}


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

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

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

LLVM IR (-O2):
define void @sys_setmidiprefix(i8* nocapture %0) {
ret void
}
int fa_network_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fa_network_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int telnetsuspend(int ac, char *av[]) {
  (void)ac;
  (void)av;
  printf("Suspend is not supported.  Try the '!' command instead\r\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<telnetsuspend>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Suspend is not supported. Try the '!' command instead\0D\0A\00"
define i32 @telnetsuspend(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [56 x i8] c"Suspend is not supported. Try the '!' command instead\0D\00"
define i32 @telnetsuspend(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xef() {
  Assert_real((isupper(239) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1200, ("isupper should be 0 for 0xef"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xef\00"
define void @t_isupper_0xef() {
%1 = call i64 @isupper(i32 239)
%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 1200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xef\00"
define void @t_isupper_0xef() {
%1 = tail call i64 @isupper(i32 239)
%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 1200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int smd_debugfs_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smd_debugfs_init() {
ret i32 0
}
char lowerc(ch)
char ch;
{
  if ((('A' <= ch && 'Z' >= ch)))
    return (ch + 0x20);
  else
    return (ch);
}


x86 assembly (clang, -O0):
<lowerc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     113b <lowerc+0x3b>
movsbl -0x2(%rbp),%ecx
mov    $0x5a,%eax
cmp    %ecx,%eax
jl     113b <lowerc+0x3b>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1141 <lowerc+0x41>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowerc>:
mov    %edi,%eax
shl    $0x18,%eax
add    $0xbfffffff,%eax
lea    0x20(%rdi),%ecx
cmp    $0x1affffff,%eax
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lowerc(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sle i32 65, %6
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 90, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 32
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %8, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %12
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @lowerc(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
%5 = add i32 %0, 32
%6 = select i1 %4, i32 %5, i32 %0
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ sigjmp_buf;

/* Variables and functions */
int sigsetjmp(int /*<<< orphan*/, int);
int uses_longjmp(int **, int, int /*<<< orphan*/);
int __attribute__((no)) uses_setjmp(int num) {
  int big_array[100];
  int *other_array = NULL;
  sigjmp_buf cur_env;
  int temp = 0;
  if ((temp = sigsetjmp(cur_env, 1)) != 0) {
    if (other_array != NULL)
      return other_array[0];
    return 100;
  } else
    return uses_longjmp(&other_array, num, cur_env);
}


x86 assembly (clang, -O0):
<uses_setjmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x1a8(%rbp)
movl   $0x0,-0x1b0(%rbp)
mov    -0x1ac(%rbp),%edi
mov    $0x1,%esi
call   1040 <sigsetjmp@plt>
mov    %eax,-0x1b0(%rbp)
cmp    $0x0,%eax
je     118d <uses_setjmp+0x6d>
cmpq   $0x0,-0x1a8(%rbp)
je     1181 <uses_setjmp+0x61>
mov    -0x1a8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a5 <uses_setjmp+0x85>
movl   $0x64,-0x4(%rbp)
jmp    11a5 <uses_setjmp+0x85>
mov    -0x8(%rbp),%esi
mov    -0x1ac(%rbp),%edx
lea    -0x1a8(%rbp),%rdi
call   1030 <uses_longjmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uses_setjmp>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
mov    $0x1,%esi
call   1040 <sigsetjmp@plt>
mov    $0x64,%ecx
test   %eax,%eax
jne    1151 <uses_setjmp+0x31>
lea    0x8(%rsp),%rdi
mov    %ebx,%esi
call   1030 <uses_longjmp@plt>
mov    %eax,%ecx
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @uses_setjmp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32* null, i32** %5
store i32 0, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @sigsetjmp(i32 %8, i32 1)
store i32 %9, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %1
%12 = load i32*, i32** %5
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
store i32 %17, i32* %2
br label %23
18: ; preds = %11
store i32 100, i32* %2
br label %23
19: ; preds = %1
%20 = load i32, i32* %3
%21 = load i32, i32* %6
%22 = call i32 @uses_longjmp(i32** %5, i32 %20, i32 %21)
store i32 %22, i32* %2
br label %23
23: ; preds = %19, %18, %14
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @uses_setjmp(i32 %0) {
%2 = alloca i32*
%3 = bitcast i32** %2 to i8*
store i32* null, i32** %2
%4 = call i32 @sigsetjmp(i32 undef, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @uses_longjmp(i32** %2, i32 %0, i32 undef)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ 100, %1 ]
ret i32 %9
}
/* Variables and functions */
int foo();
int main() { return foo(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
void GB_TIMES_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (*x) * (*y);
}


x86 assembly (clang, -O0):
<GB_TIMES_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_TIMES_f_FP64>:
movsd  (%rsi),%xmm0
mulsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_TIMES_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fmul double %8, %10
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @GB_TIMES_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %0
ret void
}
/* Variables and functions */
char *__kernel_strcpy(char *, char const *);
char *strcpy(char *dest, const char *src) { return __kernel_strcpy(dest, src); }


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

x86 assembly (clang, -O2):
<strcpy>:
jmp    1030 <__kernel_strcpy@plt>

LLVM IR (-O0):
define i8* @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 = call i8* @__kernel_strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = tail call i8* @__kernel_strcpy(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int fail_the_test(void *);
int pass_the_test(void *);
int __attribute__((no)) foo(void *p) {
  uintptr_t a = (uintptr_t)p;
  if (a % 16)
    return fail_the_test(p);
  else
    return pass_the_test(p);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
je     1157 <foo+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <fail_the_test@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <foo+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <pass_the_test@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   $0xf,%dil
je     112b <foo+0xb>
jmp    1030 <fail_the_test@plt>
jmp    1040 <pass_the_test@plt>

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = urem i64 %7, 16
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @fail_the_test(i8* %11)
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @pass_the_test(i8* %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 15
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fail_the_test(i8* %0)
br label %9
7: ; preds = %1
%8 = tail call i32 @pass_the_test(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(unsigned n, int arr[n]) {
  int i;
  for (i = 0; i < n; ++i) {
    printf("%d\n", arr[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1157 <print+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     1145 <print+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
store i32 0, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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 void
}
void i2a_ASN1_STRING(void) {}


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

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

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

LLVM IR (-O2):
define void @i2a_ASN1_STRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DatoCaracter();
int main() {
  DatoCaracter();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @DatoCaracter()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ kill_pandoc();
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void signal_handler(int signum) {
  kill_pandoc();
  signal(signum, SIG_DFL);
  raise(signum);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <kill_pandoc@plt>
mov    -0x4(%rbp),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <kill_pandoc@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @kill_pandoc()
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @raise(i32 %7)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @kill_pandoc()
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
%5 = tail call i32 @raise(i32 %0)
ret void
}
unsigned long is_power_of_two(unsigned long value) {
  return ((value != 0) && !(value & (value - 1)));
}


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <is_power_of_two+0x33>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
test   %rdi,%rdi
je     1112 <is_power_of_two+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @is_power_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @is_power_of_two(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i64
br label %7
7: ; preds = %3, %1
%8 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ NP();
int /*<<< orphan*/ VP();
int S() {
  NP();
  VP();
}


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

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

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

LLVM IR (-O2):
define i32 @S() {
%1 = tail call i32 (...) @NP()
%2 = tail call i32 (...) @VP()
ret i32 undef
}
int is_prime(int num) {
  int i;
  for (i = 2; i <= num - 1; i++) {
    if (num % i == 0)
      return 0;
  }
  if (i == num)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     114e <is_prime+0x4e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113b <is_prime+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_prime+0x6d>
jmp    1140 <is_prime+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1166 <is_prime+0x66>
movl   $0x1,-0x4(%rbp)
jmp    116d <is_prime+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     1122 <is_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     112a <is_prime+0x2a>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <is_prime+0x10>
mov    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %1
%11 = phi i32 [ 2, %1 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %3, %10
%15 = phi i32 [ %13, %10 ], [ 0, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ x_ipcRegisterExitProc(void (*)());
void carmen_ipc_registerExitProc(void (*proc)(void)) {
  x_ipcRegisterExitProc(proc);
}


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

x86 assembly (clang, -O2):
<carmen_ipc_registerExitProc>:
jmp    1030 <x_ipcRegisterExitProc@plt>

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

LLVM IR (-O2):
define void @carmen_ipc_registerExitProc(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @x_ipcRegisterExitProc(void (...)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void *wiggle_xmalloc(int size) {
  void *rv = malloc(size);
  if (size && !rv) {
    char *msg = "Failed to allocate memory - aborting\n";
    write(2, msg, strlen(msg));
    exit(3);
  }
  return rv;
}


x86 assembly (clang, -O0):
<wiggle_xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11a2 <wiggle_xmalloc+0x62>
cmpq   $0x0,-0x10(%rbp)
jne    11a2 <wiggle_xmalloc+0x62>
lea    0xe8d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x3,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiggle_xmalloc>:
push   %rbx
mov    %edi,%ebx
call   1050 <malloc@plt>
test   %ebx,%ebx
je     1151 <wiggle_xmalloc+0x11>
test   %rax,%rax
je     1153 <wiggle_xmalloc+0x13>
pop    %rbx
ret
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x3,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Failed to allocate memory - aborting\0A\00"
define i8* @wiggle_xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @malloc(i32 %5)
store i8* %6, i8** %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %18, label %12
12: ; preds = %9
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @write(i32 2, i8* %13, i32 %15)
%17 = call i32 @exit(i32 3)
unreachable
18: ; preds = %9, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [38 x i8] c"Failed to allocate memory - aborting\0A\00"
define noalias i8* @wiggle_xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i32 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 3)
unreachable
10: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ getid(int);
int /*<<< orphan*/ print(int /*<<< orphan*/);
int main() {
  int a;
  ;
  ;
  getid(a);
  print(f(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getid@plt>
call   1030 <f@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = call i32 @getid(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @f(i32 %5)
%7 = call i32 @print(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getid(i32 undef)
%2 = tail call i32 @f(i32 undef)
%3 = tail call i32 @print(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _log(int /*<<< orphan*/);
int /*<<< orphan*/ bfromcstr(char *);
scalar_t__ envtostr(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void ignore_auth_users(void) {
  if (envtostr("SMTPAUTHUSER")) {
    _log(bfromcstr("No checks performed, because user is authenticated"));
    exit(0);
  }
}


x86 assembly (clang, -O0):
<ignore_auth_users>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1060 <envtostr@plt>
cmp    $0x0,%rax
je     1174 <ignore_auth_users+0x34>
lea    0xeac(%rip),%rdi
call   1040 <bfromcstr@plt>
mov    %eax,%edi
call   1030 <_log@plt>
xor    %edi,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_auth_users>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <envtostr@plt>
test   %rax,%rax
jne    1154 <ignore_auth_users+0x14>
pop    %rax
ret
lea    0xeb2(%rip),%rdi
call   1040 <bfromcstr@plt>
mov    %eax,%edi
call   1030 <_log@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"SMTPAUTHUSER\00"
@.str.1 = [51 x i8] c"No checks performed, because user is authenticated\00"
define void @ignore_auth_users() {
%1 = call i64 @envtostr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @bfromcstr(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @_log(i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"SMTPAUTHUSER\00"
@.str.1 = [51 x i8] c"No checks performed, because user is authenticated\00"
define void @ignore_auth_users() {
%1 = tail call i64 @envtostr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @bfromcstr(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @_log(i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}
void __ipipe_init_taskinfo(struct task_struct *p) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__ipipe_init_taskinfo(%struct.task_struct* nocapture %0) {
ret void
}
void write_kernels_strength_noise_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @write_kernels_strength_noise_adios_() {
ret void
}
/* Variables and functions */
float quartIn(int, float, float, float);
float quartOut(float fraction, float start, float delta, float slope) {
  return quartIn(1 - fraction, start + delta, -delta, slope);
}


x86 assembly (clang, -O0):
<quartOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <quartIn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quartOut>:
movss  0xee8(%rip),%xmm4
subss  %xmm0,%xmm4
cvttss2si %xmm4,%edi
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xee2(%rip),%xmm2
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <quartIn@plt>

LLVM IR (-O0):
define float @quartOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = fsub float 1.000000e+00, %9
%11 = fptosi float %10 to i32
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fadd float %12, %13
%15 = load float, float* %7
%16 = fneg float %15
%17 = load float, float* %8
%18 = call float @quartIn(i32 %11, float %14, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
define float @quartOut(float %0, float %1, float %2, float %3) {
%5 = fsub float 1.000000e+00, %0
%6 = fptosi float %5 to i32
%7 = fadd float %1, %2
%8 = fneg float %2
%9 = tail call float @quartIn(i32 %6, float %7, float %8, float %3)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int is_digit(const char *str) {
  char *p = (char *)str;
  while (*p != '\0') {
    if (!isdigit(*p))
      return 0;
    p++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <is_digit+0x56>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <is_digit+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_digit+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <is_digit+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_digit+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <is_digit+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_digit+0x20>
jmp    114b <is_digit+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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