xunge/DecIR huggingface dataset:
/* Type definitions */
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ns_mqtt_prepend_header(struct ns_connection *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void ns_mqtt_pong(struct ns_connection *nc) {
  ns_mqtt_prepend_header(nc, 13, 0, 0);
}


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

x86 assembly (clang, -O2):
<ns_mqtt_pong>:
mov    $0xd,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ns_mqtt_prepend_header@plt>

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

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_pong(%struct.ns_connection* %0) {
%2 = tail call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %0, i32 13, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int free_data(float *clone_data) {
  free(clone_data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @free_data(float* nocapture %0) {
%2 = tail call i32 @free(float* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *default_realloc(void *ctx, void *orig, size_t size) {
  (void)ctx;
  void *dest;
  if (!(dest = realloc(orig, size))) {
    free(orig);
    orig = NULL;
    return (NULL);
  }
  return (dest);
}


x86 assembly (clang, -O0):
<default_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    116d <default_realloc+0x4d>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x8(%rbp)
jmp    1175 <default_realloc+0x55>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <default_realloc+0x22>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @default_realloc(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
store i8* null, i8** %6
store i8* null, i8** %4
br label %19
17: ; preds = %3
%18 = load i8*, i8** %8
store i8* %18, i8** %4
br label %19
19: ; preds = %17, %14
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @default_realloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @free(i8* %1)
br label %8
8: ; preds = %3, %6
ret i8* %4
}
/* Variables and functions */
double max_out_three(float, float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main() {
  float a, b, c;
  printf("Enter number A B and C:\n");
  scanf("%f %f %f", &a, &b, &c);
  printf("%f", max_out_three(a, b, c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1050 <max_out_three@plt>
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1060 <max_out_three@plt>
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter number A B and C:\0A\00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call double @max_out_three(float %7, float %8, float %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [3 x i8] c"%f\00"
@str = [24 x i8] c"Enter number A B and C:\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = load float, float* %3
%12 = call double @max_out_three(float %9, float %10, float %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %12)
ret i32 0
}
void tempInit() {}


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

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

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

LLVM IR (-O2):
define void @tempInit() {
ret void
}
/* Variables and functions */
float truncf(float);
float test4f(float x) { return truncf(x); }


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

x86 assembly (clang, -O2):
<test4f>:
jmp    1030 <truncf@plt>

LLVM IR (-O0):
define float @test4f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.trunc.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test4f(float %0) {
%2 = tail call float @llvm.trunc.f32(float %0)
ret float %2
}
int inter_storage_sql_init(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @inter_storage_sql_init() {
ret i32 1
}
int test_imm_5Buint8_reg(unsigned char val) {
  return ((val) & (0x5B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x5b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 91
%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_5Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 91
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(2);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x2c() {
  Assert_real((iscntrl(44) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              225, ("iscntrl should be 0 for ,"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x2c>:
push   %rax
mov    $0x2c,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xe1,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for ,\00"
define void @t_iscntrl_0x2c() {
%1 = call i64 @iscntrl(i32 44)
%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 225, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for ,\00"
define void @t_iscntrl_0x2c() {
%1 = tail call i64 @iscntrl(i32 44)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ rp_Init();
int /*<<< orphan*/ stderr;
void init() {
  if (rp_Init() != 0) {
    fprintf(stderr, "Rp api init failed!\n");
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rp_Init@plt>
cmp    $0x0,%rax
je     114a <init+0x2a>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1030 <rp_Init@plt>
test   %rax,%rax
je     1143 <init+0x23>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Rp api init failed!\0A\00"
define void @init() {
%1 = call i64 (...) @rp_Init()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Rp api init failed!\0A\00"
define void @init() {
%1 = tail call i64 (...) @rp_Init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ clearok(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ screen_refresh();
int /*<<< orphan*/ stdscr;
void screen_redraw(void) {
  clearok(stdscr, TRUE);
  screen_refresh();
}


x86 assembly (clang, -O0):
<screen_redraw>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <clearok@plt>
mov    $0x0,%al
call   1040 <screen_refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_redraw>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1030 <clearok@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <screen_refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @screen_redraw() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = call i32 @clearok(i32 %1, i32 %2)
%4 = call i32 (...) @screen_refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @screen_redraw() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = tail call i32 @clearok(i32 %1, i32 %2)
%4 = tail call i32 (...) @screen_refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  for (int i = 0; i < 1000; i++)
    printf("%d ", i);
  printf("\n");
  return 0;
}


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   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1159 <main+0x49>
mov    -0x14(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
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 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %5
3: ; preds = %5
%4 = tail call i32 @putchar(i32 10)
ret i32 0
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %8, %5 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %3, label %5
}
/* Variables and functions */
int /*<<< orphan*/ fd_log_at(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void fd_log(char *message) { fd_log_at(0, 0, message); }


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

x86 assembly (clang, -O2):
<fd_log>:
mov    %rdi,%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <fd_log_at@plt>

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

LLVM IR (-O2):
define void @fd_log(i8* %0) {
%2 = tail call i32 @fd_log_at(i32 0, i32 0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
void test9(int X) {
  int Arr[100] = {X};
  bar(Arr);
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1a0(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1030 <bar@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    $0x190,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %ebx,(%rsp)
mov    %r14,%rdi
call   1030 <bar@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test9(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
store i32 %0, i32* %2
%4 = bitcast [100 x i32]* %3 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
store i32 %6, i32* %5
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%8 = call i32 @bar(i32* %7)
ret void
}

LLVM IR (-O2):
define void @test9(i32 %0) {
%2 = alloca [100 x i32]
%3 = bitcast [100 x i32]* %2 to i8*
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
store i32 %0, i32* %4
%5 = call i32 @bar(i32* %4)
ret void
}
/* Type definitions */
struct twhlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TWINIT_HLIST_NODE(struct twhlist_node *);
int /*<<< orphan*/ __twhlist_del(struct twhlist_node *);
int /*<<< orphan*/ twhlist_unhashed(struct twhlist_node *);
void twhlist_del_init(struct twhlist_node *n) {
  if (!twhlist_unhashed(n)) {
    __twhlist_del(n);
    TWINIT_HLIST_NODE(n);
  }
}


x86 assembly (clang, -O0):
<twhlist_del_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <twhlist_unhashed@plt>
cmp    $0x0,%eax
jne    1160 <twhlist_del_init+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <__twhlist_del@plt>
mov    -0x8(%rbp),%rdi
call   1050 <TWINIT_HLIST_NODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twhlist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <twhlist_unhashed@plt>
test   %eax,%eax
je     113f <twhlist_del_init+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <__twhlist_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <TWINIT_HLIST_NODE@plt>

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

LLVM IR (-O2):
%struct.twhlist_node = type { i32 }
define void @twhlist_del_init(%struct.twhlist_node* %0) {
%2 = tail call i32 @twhlist_unhashed(%struct.twhlist_node* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @__twhlist_del(%struct.twhlist_node* %0)
%6 = tail call i32 @TWINIT_HLIST_NODE(%struct.twhlist_node* %0)
br label %7
7: ; preds = %4, %1
ret void
}
int test_imm_41uint8_reg(unsigned char val) {
  return ((val) & (0x41 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_41uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_41uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 65
%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_41uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 65
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t cur_us_ts(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return 1000000 * (uint64_t)tv.tv_sec + tv.tv_usec;
}


x86 assembly (clang, -O0):
<cur_us_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cur_us_ts>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @cur_us_ts() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @cur_us_ts() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
int isBeginningOf(char *s, char *scode) {
  while (*scode) {
    if (*s++ != *scode++)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isBeginningOf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <isBeginningOf+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <isBeginningOf+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <isBeginningOf+0x5d>
jmp    110c <isBeginningOf+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBeginningOf>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <isBeginningOf+0x27>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <isBeginningOf+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isBeginningOf(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
/* Variables and functions */
char *calloc(size_t, int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *rmalloc_strndup(const char *s, size_t n) {
  char *ret = calloc(n + 1, sizeof(char));
  if (ret)
    memcpy(ret, s, n);
  return ret;
}


x86 assembly (clang, -O0):
<rmalloc_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <rmalloc_strndup+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmalloc_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114f <rmalloc_strndup+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @rmalloc_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
isspace(c) char c;
{
  if (c == ' ' | c == '\t' | c == '\n')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x9,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0xa,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     1152 <isspace+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <isspace+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
shl    $0x18,%edi
mov    $0x1,%eax
cmp    $0x9000000,%edi
je     1122 <isspace+0x22>
cmp    $0xa000000,%edi
je     1122 <isspace+0x22>
cmp    $0x20000000,%edi
je     1122 <isspace+0x22>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%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 eq i32 %6, 32
%8 = zext i1 %7 to i32
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 9
%12 = zext i1 %11 to i32
%13 = or i32 %8, %12
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
%17 = zext i1 %16 to i32
%18 = or i32 %13, %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %1
store i32 1, i32* %2
br label %22
21: ; preds = %1
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = shl i32 %0, 24
switch i32 %2, label %3 [
i32 536870912, label %4
i32 167772160, label %4
i32 150994944, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Type definitions */
struct net_bridge {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ br_designated_port_selection(struct net_bridge *);
int /*<<< orphan*/ br_root_selection(struct net_bridge *);
void br_configuration_update(struct net_bridge *br) {
  br_root_selection(br);
  br_designated_port_selection(br);
}


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

x86 assembly (clang, -O2):
<br_configuration_update>:
push   %rbx
mov    %rdi,%rbx
call   1040 <br_root_selection@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <br_designated_port_selection@plt>

LLVM IR (-O0):
%struct.net_bridge = type { i32 }
define void @br_configuration_update(%struct.net_bridge* %0) {
%2 = alloca %struct.net_bridge*
store %struct.net_bridge* %0, %struct.net_bridge** %2
%3 = load %struct.net_bridge*, %struct.net_bridge** %2
%4 = call i32 @br_root_selection(%struct.net_bridge* %3)
%5 = load %struct.net_bridge*, %struct.net_bridge** %2
%6 = call i32 @br_designated_port_selection(%struct.net_bridge* %5)
ret void
}

LLVM IR (-O2):
%struct.net_bridge = type { i32 }
define void @br_configuration_update(%struct.net_bridge* %0) {
%2 = tail call i32 @br_root_selection(%struct.net_bridge* %0)
%3 = tail call i32 @br_designated_port_selection(%struct.net_bridge* %0)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int write(int, void const *, size_t);
ssize_t std_write(int fd, const void *buf, size_t count) {
  ssize_t c;
  if ((c = write(fd, buf, count)) == -1) {
    perror("write");
    exit(1);
  }
  return c;
}


x86 assembly (clang, -O0):
<std_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <std_write+0x45>
lea    0xe9a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_write>:
push   %rax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     113d <std_write+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define i32 @std_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int flags;
};
typedef TYPE_1__ X509_TRUST;

/* Variables and functions */
int X509_TRUST_get_flags(const X509_TRUST *xp) { return xp->flags; }


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

x86 assembly (clang, -O2):
<X509_TRUST_get_flags>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @X509_TRUST_get_flags(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @X509_TRUST_get_flags(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, int /*<<< orphan*/ *, int);
int anetTcpNonBlockConnect(char *err, char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, NULL, 1);
}


x86 assembly (clang, -O0):
<anetTcpNonBlockConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%r8d
call   1030 <anetTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpNonBlockConnect>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <anetTcpGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @anetTcpNonBlockConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32* null, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ arm_lsl(int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_imm5_op(int /*<<< orphan*/);
void t16_lsl_imm5() { arm_lsl(t16_data_imm5_op(0)); }


x86 assembly (clang, -O0):
<t16_lsl_imm5>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <t16_data_imm5_op@plt>
mov    %eax,%edi
call   1030 <arm_lsl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_lsl_imm5>:
push   %rax
xor    %edi,%edi
call   1040 <t16_data_imm5_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_lsl@plt>

LLVM IR (-O0):
define void @t16_lsl_imm5() {
%1 = call i32 @t16_data_imm5_op(i32 0)
%2 = call i32 @arm_lsl(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_lsl_imm5() {
%1 = tail call i32 @t16_data_imm5_op(i32 0)
%2 = tail call i32 @arm_lsl(i32 %1)
ret void
}
int ip6cp_this_layer_started(struct lcp_context *context) {
  context = context;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.lcp_context = type opaque
define i32 @ip6cp_this_layer_started(%struct.lcp_context* nocapture readnone %0) {
ret i32 0
}
void iowrite32(unsigned short port, unsigned int v) {
  __asm__ __volatile__("outl %0, %1" : : "a"(v), "d"(port));
}


x86 assembly (clang, -O0):
<iowrite32>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x2(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowrite32>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @iowrite32(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @iowrite32(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outl $0, $1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i16 %0)
ret void
}
unsigned count_ones(unsigned int n) {
  unsigned res = 0;
  for (; n != 0; res++, n &= n - 1)
    ;
  return res;
}


x86 assembly (clang, -O0):
<count_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <count_ones+0x37>
jmp    111d <count_ones+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_ones+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ones>:
xor    %eax,%eax
test   %edi,%edi
je     111c <count_ones+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <count_ones+0x10>
ret

LLVM IR (-O0):
define i32 @count_ones(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = add i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = sub i32 %11, 1
%13 = load i32, i32* %2
%14 = and i32 %13, %12
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @count_ones(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ runtimeError(char *);
float *vector(long nl, long nh) {
  float *v;
  v = (float *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(float)));
  if (!v)
    runtimeError("allocation failure in vector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <vector+0x44>
lea    0xea1(%rip),%rdi
call   1040 <runtimeError@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <vector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <runtimeError@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to float*
store float* %13, float** %5
%14 = load float*, float** %5
%15 = icmp ne float* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @runtimeError(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load float*, float** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = getelementptr inbounds float, float* %22, i64 1
ret float* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @runtimeError(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sub i64 0, %0
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = getelementptr inbounds float, float* %13, i64 1
ret float* %14
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sleepms(int millisegundos) {
  millisegundos = 1000 * millisegundos;
  usleep(millisegundos);
}


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

x86 assembly (clang, -O2):
<sleepms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleepms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @usleep(i32 %5)
ret void
}

LLVM IR (-O2):
define void @sleepms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
float fastsqrt(float x) {
  asm("fsqrt" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<fastsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
flds   -0x8(%rbp)
fsqrt
fstps  -0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsqrt>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fsqrt
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @fastsqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %3)
store float %4, float* %2
%5 = load float, float* %2
ret float %5
}

LLVM IR (-O2):
define float @fastsqrt(float %0) {
%2 = tail call float asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, void **);
void thread_destroy(void *thread) {
  void *r = 0;
  pthread_join((pthread_t)thread, &r);
}


x86 assembly (clang, -O0):
<thread_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
call   1030 <pthread_join@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_destroy>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <pthread_join@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @thread_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @pthread_join(i32 %5, i8** %3)
ret void
}

LLVM IR (-O2):
define void @thread_destroy(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @pthread_join(i32 %5, i8** %2)
ret void
}
int foo() {
  static int x = 1;
  return x++;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@foo.x = internal global i32 1
define i32 @foo() {
%1 = load i32, i32* @foo.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.x
ret i32 %1
}

LLVM IR (-O2):
@foo.x = internal unnamed_addr global i32 1
define i32 @foo() {
%1 = load i32, i32* @foo.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.x
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void TTWAIN_FreeMemory(void *hMem) { free(hMem); }


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

x86 assembly (clang, -O2):
<TTWAIN_FreeMemory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @TTWAIN_FreeMemory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int foo(int a, int b, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, ...) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t rust_int8_to_int32(int8_t x) { return (int32_t)x; }


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

x86 assembly (clang, -O2):
<rust_int8_to_int32>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rust_int8_to_int32(i32 returned %0) {
ret i32 %0
}